Template matching is the process of finding a smaller known template image in another larger image.
Questions tagged [template-matching]
363 questions
38
votes
8 answers
OpenCV template matching and transparency
What's the way OpenCV handles transparency in image during template matching?
The problem is that the template image needs to have transparent parts, because in the original image there could be anything at those places.
I tried all of the methods,…

mnn
- 1,952
- 4
- 28
- 51
32
votes
3 answers
scale and rotation Template matching
I'm using the method of match template with CV_TM_CCORR_NORMED to compare two images ... I want to make to make this rotation and scale invariant .. any ideas?
I tried to use the same method on the fourier transform of the image and the template ,…

Storm2012
- 549
- 1
- 9
- 14
27
votes
2 answers
OpenCV Template Matching example in Android
I'm a beginner to OpenCV. I'm trying to do a sample android application to match a template image in a given image using OpenCV Template matching. I searched in the internet and I couldn't find a proper android or java code which satisfy my…

ssdehero
- 786
- 1
- 11
- 26
20
votes
2 answers
What does size and response exactly represent in a SURF keypoint?
I'm using OpenCV 2.3 for keypoints detection and matching. But I am a bit confused with the size and response parameters given by the detection algorithm. What do they exactly mean?
Based on the OpenCV manual, I can't figure it out:
float size:…

Tulkkas
- 973
- 3
- 10
- 22
17
votes
3 answers
Find near duplicate and faked images
I am using Perceptual hashing technique to find near-duplicate and exact-duplicate images. The code is working perfectly for finding exact-duplicate images. However, finding near-duplicate and slightly modified images seems to be difficult. As the…

Youcef
- 1,103
- 2
- 11
- 26
17
votes
1 answer
Understanding and evaluating template matching methods
OpenCV has the matchTemplate() function, which operates by sliding the template input across the output, and generating an array output corresponding to the match.
Where can I learn more about how to interpret the six TemplateMatchModes?
I've read…

VictorLegros
- 380
- 1
- 4
- 13
16
votes
1 answer
Processing an image of a table to get data from it
I have this image of a table (seen below). And I'm trying to get the data from the table, similar to this form (first row of table image):
rows[0] = [x,x, , , , ,x, ,x,x, ,x, ,x, , , , ,x, , , ,x,x,x, ,x, ,x, , , , ]
I need the number of x's as…

user
- 715
- 4
- 13
- 32
15
votes
1 answer
OpenCV performance on template matching
I'm trying to do template matching basically on java. I used straightforward algorithm to find match. Here is the code:
minSAD = VALUE_MAX;
// loop through the search image
for ( int x = 0; x <= S_rows - T_rows; x++ ) {
for ( int y = 0; y <=…

AraZZ
- 167
- 1
- 1
- 8
13
votes
2 answers
Matlab Template Matching Using FFT
I am struggling with template matching in the Fourier domain in Matlab. Here are my images (the artist is RamalamaCreatures on DeviantArt):
My aim is to place a bounding box around the ear of the possum, like this example (where I performed…

Chris Parry
- 2,937
- 7
- 30
- 71
11
votes
1 answer
OpenCV template matching, multiple templates
Im trying to make a bot for a game. Basically it picks up items from the ground, thing is these items look different sometimes for ex. the angle is different or they are lying on differentyl coloured ground etc. To make everything work I need…

Stasiek
- 161
- 2
- 8
10
votes
2 answers
2D subimage detection in Open CV
What's the most sensible algorithm, or combination of algorithms, to be using from OpenCV for the following problem:
I have a set of small 2D images. I want to detect the locations of these subimages in a larger image.
The subimages are usually…

Sam
- 995
- 2
- 10
- 19
10
votes
3 answers
Fastest method for calculating convolution
Anybody know about the fastest method for calculating convolution? Unfortunately the matrix which I deal with is very large (500x500x200) and if I use convn in MATLAB it takes a long time (I have to iterate this calculation in a nested loop). So, I…

Nicole
- 477
- 3
- 9
- 19
10
votes
5 answers
In function call, why doesn't nullptr match a pointer to a template object?
Here is an example of a code that works perfectly:
#include
#include
template< class D, template< class D, class A > class C, class A = std::allocator< D > >
void foo( C< D, A > *bar, C< D, A > *bas ) {
std::cout << "Ok!" <<…

user1574855
- 135
- 1
- 5
10
votes
3 answers
Real-time template matching - OpenCV, C++
I am trying to implement real-time tracking using templates. I wish to update the template with every frame. The main modifications I have done are:
1) separated the template matching and minmaxLoc into separate modules namely, TplMatch() and…

learner
- 1,197
- 6
- 22
- 34
9
votes
3 answers
Improve Tesseract detection quality
I am trying to extract alphanumeric characters (a-z0-9) which do not form sensefull words from an image which is taken with a consumer camera (including mobile phones). The characters have equal size and font type and are not formated. The actual…

Hyndrix
- 4,282
- 7
- 41
- 82