Find the closest black pixel

Discussion in 'iOS Programming' started by iphonejudy, Oct 6, 2009.

  1. iphonejudy macrumors 6502

    iphonejudy

    Joined:
    Sep 12, 2008
    #1
    I want to find the closest black pixel in the surrounding of the touch coordinates(x,y)of an image.

    So i can get the bounds of an image.



    Any help pls?
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Push the pixel coordinates surrounding the touch into a list check each one and if it's not black push the pixels that it touches that are outside the checked area onto the back of the list. Keep going until you find a black pixel.
     

Share This Page