Template matching is the process of finding a smaller known template image in another larger image.
Questions tagged [template-matching]
363 questions
0
votes
1 answer
Templated member function call g++ error : no matching function for call
g++ encounter an error on that sample.
I have a class Option who contain an std::string
OptionValue inherited from Option with an template type and a templated argument of type std::string for the key.
OptionManager manage OptionValue in a…

cesarl
- 373
- 4
- 5
0
votes
1 answer
How to find the transformation matrix for warpPerspective to bring the rotated image to the normalized position?
I need to process some of the information obtained from the scanner. The problem is the image I get occasionally rotated. I decided to add a few special objects on the photo to be able to use with technical Features2D + Homography to find that…

nvcnvn
- 4,991
- 8
- 49
- 77
0
votes
1 answer
Template Matching (Image Search) function in Python Imaging Library
I had a problem where I need to search for a pattern (present as a numpy ndarray) within another image (also present as a numpy ndarray) and compute a template match (minimum difference position in the image). My question is... is there any in-built…

gran_profaci
- 8,087
- 15
- 66
- 99
0
votes
1 answer
Missing Scope variable OpenCV c++
I have a program that should do template matching on an image and a template, here is the code :
int main()
{
IplImage* imgOriginal = cvLoadImage("image.jpg", 0);
IplImage* imgTemplate = cvLoadImage("template.jpg", 0);
IplImage* imgResult…

MattTheHack
- 1,354
- 7
- 28
- 48
-1
votes
1 answer
Why is this code of Object detection using Template Matching does not run successfully
The output that I get is just the reference image and no bounding box is seen in the output.
I have tried this code from this website: https://www.sicara.fr/blog-technique/object-detection-template-matching
Here's the reference image
Reference…

yessi
- 11
- 6
-1
votes
1 answer
How can I improve the quality of the recognition of playing cards?
I am trying to build a classification of playing cards. The goal is that I use an image of a playing card as input and the script then outputs whether it is a playing card and if so, which one.
For this I have written the following comparison…

Johannes1509
- 49
- 6
-1
votes
1 answer
JS: Locate image/canvas inside of another canvas, and then rectangle
How can I do something like this?
Image one:
Image two:
And how can I do like this:
const image1 = document.querySelector("#imgone");
const image2 = document.querySelector("#imgtwo");
let ctx1 = image1.getContext("2d");
let ctx2 =…

sld
- 93
- 10
-1
votes
1 answer
matchTemplate (-215:Assertion failed) corr.rows <= img.rows + templ.rows - 1 && corr.cols <= img.cols + templ.cols - 1 in function 'cv::crossCorr'
I'm using template matching for object detection in python.
Given two images, one source image and one template image, i intend to find the position of the template image matching in the background image.
Function code:
def __init__(self,…

Seema Shaikh
- 23
- 6
-1
votes
2 answers
How to reduce false positive on openCV template match on a software GUI
I'm trying to create a tasker to use on a game, like a bot to do repetitive simple tasks.
Some of the elements I'm looking for (like texts and buttons) are very similar (see images below).
I'm even using masks to acquire the best results, and the…

Luiz
- 140
- 1
- 14
-1
votes
1 answer
Python 3.6.7 - OpenCV(4.1.2) Template matching
I have this code (which used in the documentation) for template matching:
img_rgb = cv2.imread('mta-screen_2020-01-01_12-07-24.png.png')
img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY)
path =…

I'm the man.
- 207
- 2
- 13
-1
votes
2 answers
How get just some elements in an array
(Sorry my bad english)
I'm making an program write on python using OpenCv and another minor libraries, basically my program need to find an image on my screen based on an Template. I used the Template Matching to this. The program identifies the…
-1
votes
1 answer
'for' loop not working when doing template matching in OpenCv Python. Can anyone tell why? I am running the code on macOS X
The image of the code is in the link given with this question.
(https://i.stack.imgur.com/zq8V8.png)
Even when I pass the wrong image as the 'main' image , the template still matches.
And even when I give the main image and the template(that is…

Devashish Nigam
- 101
- 1
- 1
- 4
-1
votes
1 answer
Null Pointer Exception in MatchTemplate example using OpenCV and Java
This question is continued from this thread. I could download the com.larmor.opencv.MatchTemplate library from here (in case anyone needs the link in future.)
Now coming down to my question.
When I run the code I am getting null pointer…

newbie2015
- 581
- 5
- 29
-1
votes
1 answer
How to programmatically fill in RGB noise in the transparent region of an image using Python?
I need to process a lot of images using Python. All these images have some transparent region (alpha channel) of different sizes.
I need to programmatically fill in RGB noise in the transparent region of those images, but keep the non-transparent…

userpal
- 1,483
- 2
- 22
- 38
-1
votes
1 answer
template matching algorithms and their weaknesses
I am looking for a good simple (not very mathematical) introduction to pattern matching algorithms in image processing, their differences and usage.
I am also looking for the weaknesses of matching algorithms. Dissimilar things that matching…

Bahar S
- 403
- 3
- 16