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

    Status: Open => Answered

Eugene S proposed the following answer:
Well, I think I know what your problem is. When you define a region in
Sikuli, it remains constant. Meaning that if you moved it elsewhere, you
will have to redefine it (or to find it again) to use. Moreover, you
must remember that the ONLY thing that Sikuli does is finds a predefined
patterns/regions on the screen precisely as they were saved. So if you
captured your region WITH some visual areas around it, then Sikuli sees
all that as a single pattern and will look for it exactly. So you must
make sure that no unrelated pixels are present in your capture. In some
cases, windows can be transparent and unrelated stuff might be visible
through the window. this is a problem too.

Please also note that I am not using IDE in my examples, I use Sikuli as
script from command line. Hence I do not capture the region like you do
from IDE. I do that with print screen and then just store it with my
script and refer to it using it's name, for example "pattern.png". This
is easier when you want to cut the image precisely in paint form
example.

To summarize:
1. If you created a region and it slightly changed - Sikuli won't find it
2. If you created a region and it moved- Sikuli won't find it


If you say that your pattern matched outside the region, that means that you 
didn't define the region correctly or doing something else funny. Try using 
find() inside the region rather than exists(). Like: region.find("pattern.png")

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

_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to     : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to