OpenCV匹配模板得分不高 [英] OpenCV match template not scoring well

查看:67
本文介绍了OpenCV匹配模板得分不高的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用OpenCV进行一些图像匹配,并且正在使用cvMatchTemplate函数.

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.

当我这样做时,cvMatchTemplate函数可以正确找到子图像并为其提供最佳分数.问题是分数比我预期的要低.

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.

我正在使用CV_TM_CCOEFF_NORMED方法,其计算得出的分数是:0.281492

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

由于精确匹配,难道不是应该更接近1.0吗?

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

谢谢!

推荐答案

虽然我期望得到更好的分数,但这似乎是合理的,因为相关系数(未归一化)的范围为-1至+1.

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

您可以尝试使用其他一些方法(例如CV_TM_CCOEFF,CV_TM_SQDIFF和CV_TM_CCORR)与它们的归一化版本进行比较.

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.

这篇关于OpenCV匹配模板得分不高的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆