← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #239692]: OpenCV find template

 

Question #239692 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/239692

    Status: Open => Answered

RaiMan proposed the following answer:
Do I understand right?
You are developing your own image search solution?

... or are you using the matchTemplate feature of OpenCV?

The question about the specific lines of code in pyramid-template-matcher.cpp:
The respective functions isSameColor() and isBlack() are defined in pyramid-template-matcher.h and allow to handle the special cases of one-color templates more accurate.

---  If possible, tell more in detail how search algorithm work? because you precision factor is very high.
This is the power of OpenCV and matchTemplate.
It simply compares the template pixels with the same area in the base image going pixel per pixel from top left to bottom right and returning a match value for every pixel (1.0 means all pixels are the same and 0.0 means no pixel is the same). Having a 3 color image (RGB), the match value of the channels at each pixel is aggregated.

This is the example from OpenCV docs:
http://docs.opencv.org/doc/tutorials/imgproc/histograms/template_matching/template_matching.html

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.