Template matching is the process of finding a smaller known template image in another larger image.
Questions tagged [template-matching]
363 questions
0
votes
0 answers
Is there a way to use opencv and python to also identify approximately similar patterns to a given template image apart from the exact match?
enter image description here
I want to detect the crossed out boxes and mark them using bounding Rectangles. So to simplify the problem, I extracted few images and selected 1 image as the template image.
I want to use opencv and python to detect the…

Sahan Kodituwakku
- 11
- 2
0
votes
0 answers
How to match two different image which has lots of repetitive feature?
Suppose we have two image. One of them is a template image, the other is a source image acquired from camera.
As the usual template match algorithm, a regoin in the source image is highly similar to the template image. However, there are some slight…

tomato potato
- 1
- 1
0
votes
0 answers
How to add a webview to play a youtube video on it after drawing a rectangle by template matching using openCV in Java android
I am Working on an App where I have to do template matching using openCv library.
I have done that and drawn a rectangle on the matched template.
Now I want to use a webview exactly on the rectangle to play some video.
For that I am adding the…
0
votes
0 answers
Trying to find the distance of an object from a radar by 1) convolution 2) correlation[template matching] of sent and received signals in matlab
Hi and thank you for spare some time on reading this question.
I have an assignment that is to find the distance of an object from a radar by 1) convolution 2) correlation[template matching] of sent and received signals which are rectangular…

Setayesh
- 15
- 4
0
votes
0 answers
Plotting bounding box around detected object using template matching
I made a yolo model, not relevant for this topic. It is working fine. I wanted to add the template matching for detecting arrows on detected object with yolo.
Here is my function for template matching which returns coordinates of an arrow. (NOTE: I…

MeRightYouWrong
- 1
- 1
0
votes
0 answers
minMaxLoc() of cv2.matchTemplate() result gives implausible position, how can I fix this?
I am trying to write a python script that searching for an image on the screen using cv2.matchTemplate fucntion, and then extracting the x and y coordinates of that image and move the mouse to that location. But for some reason when I am running the…

bob
- 73
- 7
0
votes
1 answer
python matchtemplate not working properly with mask enabled
I am trying to matchtemplate the same text on different images. the background of the images vary and The brightness of the text varies from gray (150) to pure white (255) but it will have the same pattern so I used TM2.CCOEFF_NORMED. The problem is…

kerz
- 67
- 6
0
votes
0 answers
OPENCV-Python: cv2.matchTemplate (-215:Assertion failed) *Solved
I was trying to use cv2.matchTemplate.
My code :
!pip install opencv-Python
import cv2
import numpy as np
imgpath = ('E:\\nenv\\venv\\Images')
farm_img = cv2.imread(imgpath+'\\ImageFarm.PNG', cv2.IMREAD_COLOR)
mushray_img =…
0
votes
0 answers
Template matching with transparent image templates using OpenCV Python
I'm trying to identify regions of various UI elements in a video game. I am trying to use OpenCV template matching to accomplish this. These UI elements often contain varying graphics/text/icons, so it's not as easy as matching a generic template.…

ktom
- 125
- 8
0
votes
0 answers
Is there a way to ignore a part of the template in OpenCv?
I would like to use a template matching function in opencv to find an object on my screen. Everything so far is written in c++ would be happy if the answer would also be in c++.
So now to my question:
I want to search the whole screen for this…

Moritz0203
- 1
- 1
0
votes
1 answer
OpenCV multiple template matching - Improving matching
I try to recognize 4 the same fiducial marks on a map. With help of the internet, I have created something, but I am looking for ways to improve the search, since the result is far from perfect.
What I tried so far:
Changing the threshold
Trying…

Annelotte
- 75
- 7
0
votes
1 answer
python, how do i matchtemplate transparent image with opencv
im using matchtemplate to detect 67x45 sqaure on background. i think my code works fine without any problem but the problem is i have to set high threshold for it to detect successfully otherwise it would give so many false detections. so i tried…

wookidookik123
- 79
- 2
- 10
0
votes
1 answer
python opencv how do i matchtemplate for same shapes with different colors and brightness
im using matchtemplate to detect 2x2 sqaures on dark background. with my code, it detects most of the squares without any problem but it fails detecting when the color of the squares are dark and blackish. i tried normalize in opencv but it didnt…

wookidookik123
- 79
- 2
- 10
0
votes
1 answer
Template matching with updating templates from previous detection
I am trying to write a code where after matching with a given template, the detected part of that frame becomes the template for the next frame.
temp = "image.png"
while True:
try:
_, frame = cap.read()
copy = frame.copy()
w,h=temp.shape[:-1]
…

abc123
- 1
0
votes
0 answers
Templates generated with ecognition have negative values
I generated several templates with the template-generating algorithm in ecogition based on a grayscale satellite image and training data. There is an option just to take the mean of the training samples, but also an option that the algorithm…

Ellen Ghyselbrecht
- 13
- 3