Ask Your Question

Revision history [back]

you should correct the line

detected_area = contourArea(i);

to

detected_area = contourArea(contours[i]);