← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #205801]: Find matching object vulnerable?

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
If an image has been ever found before and suddenly is not found anymore
(though you see it on the screen at the time, the script stops), this is
usually due to one of these reasons:

-- timing problem:
the image did not come up during the standard 3 seconds waiting time, that Sikuli looks for the image when starting a search.
This can usually be overcome with either globally or locally increasing the wait time.

e.g.
click(image) # fails

change to:
click(wait(image, 10))

-- similarity problem
if an image was found, with a similarity slightly above the standard 0.7 (or some higher given minimum similarity) and it contains too much background in relation to the significant content, then it might happen, that with a slightly different background the image fails (you are usually not aware of that, because you concentrate on the significant content).
So it is always a good measure, to capture an element with as little background as possible or even restrict the capture to the inner part of the element.

-- image (partly) outside search region
This does not apply, if your search region is the whole screen, but if you use setROI() or Region.find() and the other methods, in some cases this problem applies.
So during development and testing use Region.highlight(time), to visualize the critical search region.

There are some interesting topics in the faqs
(https://answers.launchpad.net/sikuli/+faqs) also about these problems.

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