Ask Your Question

Revision history [back]

Your shape doesn't seem to be close. So the function can't know if the point is inside or outside the shape... Just add the first point at the end of your shape to close it:

contours[maxAreaIndex].push_back(contours[maxAreaIndex][0]);

It should do the trick...