1

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?

user839293
  • 11
  • 1
  • 4

1 Answers1

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!

Community
  • 1
  • 1
cabreracanal
  • 924
  • 1
  • 14
  • 36