Questions tagged [template-matching]

Template matching is the process of finding a smaller known template image in another larger image.

363 questions
4
votes
1 answer

3D template matching using Cross Correlation in Matlab

Here is a minimal example of what i try to do: Create 3D matrix a(:,:,1)=[ 1 2 3 4 1; 2 3 7 1 4; 3 7 6 0 9; 0 3 2 8 1; 1 4 3 1 1] a(:,:,2)=[ 1 7 3 4 2; 2 9 2 3 1; 1 4 7 7 0; 1 2 3 4 1; 0 9 3 3…
nightlyop
  • 7,675
  • 5
  • 27
  • 36
4
votes
2 answers

Matching object outer shape using normalized cross correlation

I am working with normxcorr2 function in Matlab for template matching. However, what I want to do is different from what normxcorr2 does. The built-in normxcorr2 computes cross-correlation taking into account all the pixels in a rectangular…
4
votes
1 answer

Template Matching in Android using openCV

I'm trying to match an image with the camera input in Android using template matching. When i try this with static 2 images like in here: OpenCV Template Matching example in Android, everything works just fine. But when I try to use the captured…
TharakaNirmana
  • 10,237
  • 8
  • 50
  • 69
4
votes
1 answer

Replace gesture library templates in android

Is it possible to replace a gesture template of template library from a running application? I am building a handwriting recognizer system in which there are templates of letters in gesture library file.So basically after loading the library inside…
ridoy
  • 6,274
  • 2
  • 29
  • 60
4
votes
1 answer

Iterate through cv::Points contained in a cv::Mat

I am using OpenCV template matching to find an image within another image. Specifically matchTemplate() which returns a cv::Mat containing a similarity map of the matches. Is there any way to sort through the cv::Points contained in that cv::Mat…
RubenSandwich
  • 379
  • 1
  • 6
  • 12
4
votes
1 answer

Handwritten character template matching in Matlab

Working with template matching of handwritten data input but face some problems for being very new in Matlab. I want to match this template with this one.. So far i did is: function…
ridoy
  • 6,274
  • 2
  • 29
  • 60
3
votes
1 answer

Logo recognition - how to improve performance

I am working on a project of recognizing TV Channels. I am taking photos of the channels suck that i try to avoid the background and to take the sample from the center of the logo. I recognize 4 different logos, here are the templates: How does my…
Eyal
  • 1,748
  • 2
  • 17
  • 31
3
votes
1 answer

Cope with brightness in grayscale template matching

I am using opencv for real-time template matching. The camera yields at 52fps grayscale images. The software works just fine but sometimes the matching fails because of bad light condition. The camera doesn't provide a way to adjust the brightness…
sciarp
  • 314
  • 3
  • 14
3
votes
2 answers

Object Tracking in EmguCV

I am building an object tracking program that should track the unknown object. The user must select a region in the live video stream that should be tracked. My project is similar to this video. http://www.youtube.com/watch?v=G5GLIKIkd6E I have…
Peter
  • 31
  • 1
  • 1
  • 2
3
votes
1 answer

Errors/Empty video after using write() from cv2.VideoWriter

I am performing template matching and everything seems to be working fine in cv2.imshow(). I want to write a video with all frames resulting from the template matching process. Part of my code includes resizing the template image and the video frame…
3
votes
1 answer

How can I have the pixel coordinate X,Y after ArrayFire match_template?

I'm trying to use the matching_template function from the ArrayFire library But I don't know how to find the X and Y coordinates of the best matching value. I was using the imageproc library to perform this function and there it has the…
3
votes
1 answer

Multi-Scale template Matching doesn't work right

I have done multi-scale template matching in real-time from looking at this article. When the template appears in the frame, it detects it and drawing a bounding box around it which means it works fine. But when there is no template in the frame…
thadaBoy
  • 425
  • 4
  • 21
3
votes
0 answers

OpenCV Template matching - how to mask some source image's zones

In a current project I've to do some template matching work with opencv. My source image is big enough (4k * 8k px) and template is relatively small (220 * 220 px). So it takes about 6 seconds per image and I want to improve it's performance. I…
Pavel B.
  • 41
  • 6
3
votes
2 answers

Template matching - cross correlation vs square diff - when choose one over the other?

TL;DR When and why is cross correlation beneficial over square diff (when using template matching)? Details According to OpenCV's documentation of template matching (you have to scroll down a bit), square difference is defined as: and cross…
Timo
  • 9,269
  • 2
  • 28
  • 58
3
votes
1 answer

This project does not use the Gradle build system warning to imported Boofcv into Android Studio

So, Finally I have install BoofCV into Android Studio (Tx to Q&A on this website) and all examples are running perfectly by opening pop up windows (including Template Matching and Webcam Capture): but message in Event Log [says], 'Migrate Project…