当前位置:网站首页>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)参考资料
边栏推荐
- 【Qt】 No such slot...,No such signal
- 冰冰学习笔记:new与delete
- [Serilog] Simple .NET logging with fully structured events
- 6大论坛,30+技术干货议题,2022首届阿里巴巴开源开放周来了!
- 机器学习--数学库--概率统计
- DSPE-PEG-Hydrazide,DSPE-PEG-HZ,磷脂-聚乙二醇-酰肼MW:1000
- 概率论基础知识整理 | 随机变量
- DSPE-PEG-Hydrazide, DSPE-PEG-HZ, Phospholipid-Polyethylene Glycol-Hydrazide MW: 1000
- 回归测试:意义、挑战、最佳实践和工具
- 【NodeJs篇】关于path 路径模块的学习和使用
猜你喜欢
![[Database] How does Sqlserver backup the database regularly and clear it regularly](/img/52/6a438adcb22943c1cfe0f26c25e706.png)
[Database] How does Sqlserver backup the database regularly and clear it regularly

听书项目总结

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

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

概率论基础知识整理 | 随机向量

实践数据湖iceberg 第三十八课 spark sql, Procedures语法进行数据治理(小文件合并,清理快照)

结合实际聊聊电平转换电路(常用电平转换电路总结)

【OpenGL】四、OpenGL入门总结:LearnOpenGL CN教程中关于欧拉角公式推导
![[DevOps] jekins configuration (2)](/img/d3/a6774cb8a1f99adf572653be0e581e.png)
[DevOps] jekins configuration (2)

DSPE-PEG-Hydrazide, DSPE-PEG-HZ, Phospholipid-Polyethylene Glycol-Hydrazide MW: 1000
随机推荐
【DevOps】jekinsBuild step ‘Execute shell‘ marked build as failure
基于FPGA的FIR滤波器的实现(3)—采用Filter Design & Analysis设计
爬虫处理乱码问题
冰冰学习笔记:new与delete
概率论基础知识整理 | 随机变量的数字特征
【Message Center】Architecture Preparation
【软考】2022年上半年软考过啦
[Serilog] Simple .NET logging with fully structured events
看完腾讯大佬90天整理的“Redis深度笔记”,我直接当场膜拜
VMWare does not use easy install, install ISO manual manually
二维数组实现八皇后问题
DSPE-PEG-Hydrazide,DSPE-PEG-HZ,磷脂-聚乙二醇-酰肼MW:1000
C语言程序设计笔记(浙大翁恺版) 第二周:计算
由于谷歌版本自动更新,导致selenium项目报错,如何关闭谷歌浏览器的自动更新?
优化软件测试成本的 7 个步骤
【OpenGL】三、OpenGL总结:OpenGL坐标系
[Microservice] Detailed explanation of nacos registration center and configuration center
常用sql记录
升级适配AGP 7.0
【DevOps】jekinsBuild step 'Execute shell' marked build as failure