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!