← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #702786]: What are some of tried and tested operating system/hardware/software setup?

 

Question #702786 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/702786

    Status: Open => Answered

RaiMan proposed the following answer:
The only performance critical aspect with SikuliX is the image search, that is done internally with OpenCV matchTemplate.
This feature calculates the similarity of the given image to search for at every possible position in the given image to search in (usually  an internally created screenshot of the given Screen or Region). All this is pixel-based and results in very CPU-intensive array/matrix ops.

An example:
Screensize: 1280x1024 pixels means about 1.3 M pixels (imgA).
Image to search: 100x100 pixels means 10 K pixels (imgB)
The exact number of pixels, that are possible top left corners of imgB in imgA: sizeImgA - sizeImgB = 1.300.720 pixels 

Result:
- with increasing size of  imgA (e.g. larger screens) the search time increases (more than linear)
- with a decreasing size difference of the 2 images search time decreases

Conclusion:
Make imgA as small as possible using appropriate Region features.

Having this in mind, when creating workflows in SikuliX, monitor size
does not really matter.

General advice:
To get responsive workflows on actual GUI's (web or local) you should be sure, that an image search does not take longer than 300 milli-seconds (with the standard scan rate of 3 searches per second).
You might check this in your environment with this script:

Settings.CheckLastSeen = False # do not remember matches
reg = Region(x, y, w, h) # or any other feature that gives a Region object
img = "searchImage.png" 
start = time.time()
reg.exists(img, 0) # one search only
# exists(img, 0 # would search the whole screen
print time.time() - start

you get the search time in seconds.

So you could check the SikuliX performance in different environments.
The results might help, to decide for a minimum machine needed.

--- Settings.CheckLastSeen
This is True in the standard and means that matches are remembered for search images during the same script run. With the next search it is first checked, wether the image is still in the remembered position. If not a search in the given region is done again.

The mentioned still-there check only lasts some milli-seconds depending
on image size.

--- Example on my macOS M1 (2240 x 1260 pixels):
6K pixels search image: 300 msec on whole screen, 100msec in top left quarter of screen
check-still-there: 10 msec im both cases

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.