Cannot find image intermittently

Asked by Avinash

I am using a virtual frame buffer(xvnc) inside which sikuli script is run.But in between sikuli is not able to find the images.
Most of the times it is able to find image but fails in between.Why there is such a random behavior ,even after appearance of the image on screen it is not able to find it.I have tried findAll also and decreased similarity to 0.60 and then took the first element from the returned array, but still intermittent failures.Could someone explain the cause and also I wanted to know is there some characteristic way of selecting images as only some images always fail. Waiting for a quick reply.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Eugene S (shragovich) said :
#1

Hi,

Generally, I see no reason Sikuli image detection will behave inconsistently. However, you might want to have a look at your script as a whole and answer these questions:
1. Does the image, you are trying to detect, is always on the screen or does it appear as a result of some other action? For example, when you click on link, the screen changes and the image you are trying to detect appears.
2. If the answer to the previous question is "yes", check your timing. It doesn't take much time to scan the screen for patterns, so there is a chance you are looking for the image before it actually appears on the screen.
3. Are you sure these images are all similar. Just to be sure, take screenshots of one detected as expected and one that was not detected and zoom into them as much using mspaint. Check for differences.
4. Try to highlight the detected region to see if the pattern is a 100% match. More about highlight here: http://doc.sikuli.org/region.html#Region.highlight

Hope that helps,
Eugene

Can you help with this problem?

Provide an answer of your own, or ask Avinash for more information if necessary.

To post a message you must log in.