← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #238681]: Difference between exist() ans find(pattern)

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
find and wait (which is more comparable to exists) throw FindFailed
exceptions, exists does not but simply returns null.

internally they are all exactly the same as for the searching and
processing time.

search time mainly depends on the size of the image (the whole screen in
your case, base image) that is to be searched for a probe (test.PNG in
your case) and is faster the smaller the difference in size between base
and probe.

So to speed up things,make the base region as small possible (10+ possible approaches for that ;-)
reg = <some smaller region than the whole screen>
reg.find(image)

another trick:
if you only want to check, wether an image is there or not without waiting for it the default of 3 secs:
exists(image, 0) 
or
wait(image, 0)

version 1.1 will have some more automatics to speed things up:
- internal caching for images to be reused from memory without reloading from file
- an image now remembers where it was last seen - if searched again, it is first looked there (some millisec) before searching the whole region.

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