OpenCV ||轮廓相似度
正如您在图像中看到的,我想比较这些轮廓。
当这些轮廓相互比较时,我需要我的 OpenCV 程序返回 TRUE。 它们看起来都一样,但正如您所看到的,它们并不完全相同。
您在此处看到的结果是我从函数 findContours 返回的结果。
所以我正在寻找正确的方法来实现这些轮廓的相似性。
任何帮助都会很棒。
预先非常感谢您。
As you can see in the image, I would like to compare these contours.
I need my OpenCV program to return TRUE when of these contours are compared to each other.
They all kind off look the same but as you can see they are not exactly the same.
The result you see here is what I have returned from the function findContours.
So I am looking for the right approach for similarity for these contours.
Any help would be amazing.
Thank you very much in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看看
cvMatchShapes()
(以前称为cvMatchContours()
)。Take a look at
cvMatchShapes()
(which used to be callcvMatchContours()
).要使用
matchShapes()
函数,您应该传递vector
、vector
作为参数。因此,不是像您那样绘制容器的轮廓,而是从中绘制特定的轮廓。您尝试比较的形状应该是一个轮廓。
To use the
matchShapes()
function you should passvector<Point>
,vector<Point>
as arguments.So not contours container as you do, but particular contours from it. Shapes you are trying to compare should be one contour.