cvMatchShape inconsistent result

asked 2014-08-11 20:23:16 -0600

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

edit retag flag offensive close merge delete

Comments

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

Mathieu Barnachon gravatar imageMathieu Barnachon ( 2014-08-12 03:02:43 -0600 )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 ( 2014-08-12 03:35:10 -0600 )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 ( 2014-08-12 06:10:35 -0600 )edit