how to find pixels common to an object?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: how to find pixels common to an object?

  1. #1
    Join Date
    Nov 2010
    Posts
    3

    how to find pixels common to an object?

    There is an image of set of circles( or set of ellipses) projected on a 2-D surface. The width of each circle (or ellipses) is finite. Now I wish to group these pixels, that is, group = all pixels that belong to one circle.
    I can traverse each pixel and try to figure if it is adjacent to previous and thus find the groups. However, is there an elegant algorithm to do the same task?

    -Ravi

  2. #2
    Join Date
    Oct 2006
    Posts
    616

    Re: how to find pixels common to an object?

    In general, you can use the Flood Fill algorithm in order to find all pixels with the same color, starting from a given pixel.
    But what will you do if you have two different circles which are intersecting and have the same color pixels ? if this case is possible, then simple flood-fill will not do the trick.

    If you paint each circle with a different color, and you know the colors in advance, then grouping the pixels is easy: all pixels of the same color belong to the same circle.

    Regards,
    Zachm

  3. #3
    Join Date
    Nov 2010
    Posts
    3

    Re: how to find pixels common to an object?

    I should have mentioned that the circles do not intersect. Thank you for pointing me to the algorithm.
    -Ravi

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center