Problem using find, exists on completely black images

Asked by Raymond

I'm not sure if I'm doing this wrong or I've run into a bug.
Whenever I try to use pattern matching methods like find() or exists() with screenshots that consists of pixels that are all complete black(#000000).
It seems to always result in finding a match even if there is not a big of black on my screen.

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
RaiMan (raimund-hocke) said :
#1

It seems, that you are right.

But if the found match is not black, the similarity score is significantly less than 1.00.

Try to use
find(Pattern(black-image).exact())
to be sure you really get a black area.

It is up to you to post a bug.

Revision history for this message
Raymond (darkray16) said :
#2

I'll post it as a bug since this is not what it should be doing.

I'll try out your idea later, thanks.

Revision history for this message
Raymond (darkray16) said :
#3

I tried the exact() modifier you posted and it still always finds an image. I tried varying similar() levels, and it seems no matter what the similarity score, it will still find a match.

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

OK, make it a bug.

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

Are you using Sikuli X?
This is were I tried exact().

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

update/confirmed: Sikuli X shows this symptoms, exact() not working

Can you help with this problem?

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

To post a message you must log in.