Need to target object inside a frame and cant make masks to work

Asked by Martin Mate

Hello, i'm trying to create a sikuli script that would click on area surrounded by solid red color frame. In this case i prepared png image with red frame around the corners and black infill inside then tried to use a simple script:

l = find(Pattern("frameBlack.png").mask())
click(l)

the script is like completely ignoring my '.mask()' and just clicks on any black area on my desktop, ignoring the object inside the red frame. What am i doing wrong?

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

you have to
- use Pattern("frameBlack.png").similar(0.9).mask() to not get false positives
- have to take care, that the frameBlack image has exactly the same size as the wanted match image

Can you help with this problem?

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

To post a message you must log in.