Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Have you checked docs? This is stated: The function computes a contour area. Similarly to moments , the area is computed using the Green formula. Thus, the returned area and the number of non-zero pixels, if you draw the contour using drawContours or fillPoly , can be different. Also, the function will most certainly give a wrong results for contours with self-intersections.