Template matching is the process of finding a smaller known template image in another larger image.
Questions tagged [template-matching]
363 questions
1
vote
2 answers
Optimal PCL Template Alignment setup
I'v got 2 point clouds (in mm unit), one is a "mesh" sampled from stl object (99999 points), and second is point cloud of this object taken by 3D cam (about 30841 points). I am using this PCL tutorial's code for template matching:…

John117
- 13
- 4
1
vote
2 answers
Extract a fixed number of squares from an image with Python/OpenCV
I have several scanned images I would like to compute with Python/Opencv. Each of these images (see an example below) contains n rows of coloured squares. Each of these squares have the same size. The goal is to crop each of these squares and to…

Julien M.
- 35
- 1
- 8
1
vote
3 answers
Counting how many times an image appears on screen
This code takes a screenshot of the screen and then looks for a given object on the screen, by comparing it to the template given, and then counts how many times the object is found. This can be seen below with the mario coins picture in which the…

ITM007
- 117
- 2
- 9
1
vote
1 answer
Sharing asyncio.Queue with another thread or process
I've recently converted my old template matching program to asyncio and I have a situation where one of my coroutines relies on a blocking method (processing_frame).
I want to run that method in a seperate thread or process whenever the coroutine…

Tristo
- 2,328
- 4
- 17
- 28
1
vote
1 answer
OpenCV: minMaxLoc gives no min / max value
I'm trying to follow OpenCV tutorial on image template matching using javacpp-presets.
I want to throw away matches with too low score but minMaxLoc seems to not return minVal and maxVal.
import org.bytedeco.javacpp.DoublePointer;
import…

piotrek
- 13,982
- 13
- 79
- 165
1
vote
1 answer
Check if matching image is the same size with opencv
Let's say I have a image of a shelf which is full of items. Somewhere in the shelf I have a box. With a template image of the box I am trying to find the box in the shelf using opencv template matching.
If I found the box in the shelf I need to…

Jacce
- 172
- 1
- 2
- 11
1
vote
0 answers
OpenCV Coordinates of matching template
I am currently trying to program a template matcher from the openCV tutorial using these images:
I successfully get the match, however I don't need the visualization of drawing a rectangle like
Imgproc.rectangle(img, matchLoc, new…

0x45
- 779
- 3
- 7
- 26
1
vote
1 answer
Movidius and Template Matching
Is there a way to execute template matching algorithms over the Movidius VPU ?
I see that Movidius is generally used for deep learning but I need to execute some template matching algorithms which executes painfully on RPi3.
Note: Deep learning is…

caner karagüler
- 73
- 1
- 6
1
vote
0 answers
How to eliminate multiple (location) points in Template Matching?
I'm attempting to wrap my head around the basics of CV. I have a piece of code in which I have detected multiple objects from the single template using the for loop.
inputImage: Trolley_problem.jpg, humanTemplate: h1.jpg
Here's the code:
import…

Rao208
- 147
- 1
- 3
- 15
1
vote
2 answers
How to detect a multiple-bar pattern?
I'd like to detect a custom "multiple-bar pattern" in an image.
The pattern looks like this, kind of a group of parallel black bars with the same width but different height, see this image:
This pattern could be on the image or even not but if it…
user9590073
1
vote
1 answer
Cannot find the Points() function when following the OpenCV 3.4.0 AKAZE and ORB planar tracking tutorial
I am new to openCV. I am trying to follow the OpenCV3.4.0 tutorial on AKAZE and ORB planar tracking tutorial to perform feature matching.
I am using the android NDK environment to write c++ code.
I managed to get the program to detect features from…

JavaOpenCVWorker
- 11
- 2
1
vote
1 answer
1
vote
1 answer
OpenCv Template Matching - Unexpected masking result
I am trying to match a template with transparency in a scene with OpenCv v3.3.0
I am using the Java example code from the official documentation.
My test case looks like this:
Scene:
Template with transparency:
Template mask (masked the…

Peter Winzer
- 165
- 7
1
vote
0 answers
OpenCV template matching or feature detection to correctly categorize types of faxes?
Sorry, this is my first time posting a question.
I need a process to identify images within other images to be able to categorize images (ex. sorting faxes based on a company symbol).
I have tried openCV template matching but I doesn't seem to be…

EmFord
- 11
- 3
1
vote
1 answer
How to recognize different-colored objects in an image matching the template of the query image?
import numpy as np
import cv2
import os
dir = 'C:\\Project\\Interview Packet'
os.chdir(dir)
image = cv2.imread('us_flag_color.png')
template = cv2.imread('mask.png')
imageGray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
templateGray =…

bb5kb
- 51
- 1
- 8