cvConvexityDefects in OpenCV 2.X / C++?

血红的双手。 提交于 2019-12-06 14:50:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!