Check Duration of Blinking Image?

Asked by Matthew Lebo

If I have a region and I am checking for an image within that region and it appears, but can disappear and then reappear, but I only want to act on it if that image stays visible for X amount of seconds. Is the only thing I can do is on appear start a timer, wait x seconds and then check if the image is there again?

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

yes

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#2

Region.waitVanish might be a better method, maybe something like

Region.wait(Image)
starttime = time.time()
Region.waitVanish(Image)
duration = time.time() - starttime

Note: If you just check if the image is there after X seconds, then it might have disappeared and re-appeared in between.

Revision history for this message
Matthew Lebo (digitalml) said :
#3

Thanks Manfred Hampl, that solved my question.