1、模板匹配原理 模板匹配(TemplateMatching)就是在一幅图像中寻找和模板图像(template)最相似的区域,模板匹配不是基于直方图的,而是通过在输入图像上滑动图像块(模板)同时对比相似度,来对模板和输入图像进行匹配的一种方法。该方法原理简单计算速度快,能够应用于目标识别,目标跟踪等多个领域。 2、具体步骤 (1)首先需要一个模板图像 T(子图像)和一个待检测的图像(源图像 S) (2)在待检测图像从左到右,从上到下计算模板图像与重叠子图像的匹配度,匹配度越高,两者相同的可能性越大。 优点: 原理简单计算速度快 缺点:模板图像尺寸和待检测图像尺寸问题。模板尺寸必须小于待检测图片尺寸 3、OpenCV模板匹配实现 3.1 单模板匹配 int main() { Mat temp = imread("E:\\img\\T2.jpg"); Mat src = imread("E:\\img\\S.jpg"); Mat dst = src.clone(); imshow("temp", temp); //1.构建结果图像resultImg(注意大小和类型)...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with char
Contact char, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack