sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #28352
Re: [Question #254678]: Java: How to avoid false matches with "Screen.exists()"
Question #254678 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/254678
Status: Open => Answered
RaiMan proposed the following answer:
currently you have to use the similarity (expected minimum similarity
score) with the Pattern class.
if (s.exists(new Pattern("/expecting.png").similar(value)) != null)
where value is a float value between 0f and 0.99f (which means exact
match)
or
if (s.exists(new Pattern("/expecting.png").exact()) != null)
for exact match
BTW: your image filename /expecting.png means, you are storing your images in the root folder.
You should define an image folder somewhere, store your images there and use
ImagePath.setBundlePath(absolute path to your image folder)
and the you can use:
if (s.exists(new Pattern("expecting").exact()) != null)
for .png files.
looking at your question, I suppose, you not yet had a look at the docs:
http://sikulix-2014.readthedocs.org/en/latest/index.html
which gives you some insights on concepts and features.
the actual method signatures can be found in the javadocs (link on
nightly build page)
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.