cvConvexityDefects在OpenCV 2.X / C ++? [英] cvConvexityDefects in OpenCV 2.X / C++?
问题描述
我使用OpenCV 2.2,我需要确定凸包的凸性缺陷。我在文档中找不到任何关于凸面缺陷的内容,这让我很奇怪如果它仍然支持在OpenCV 2.X或者如果它被重命名?
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?
无论如何,我尝试使用C函数
Anyways, I tried using the C function
CvSeq* cvConvexityDefects(const CvArr* contour, const CvArr* convexhull, CvMemStorage* storage=NULL )
但是,我不能转换我的 std :: vector< Point> hull
转换为 CvArr
。 CvArr
参数到 cvConvexityDefects
应该是一维和连续的int数组,我没有成功创建尝试投放,手动复制到CvSeq结构中,...)。
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, ...).
任何想法?
推荐答案
我有同样的问题,但我设法解决它!检查我的帖子 http://stackoverflow.com/questions/6806637/convexity-defects-c-opencv < a>
I had the same problem than you but I managed to resolve it! Check my post http://stackoverflow.com/questions/6806637/convexity-defects-c-opencv
我希望这可以帮助你!
这篇关于cvConvexityDefects在OpenCV 2.X / C ++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!