Template matching is the process of finding a smaller known template image in another larger image.
Questions tagged [template-matching]
363 questions
2
votes
1 answer
Special Situation in Normalized Cross Correlation for template matching
I was working on the Normalized Cross Correlation for Template Matching in Spatial domain.
While the method is slow, it works good enough for my purpose. But I saw a weird thing in there. Let me explain the situation below:
91 91 …

peterd
- 99
- 9
2
votes
0 answers
OpenCV: Issue in running same-code on Android vs OSx
I've wrote simple template-matching program using OpenCV, which produces surprisingly different results on Android and OSx.
First, see what I'm doing:
IplImage *image = cvLoadImage("test3a.png", -1);
Mat templateMat(image);
// detecting…

Abhinav Mehta
- 201
- 2
- 4
2
votes
1 answer
OpenCV Visualizing the Whole Process of TemplateMatching
I am fresh on OPENCV combined with C++. I have a question as following.
If we would like to visualize the whole process when doing template matching, is that possible? If it does, which OPENCV's functions should I refer?
Basically, how should we do…

Cong
- 31
- 6
2
votes
1 answer
Alpha-dependent template matching
I'm using OpenCV with CUDA / CUBLAS / CUFFT support to perform some very basic template matching on grayscale screenshots to extract some text, meaning I can assume the following:
I do know the exact size, color and rotation of the raw sprites I'm…

Opossum
- 482
- 4
- 16
2
votes
1 answer
Template matching using OpenCV
I'm trying to grab one image in my Android phone camera, define a template using ROI from this image, and then when successive images are grabbed, do template matching to find the new location of the template.
The problem is that it seems the…

Yanai Ankri
- 439
- 4
- 11
1
vote
1 answer
OpenCV matchTemplate accuracy
I am trying to get the locations of options in some images of questions using OpenCV matchTemplate. I tried using OCR with bounding boxes but it nearly takes 10 seconds to compute, so I decided to try matchTemplate. It was a lot faster but not very…

BleedFeed
- 33
- 4
1
vote
1 answer
Match anime cel to corresponding frame (using template/feature matching?)
I have an image of a cel (a painted plastic sheet layer scanned to create a frame for older animated movies) from Kiki's Delivery Service, as below:
and I want to be able to match this to its exact (or close enough) matching frame in the movie…

tonkotsu
- 31
- 1
1
vote
1 answer
Match Template With Transparent Threshold
has anyone used template matching on OpenCV to detect images using transparent templates and it worked?
I'm trying to use template matching to detect multiple boxes that make up a table. The template used is a box of the same size but with a…

Devkil39
- 81
- 7
1
vote
1 answer
Suggest template matching algorithm
I want to ask you to help to choose or find a good algorithm for the following problem:
I want to recognize the template in the image, the template is a text of non standard font, so OCR possibly will not handle it. What I want is to recognize it…

maximus
- 4,201
- 15
- 64
- 117
1
vote
1 answer
How to use optimal parallelization for multi template matching with OpenCvSharp?
For a multi Template Matching with OpenCvSharp I want to use Parallel.ForEach() and limit the maximal number of threads used to n-1 so at least one thread remains free for other possible occuring tasks (n is the total nr of CPU-level threads…

Eduard Szilaghi
- 35
- 4
1
vote
1 answer
Replacing specific Characters in an Image using OpenCV
I have the next Image:
I want to find all the occurrences of an specific character, let's say "a", and then replacing it with another character, let's say "e"
This can be done in Python3 using OpenCV and Numpy, to do that I'm using the next two…

Dau
- 419
- 1
- 5
- 20
1
vote
0 answers
Using OpenCV Templatematch with multiple occurences
I'm playing around with OpenCV and Templatematch. I have found some code which I basically understand, but is having some problems 'adjusting' to my simple needs.
The code does template match on a picture of an HMI. The HMI consists of both 7…

Gumse90210
- 11
- 3
1
vote
0 answers
How can I improve the performance of template matching with opencv?
I'm quite new at python.
In short, I want the code to capture the part of the screen where the application window is located and find the template I need in this window. But since I know that this template is only in a certain part of the window, to…

Nilaier
- 11
- 2
1
vote
1 answer
Matching Pointer to members and its type as template parametes
Given this code
struct data {
int velocity;
};
template
class Collector {
// ...
public:
void add(const Data& data) {}
template
T average1(T Data::*field) const {
return T{}; // Some…

Ricardo Capurro
- 47
- 3
1
vote
1 answer
How to find a transparent icon in a picture?
I want to find this icon with transparent background
in this image
I tried the following code:
import cv2
method = cv2.TM_SQDIFF_NORMED
small_image = cv2.imread('icons/new/test.png')
large_image = cv2.imread('icons/example.png')
result =…

mostafa motaghi
- 13
- 2