OpenCV || contour similarity

Wim Vanhenden picture Wim Vanhenden · Feb 19, 2012 · Viewed 12.9k times · Source

As you can see in the image, I would like to compare these contours.

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.

Answer

Adi Shavit picture Adi Shavit · Feb 20, 2012

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