当前位置:网站首页>OpenCV - matchTemplate image template matching
OpenCV - matchTemplate image template matching
2022-08-09 16:03:00 【why why】
Template matching is the comparison of templates with overlapping image regions,An image processing method to locate coincident regions,本文记录 OpenCV Related content implementation method.
简介
Template matching tasks require searching for templates in images,A technique to determine where a template is located,Python OpenCV The function encapsulated in is cv2.matchTemplate
函数说明
function reference form
cv2.matchTemplate(image, templ, method[, result]) → result参数说明
参数 | 含义 |
|---|---|
image | image being searched,The template needs to grid the loss function in the image(需要 int8 或 float32 格式的图像) |
templ | Searched template images,size cannot be compared image 大,需要和imagehave the same image data format |
method | Specifies the loss function calculation method |
损失函数
method=CV_TM_SQDIFF
Calculate the mean squared error directly as a loss function
method=CV_TM_SQDIFF_NORMED
The mean square error loss function is calculated after normalizing the two vector modulo lengths
method=CV_TM_CCORR
Calculate the cross-correlation function result as the loss function
method=CV_TM_CCORR_NORMED
Calculate the result of the cross-correlation function normalized according to the modulo length as the loss function,个人比较推荐,效果也较好,If the image is not suitable for using this parameter directly, you can find a way to construct a normalized correlation loss function
method=CV_TM_CCOEFF
Decentralized correlation loss function
- 其中:
method=CV_TM_CCOEFF_NORMED
相关系数损失函数
示例引用
out_v = cv2.matchTemplate(image, template, cv2.TM_CCORR_NORMED)参考资料
边栏推荐
- R7 6800H标压处理器+RTX 3050独显 无畏Pro15锐龙版高能开卖
- 【STM32】TCL2543CN 12位11通道ADC芯片stm驱动程序,使用32自带SPI实现
- 实践数据湖iceberg 第三十九课 清理快照前后数据文件变化分析
- A Preliminary Study on Baidu Open Source e-chart
- 985测试工程师被吊打,学历和经验到底谁更重要?
- spacedesk-notebook, tablet, extended screen-solve the problem that the tablet font is too small
- C语言程序设计笔记(浙大翁恺版) 第八周:数组
- Zero Time Technology | Nomad cross-chain bridge theft of 180 million US dollars incident analysis
- C语言程序设计笔记(浙大翁恺版) 第十三周:文件
- 常用sql记录
猜你喜欢

看完腾讯大佬90天整理的“Redis深度笔记”,我直接当场膜拜

C语言程序设计笔记(浙大翁恺版) 第七章:函数

防汛添利器,数字技术筑起抗洪“大堤”

爬虫处理乱码问题

Refuse to "reinvent the wheel", Baidu EasyDL lets you play with AI custom development

【DevOps】jekins配置(二)

R7 6800H标压处理器+RTX 3050独显 无畏Pro15锐龙版高能开卖

暴雨天,看天翼云如何“快准稳”防涝

基于FPGA的FIR滤波器的实现(3)—采用Filter Design & Analysis设计

物联网技术概论:1~7章汇总(西安交通大学)
随机推荐
技术分享 | 接口自动化测试如何处理 Header cookie
网站授权QQ登录
golang中的select原理解析
Similar image detection method
WebShell简介
SMI 与 Gateway API 的 GAMMA 倡议意味着什么?
Fiddler弱网测试
常用sql记录
VMWare不使用简易安装,手动安装ISO操作手册
Regular expression combat: the latest Douban top250 crawler super detailed tutorial
Shell -- -- -- -- -- - common gadgets, sort and uniq, tr, the cut
项目小操作:form表单的校验,以及第二次显示提示校验内容等问题
兆骑科创创新创业大赛平台,人才引进,项目路演
和月薪5W的测试聊过后,才知道自己一直在打杂...
DSPE-PEG-Hydrazide,DSPE-PEG-HZ,磷脂-聚乙二醇-酰肼MW:1000
After reading the "Redis In-depth Notes" compiled by Tencent bosses in 90 days, I worshipped on the spot.
【DevOps】jekinsBuild step ‘Execute shell‘ marked build as failure
C语言程序设计笔记(浙大翁恺版) 第十二周:程序结构
百度开源e-chart初探
实践数据湖iceberg 第三十九课 清理快照前后数据文件变化分析