Skip to content

简单实现了一下模板匹配算法并用于图像与视频,代码中使用了opencv和numpy(但核心的计算部分没有直接调用opencv的cv.matcTemplate()方法)This project implements the template matching algorithm

Notifications You must be signed in to change notification settings

Blueblue22two/Python-matchTemplate-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Python-matchTemplate

Languages: Python

该项目中实现了一下模板匹配算法并用于图像与视频

1.使用的第三方库:opencv(version 3.4.14), numpy(version 1.21.5)

2.文件:

Main.py文件是对图片进行模板匹配算法 VideoMatch.py文件是对视频进行模板匹配进而达到实时追踪的效果 TestImage文件里是测试模板匹配使用的图像与视频

3.实现原理:

基于图像s(source)与图像t(template), 对两图中的每一个像素的灰度值通过 计算向量余弦夹角Cosθ的方式计算出R值(R值范围0-1), 再对比R值最大的区域,返回并框选出该区域并显示

This project implements the template matching algorithm manually

1. The libraries used are: opencv(version 3.4.14), numpy(version 1.21.5)

2.Files:

The code in the "main. py" file implements the Template Matching of the images

The code in the "VideoMatch. py" file implements the real-time template matching of the video

The "TestImage" file contains the images and videos used to match the test template

About

简单实现了一下模板匹配算法并用于图像与视频,代码中使用了opencv和numpy(但核心的计算部分没有直接调用opencv的cv.matcTemplate()方法)This project implements the template matching algorithm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published