I\'m using OpenCV 2.4 to calculate the convex hull of a image.
I\'m also doing some processing to remove some noise from the image, which is not really relevant to
I've been having the same error for a while until the solution was presented to me. Just check the size of contours[i] before calling convexityDefects
/// Find the convex hull object for each contour
vector > hullsI(contours.size());
vector > hullsP(contours.size());
vector > defects(contours.size());
for(int i = 0; i 3 )
{
convexityDefects(contours[i], hullsI[i], defects[i]);
}
}
Hope it helps :)