tags:

views:

339

answers:

1

I am trying to do some image matching using OpenCV and am using the cvMatchTemplate function.

I took a sample image and then cut part of it out as a template and then tried to match it.

When I do this, the cvMatchTemplate function finds the subimage correctly and gave it the best score. The problem is that the score is lower than I would have expected.

I am using the CV_TM_CCOEFF_NORMED method and the score that it calculated was: 0.281492

Shouldn't this be closer to 1.0 since it is an exact match?

Thanks!

+1  A: 

While I would have expected a better score, that seems reasonable since correlation coefficients (non normalized) have a range of -1 to +1.

You could try some of the other methods such as CV_TM_CCOEFF, CV_TM_SQDIFF and CV_TM_CCORR vs. their normalized versions to compare.

Mikos
This is exactly what it says on page 216 of this book http://www.amazon.com/Learning-OpenCV-Computer-Vision-Library/dp/0596516134
Rafael Vega