ok, i asked wrong question. Ofcourse i understand that result is just a formula (cv::CONTOURS_MATCH_I1). I saw this formula and i understand why result value equal to 244. I expected the result will be <1. Is this means that all theory about hu moments is NOT WORKING?
Look at this:
here i compare first shape ( bracket) with circle ( symbol ‘o’ externel). and the result is 3.99.
OpenCV think’s that bracket more similar to circle than to second ( similar) bracket. It’s totally wrong!. How can i use OpenCV for shape matching when the result’s is wrong?
Maybe i make a mistake? Plese Help!.
m00 is the number of pixels. they’re very close, i.e. roughly the same height and width too.
the other “regular” moments are harder to interpret because they are location-dependent. the centroid is m10/m00, m01/m00
Hu moments are made to be invariant to various things. the first two are fairly close. I can’t explain the third being “off” (doesn’t mean it’s unexplainable, only that I don’t have the brain capacity now).
this is old technology. don’t expect too much out of it. since it seems to break down with your contours, you’ll have to trace every step of the matchshapes matching mode of your choice, and also of the calculations for those Hu moments.
I’d recommend shifting the contours so the centroid is at (0,0). just calculate it and subtract it from each point of a contour. that’ll make some of these numbers easier to eyeball.
I modify the program. I calc bounding Rect, find x center and y center and subtract xc and yc from each point of contour. And result is - Hu moments stay the same. And the result still the same =244
But , m00,m10 are changed!