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
From openCV wiki :
Finds the convexity defects of a contour.
So you should include it in your loop.
std::vector defects;
vector >hull( contours.size() );
for (int i = 0; i < contours.size(); i++)
{
convexHull( contours[i], hull[i], false );
convexityDefects(contours[i], hull[i], defects[i]);
}
Also, as you mentioned, in wiki is said:
hull – Output convex hull. It is either an integer vector of indices or vector of points. In the first case, the hull elements are 0-based indices of the convex hull points in the original array (since the set of convex hull points is a subset of the original point set). In the second case, hull elements are the convex hull points themselves.