← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #688961]: about onChange() function

 

Question #688961 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/688961

RaiMan proposed the following answer:
--- Settings.ObserveScanRate:
the value says how many scans per second: 0.1 hence means a scan starts every 10 seconds. 
The default is 3, meaning, that every 333 milliseconds a scan is started.
If a scan takes longer than 333 milliseconds in this case, the next scan is started, when this one is ended.
The whole thing is strictly sequential in the current implementation.
Even if you have more than one onChange defined:
scan1, scan2, scan3, .... and then next scan1, scan2, scan3, ... So in such a case the scanrate usually does not mean anything, unless your search region is rather small (less than 100 x 100).

Lowering the scanrate only makes sense, if you think your machine is too
slow, to handle this pure numbercrunching process without influencing
your workflow.

--- minChangedSize
Inside in  a first step the pixels of the 2 region screenshots (last and current) are compared.
Next step: evaluate distinct rectangles containing changed pixels as small as possible.
last step: sort out the rectangles with less pixels (width x height - not changed pixels) than minChangedSizes
return the list of the rectangles remaining (might be empty now).

Which value is suitable for you situation usually has to be evaluated by
some typical cases.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.