Sikuli ignore jframe when searching for an image

Asked by Tseno Tsenov on 2017-10-18


My program searches for an image on the screen and then using a transparent always on top JFrame I draw a rectangle and a line showing the user where on the screen the image was found. So lets say I have a rectangle on the screen, I find it and then draw a thin green border around that rectangle so that the user knows what is found and where, but when I draw this border it must interfere with sikuli because It does not find the rectangle again unless I move it. So I my question is is there a workaround? Can I tell sikulli to ignore my jframe and just look at my desktop or maybe tell it to focus another window ?

thanks in advance

Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Last query:
Last reply:
masuo (masuo-ohara) said : #1

By only SikuliX feature, you can search image and show red colored frame around image.

RaiMan (raimund-hocke) said : #2

Besides the correct hint in comment #1:
SikuliX does not have any feature, to interact with the GUI. At time of image search, it simply acts on the pixels, that you see on your screen.

So in general:
If you put anything on the screen, that interferes with SikuliX's search feature, then it is your responsibility, to remove it again before the next search action (taking additional time into account for eventual vanish animation).

The mentioned highlight feature does exactly this being integrated into the internal workflow.

RaiMan (raimund-hocke) said : #3

BTW: with SikuliX 1.1.x you can choose a color for the highlight frame.

Can you help with this problem?

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

To post a message you must log in.