Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Getting full objects on a binary image (C++)

Hi there,

I have a binary image like this:

image description

When I apply findContours function to the image I get one vector<vector<point> > which contains a set of points for each object detected. So, when I try to draw the first element of the vector<vector<point> > variable I get the next output image:

image description

If I draw the same image using the parameter CV_FILLED, I get the next result:

image description

My answer is: Can I get the whole pixels of each object, instead the pixels of the contours? So when I paint all the pixels of the vector I get the image #3. I want to process all the pixels of an object, not only the contours.

Thank you.