Template matching is the process of finding a smaller known template image in another larger image.
Questions tagged [template-matching]
363 questions
1
vote
1 answer
XSLT Sort on child subelements
I am trying to output this entire XML but with the EVENT elements sorted by ID. Being new to XSLT I thought I would still give it a try but after many attempts and reading other examples and how to guides I still can't get what I thought was a…

JonnyW
- 13
- 2
1
vote
1 answer
opencv python alternative for pyautogui.locatecenteronscreen(), just for an image instead of screen
i was wondering how you would use opencv (cv2) in python for making an alternative to pyautogui.locatecenteronscreen() function, just useing an image instead of an screen.
i will try useing an example.
maybe an user defined…

kallemoto
- 11
- 1
- 3
1
vote
0 answers
Comparing maxVal's from OpenCV matchTemplate for dynamic template matching
I am trying to do some dynamic template matching with cv2.matchTemplate. The template is:
and the image I am matching it to is:
I am adjusting the size and angle of the template and then grabbing maxVal and maxLoc from cv2.matchTemplate and…

Luxo_Jr
- 379
- 1
- 3
- 12
1
vote
2 answers
How to read the result for matchTemplate (OpenCV2 in python)
The following code is actually the result which of which I immediately print out:
result = cv.matchTemplate(haystack_img, needle_img, cv.TM_SQDIFF_NORMED
Picture size:
haystack_img = 27x16
needle_img = 7x7
However, I don't really understand what…

W Kenny
- 1,855
- 22
- 33
1
vote
0 answers
How to design a label for visual recognition?
Sorry if this is a recurring question, but I can't find the right keywords for this search.
I need to develop a system for visual recognition of labels attached to products from a warehouse. I'm using a fixed focus camera, so the idea is to use a…

Jéssica Meneguel
- 51
- 4
1
vote
1 answer
Get confidence of template matching for object with multiple instances by using cv2.TM_CCOEFF_NORMED
I'm using template matching for searching for an object with multiple instances.
I'm referring to the tutorial in…

Sreekiran A R
- 3,123
- 2
- 20
- 41
1
vote
0 answers
Template Recognition in opencv
So, I have been working on a python project in computer vision, but was stuck, as most of the tutorials that I found on the idea of template recognition, were rather on the idea of template matching, which assumes that the template is already…

Phoenix
- 373
- 1
- 4
- 20
1
vote
0 answers
OpenCV Best way to match the spot patterns
I'm trying to write an app for wild leopard classification and conservation in South Asia. For this, I have the main challenge to identify the leopards by their spot pattern in the forehead.
The current approach I am using is,
Store the known…

debugger89
- 2,108
- 2
- 14
- 16
1
vote
0 answers
Image processing by checking object of one image of a letter occurs in another handwritten text image
I have a set of images that represent a character (letter 'O') handwritten in different ways. I want to match that with an image of handwritten text and draw a box around it. I came across using the Template matching algorithm, but that is not…

Pratham Patel
- 15
- 4
1
vote
1 answer
OpenCV(3.4.2): error: (-215:Assertion failed) with Template Matching Method
I'm using normalization as a preprocessing method with Template Matching.
However, I faced an error when I run the code
Error:
error: OpenCV(3.4.2)…

Sara
- 169
- 2
- 9
1
vote
0 answers
fitting 2D_gaussian on image to extract the covariance matrix in Python
I used the cv2 for template matching with the following code:
result = cv2.matchTemplate(img_gray,template,cv2.TM_CCOEFF_NORMED)
Then, I used a code for fitting 2D Gaussian on the result of template matching my data is the result of template…

shiva
- 31
- 3
1
vote
0 answers
Overlay app for analyzing current screen and perform touch events programmatically
My goal here is to have at least a minimum of automation for a specific game application. I am basically trying to write an overlay app that performs touch events programmatically based on the current screen of this game.
My approach to the problem…

DeborahAnn
- 191
- 1
- 11
1
vote
1 answer
Template matching with multiple images with same template
Can anyone help me with template matching? As per my guess, Computer vision works with the Pattern reading, so for e.g. If my template(template image) contains "Invoice Number" and my input file_1(Image 1) contains "Invoice number" then it is…

Ani More
- 11
- 1
1
vote
1 answer
Explanation of a few lines: template matching in python using openCV
I need someone to explain to me these four lines of code:
res = cv2.matchTemplate(img_gray, template, cv2.TM_CCOEFF_NORMED)
threshhold = 0.70
loc = np.where( res >= threshhold)
for pt in zip(*loc[:: -1]):
I kind of know what the first two mean.…

Stasiek
- 161
- 2
- 8
1
vote
1 answer
Is it possible to use templateMatch with binary images? I have an error
Is it possible to templateMatch binary images? I've tried it and nothing helps. I always get an error :
cv2.error: OpenCV(3.4.5) C:\projects\opencv-python\opencv\modules\imgproc\src\templmatch.cpp:1107: error: (-215:Assertion failed) (depth ==…

user9753084
- 31
- 5