OpenCV || contour similarity

旧时模样 提交于 2019-12-05 00:11:29

问题


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.


回答1:


Take a look at cvMatchShapes() (which used to be call cvMatchContours()).




回答2:


To use the matchShapes() function you should pass vector<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.



来源:https://stackoverflow.com/questions/9353810/opencv-contour-similarity

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