OpenCV 2.X / C++ 中的 cvConvexityDefects?
我正在使用 OpenCV 2.2,我需要确定凸包的凸度缺陷。我在文档中找不到任何关于凸性缺陷的内容,这让我想知道OpenCV 2.X 是否仍然支持它或者是否已重命名?
无论如何,我尝试使用 C 函数
CvSeq* cvConvexityDefects(const CvArr* contour, const CvArr* convexhull, CvMemStorage* storage=NULL )
但是,我无法将我的 std::vector
进入CvArr
。 cvConvexityDefects
的 CvArr
参数应该是一维且连续的 int 数组,我没有成功创建它(尝试过转换、手动复制到 CvSeq 结构中,.. .)。
有什么想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我和你有同样的问题,但我设法解决了!检查我的帖子 https://stackoverflow.com/questions/6806637/convexity-defects-c-opencv
我希望这可以帮助你!
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!