问题
I'm using OpenCV 2.2 and I need to determine convexity defects of a convex hull. I can't find anything on convexity defects in the documentation which makes me wonder if it is still supported in OpenCV 2.X or if it was renamed?
Anyways, I tried using the C function
CvSeq* cvConvexityDefects(const CvArr* contour, const CvArr* convexhull, CvMemStorage* storage=NULL )
However, I'm not able to convert my std::vector<Point> hull
into CvArr
. The CvArr
parameters to cvConvexityDefects
should be 1-dimensional and continuous array of int's, which I had no success in creating (tried casting, manual copying into a CvSeq structure, ...).
Any ideas?
回答1:
I had the same problem than you but I managed to resolve it! Check my post https://stackoverflow.com/questions/6806637/convexity-defects-c-opencv
I hope this could help you!
来源:https://stackoverflow.com/questions/6653789/cvconvexitydefects-in-opencv-2-x-c