S
S
Sergey2011-11-23 09:48:03
Image processing
Sergey, 2011-11-23 09:48:03

OpenCV, multiple path comparison

There are 2 images. in one, the entire object is covered by the contour, and in the other, the object is covered by 2 contours (or more). How to compare Hu moments? As far as I understand, the moments are calculated from one contour. That is, for the second image, you need to combine the contours into one, and then count the moments. There is also a mention of related components, but all I could find about them is a parameter for the FindContours function. It still finds the same 2 or more koturs due to image quality. What is the right thing to do in such a situation?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
red1ynx, 2011-11-23
@red1ynx

Alternatively, you can combine the centers of mass of the contours and construct a convex hull for the resulting object.

E
Eddy_Em, 2011-11-23
@Eddy_Em

Try to merge the contours: look at the extreme points of the contours and find close ones, and then, building a closed chain of connected contours, get one - complete.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question