Highest possible exactness for Match?

Asked by jerome on 2020-06-30

I'm having an issue trying to detect transparent images that appear over a background image.
The way I've been approaching this is to take a screenshot of the background image and to call a method like

transparentImageFound:
    return has(screenshot_of_background.exact()) == False

However, it seems similarity of 99% isn't enough to catch these images appearing some times. (they are very obvious visually to humans)

Instead of using exact() I've also tried .similar(0.995) and such

Collecting the transparent images ahead of time isn't really an option.

Am I approaching this incorrectly?

Any suggestions?

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2020-06-30
Last reply:
2020-06-30
RaiMan (raimund-hocke) said : #1

Sikuli version?

can you send me a screenshot (situation visible) and the "background"-image to sikulix---at---outlook---dot---com?

jerome (jerome2-gill) said : #2

2.0.4,
sure I'll end them now

RaiMan (raimund-hocke) said : #3

The solution is based on an image of the area, where the overlay is expected (screenshot_of_background.png) (in this case including major parts of the tree to have good details)

transparentImageFound:
   match = exists(screenshot_of_background)
   If match:
       score = match.getScore()
       return score < 0.9999 # suitable value has to be found

The match score internally is a floating point number.

Can you help with this problem?

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

To post a message you must log in.