Inconsistent matching between Match Preview matching, Region.find(), and Region.exists()

Asked by Matt DeLuco

It seems that image matching between the Match Preview UI and Region.find() are consistent, but where those two succeed in finding a match, Region.exists() fails.

When Region.exists() fails in my script, I bring up the Match Preview, and a single match is present (as desired.) If I use find() in place of exists(), there's no exception, and the code path is executed that should have been taken upon a successful exists().

Anyone else run into this? Should I upload the image in question along with the Pattern() properties?

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
j (j-the-k) said :
#1

Sometimes I run into the same inconsistencies, some images are found in preview but not in script in some circumstances. I do not know if it is because of the exists method because I never researched it.

Revision history for this message
RaiMan (raimund-hocke) said :
#2

There is no difference between exists() and find() internally regarding search.

The only difference is, that the FindFailed exception is catched internally and converted into a "return None/False".

The mentioned inconsistencies usually are based on bad shots (too much background, not concentrated on the key visual aspects) and/or different background situations in the different cases.

If you do not think, that this is true in your case:
pls. send me a screenshot(s) and the image used for search zipped together to my mail at https://launchpad.net/~raimund-hocke
I would like to analyze it.

Can you help with this problem?

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

To post a message you must log in.