OpenCV || contour similarity

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

contours

I need my OpenCV program to return TRUE when these circuits are compared to each other. They all look the same, but as you can see, they are not exactly the same.

The result you see here is that I returned from the findContours function.

So, I'm looking for the right similarity approach for these loops.

Any help would be awesome.

Thank you in advance.

+6
source share
2 answers

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

+5
source

To use matchShapes() , you must pass vector<Point> , vector<Point> as arguments. So itโ€™s not the outline of a container like you, but the concrete outline of it. The shapes you are trying to compare should be in one outline.

+5
source

Source: https://habr.com/ru/post/908855/


All Articles