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