1–概念 opencv 提供了一个专门用于模板匹配的函数 cv::matchTemplate();其调用方式如下: void cv::matchTemplate( cv::InputArray image, cv::InputArray templ, cv::OutputArray result, int method 2-- 方法 3 结果 模板匹配函数cv::MatchTemplate一次计算模板与待测图像的相似度,并将结果存入映 图像result中,也就是result图像中的每一个点的值代表一次相似度比较结果;其中,模 通过在待检测的图像上从左到右,从上到下滑动,每到达一个像素点,就会以这个像素点 左上角顶点从原图像中截取一个与模板大小一样的图像进行像素比较的运算,模板在滑动 过程中,将模板和当前截取的图像的比较计算结果储存在result矩阵中,result的大小为(W w+1,H-h+1),在result中的每个位置(x,y)的值都表示以这个点为左上角顶点截取的图像 模板像素计算后的计算结果;模板在待测图像上每次在横向或者纵向上每次移动一个像素点...
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 Point
Contact Point, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack