Connected Component Labeling
Does anyone have any code or know where to find any code for doing connected component labeling on binary images?
I'm using the CImage class to load the image and using the GetBits() function to get a pointer to the image array. I need to be able to take that image and put it into a connected component labeling function and receive a labeled image.
Thanks
Re: Connected Component Labeling
OpenCV has a number of connected-component capabilities (plus much more):
http://opencv.willowgarage.com/wiki/cvBlobsLib
Additionally, a one-pass algorithm which you can implement yourself is described here:
http://en.wikipedia.org/wiki/Blob_extraction
I would suggest using a disjoint-set data structure (http://en.wikipedia.org/wiki/Disjoin...data_structure) to allow easy merging of components.
Re: Connected Component Labeling
Thanks I ended up with my own version of cvBlobslib. I liked the original, however, it used a contour based approach to find a lot of the blob properties. However, my blobs were only 2 - 5 pixels in area and it didn't do a good job of determining their geometric properties.