← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #213048]: Do large or small patterns match quickest?

 

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

RaiMan proposed the following answer:
Ok, I did not tell about the reason behind:
The used search approach uses the matchTemplate() method of openCV, which simply checks on every pixel position of the source (e.g. the whole screen), wether the region corresponding to the size of the target image matches and returns a similarity value for every pixel tested, which in turn allows it, to select the location on the screen, where we had the highest similarity score, which in turn is used to return the match region and the similarity score to the script.

So the pixels to loop through simply is:

PixelsToLoop = (source.w * source.h) - (target.w * target.h)

and the overall amount of pixels to compare is:

PixelsToLoop * (target.w * target.h)

this leads to that a target of 100 pixels (10x10) searched in a region
of 10.000 pixels (100x100) might take less than 0.1 seconds (which you
might not see currently, since in the standard, it always takes at least
0.3 seconds to come back from search, because of a bug in the
implementation of the WaitScanRate feature)

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