Regarding usage of observe

Asked by Shivakumar

1.Can you explain why the observe is required in the Sikuli, what can we do in it.
I had seen documentation and few previous questions, i am not able to understand why this required.
Can anyone explain in brief.

Thanks in advance for support

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

observe is simply a compound implementation to wait for some images to come up (like wait() ) or vanish (like wait(Vanish()) with the option to select a specific scan rate (might save a loop) and to define more than one "visual event" for a region, that are observed in parallel. Additionally you can watch for changes in a region, for which no other function is currently available (there is no waitChanged() ).

To implement this with the normal Sikuli features would be possible but would need much more coding.

On top, you can tell observe to work in the background in parallel to your proceeding script.

All this taken together, you can right more powerful scripts with less coding.

What you have to pay, is the somewhat tricky usage with the handler functions and the (may be needed) communication between the handlers and the main workflow.

Revision history for this message
j (j-the-k) said :
#2

Observers can also be a lot faster when you want to search for more than one image at once.
If you run a find() five times, it takes five times as long as one find() takes (obviously).
If you run an observer with five images, the search will still be about as long as one find(), provided all used images are found in the same time.

Can you help with this problem?

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

To post a message you must log in.