Centroid of contour

Hi guys,

I’m trying to do some stuff with contours. I’ve found my countours using:
cvFindContours

Now I would like to get some information about my contours, like area and centroid position…

How do I extract this data? I’ve seen that there is a contourArea function, but I haven’t seen it used.

you should take a look at the ofxCvContourFinder and the ofxCvBlob in the addon for opencv in openframeworks. we already calculate the centroid, bounding box, area and length.

the opencv example in the fat package and show you contour finding, and you should be able to poke around and see the area / midpoint calculation.

take care,
zach

Thanks for the quick reply :slight_smile: