← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #194144]: How to make exists(img, 0.01) return immediately even if it fails and not switch to text recognizing

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
I tested again with the latest build version (X-1.0rc3 - r930) on Win
7-32:

--- it does not make any difference wether you use
exists(image, 0)
or 
exists(image, 0.01)

I all cases one search is done.

So I think the first version is clearer, since it does not look like the search might be interrupted after 0.01 seconds if not successful.
No matter, what waiting time you give, the pattern is always searched in the whole given region (which might take some time for larger regions or the whole screen if it is not found)

--- switching to text search if image not found
If the given image is available in the image path (means it can be loaded to prepare a visual search) Sikuli does not switch to text recognizing, if the image is not found.

Only if the image is not available (cannot be loaded from the image path), Sikuli tries to find the given image file name as text in the given region.
In this case you get the following error message in the log:
[error] xyz.png looks like a file, but can't be found on the disk. Assume it's text.
This message is repeated for every search trial (so only once in this case of exists("xyz.png", 0) )

--- timing example (Windows in Parallels on Mac Lion / (Base machine: Core-i7-3,4GHz, 4GB for Windows)
image to search: 15x 15 pixel
If it is not found: With small regions (smaller than 500x500) this takes about 0.3 seconds and rises up to 0.6 seconds for the screen (here 1920x1200)

--- conclusion / question
Since with small regions (up to 250x250) the image is found within less than 0.01 seconds: why does it take 0.3 seconds minimum even with very small regions (e.g. 30x30) that do not contain the image, to find out, that the image is not there???

So I will change the title again now, since this has nothing to do with
text recognition. It is all within the image search area.

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