cvMatchShape inconsistent result

asked Aug 12 '14

Raspi83 gravatar image

Hi All,

I was trying match shape function from opencv-2.4.9. Most of the photo give a correct result. But result looks inappropriate for below photos. I was using CV_CONTOURS_MATCH_I2, it return a value 0, which mean 100% matched.

Please let me know if this was a bug or my setting was wrong. Thanks in advanced.

image description image description

Preview: (hide)

Comments

Could you please give us some relevant part of your code?

Mathieu Barnachon gravatar imageMathieu Barnachon (Aug 12 '14)edit

I have solved this problem.

I would share here if anyone having the same problem.

Just do an invert during threshold, then problem gone.

Raspi83 gravatar imageRaspi83 (Aug 12 '14)edit
1

How are shapes matched? It is possible that both the center of gravity and length of the contour are used and that there are in fact two shapes with exactly the same result.

StevenPuttemans gravatar imageStevenPuttemans (Aug 12 '14)edit