← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #215364]: wait(image) / exists (image) sampe rate

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
scan rates higher than 1 per second (one search takes roughly 1 second)
is only possible if you restrict the search region to smaller areas of
e.g. 300x 300 pixel.

Generally: the smaller the search area the faster the search and the
smaller the differences in size of search area and probe the faster.

Reason: the probe area is checked at every pixel of the search area
minus width and height of probe. (the used feature of
OpenCV:matchTemplate())

example:
- a probe of 100*100 pixels on a 1920x1200 screen means 1820*1100 = roughly 2 Million pixel positions to check for the 100x100 probe
- same probe in an area of 300x300 means 200x200 pixels = 40.000 pixel positions to check

This means the second case should be finished in about 1/50  of the
time.

So in the end with the current version of Sikuli using
exists("some-probe.png", 0) # this makes only one search and comes back

you can get turnaround times (found or not found) down to 0.3 seconds.

If you want to get below that rate in the not found situation currently
(this is a "bug"), you have to raise the Settings.WaitScanRate (standard
is 3) to an appropriate value of 5 and higher (see docs)

Setting it to 10 for example would reduce the minimum turnaround time
when not found to 0.1 seconds.

BUT BE AWARE: this costs much cpu.
If for example the search has a turnaround of 0.1 seconds and the WaitScanrate is 10, the machine would constantly run with 100%, which might have an impact on other cpu-intensive apps (like video ;-) and vice versa.

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