← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #659989]: How to properly use observe to track region changes

 

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

    Status: Answered => Open

Tristan Zickovich is still having a problem:
With the code you provided, reg.isObserving() always evaluates to false on my end. 
However, without the while loop, the event handler works fine. 

Also, observeInBackground() requires a parameter of type double. The call without a parameter does not work for me.
Is there another way to run it forever, other than declaring a huge double value? 

Is there a way to tell the % difference between changes? I've seen other Sikuli functions return a similarity parameter.
I am calling :
         characterRegion.onChange(new ObserverCallBack(){ // define the handler
		@Override
		public void changed(ObserveEvent evt) {
			List<Match> characterChanges = evt.getChanges();
			for(int i = 0; i < characterChanges.size();++i) {
				System.out.println(characterChanges.get(i));
			}
		}
	});

evt.getChanges() is the only function for ObserveEvent that I've tried
that doesn't return null.

This is a small sample set of my moving character:
M[956,521 8x18]@S(S(0)[0,0 1920x1080]) S:-1.00 C:960,530 [-1 msec]
M[956,531 8x8]@S(S(0)[0,0 1920x1080]) S:-1.00 C:960,535 [-1 msec]
M[956,529 8x10]@S(S(0)[0,0 1920x1080]) S:-1.00 C:960,534 [-1 msec]
M[956,521 8x18]@S(S(0)[0,0 1920x1080]) S:-1.00 C:960,530 [-1 msec]

And this of my "still" character:
M[956,521 8x9]@S(S(0)[0,0 1920x1080]) S:-1.00 C:960,525 [-1 msec]
M[956,521 8x8]@S(S(0)[0,0 1920x1080]) S:-1.00 C:960,525 [-1 msec]
M[956,521 8x7]@S(S(0)[0,0 1920x1080]) S:-1.00 C:960,524 [-1 msec]
M[956,522 8x8]@S(S(0)[0,0 1920x1080]) S:-1.00 C:960,526 [-1 msec]

Even my  still character slightly shifts in place. So I need to find a way to differentiate. 
The only thing i see is the H of M, and the second variable of C. 
But is there a way to find how much of the image actually changed during the event handler call?


Also, where do I find this 1.1.2 nightly build? the SikuliX page still says 1.1.1 is the current version.

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