← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #245008]: pattern matching best practice?

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
"good shots" are always matched with a score of >0.95 mostly with 1.0 (=
exact match which means >0.99 according to the internally done
rounding).

what are good shots?
1. as little background as possible (the more uniform background the lower the score - a good shot brings 1.0, but leaving too much background around might lower it down to a score being 0.1 lower)
2. concentrating on the key visual aspects (people tend to cut generously around the target image, but this leads to the effects of 1. - so it is better to cut more inside the target image preserving distinguishing elements - example button: usually people cut generously around the button - better: cut in a way, that only the left and top border including the button text is captured, which is just concentrating on distinguishing key visual aspects)

So if you have good shots, normally there is no need, to deal with the
similarity at all.

Only in situations, where your target might not be visible and you have
the risk that something else might be found with a score >0.7, then you
have to change the image to a pattern having a min similarity attached.

And you need it to distinguish different versions of the same image
(e.g. enabled/disabled button) in the match region.

But even in the first mentioned situations it might not be necessary, if
you are working with restricting regions as often as possible, which
brings you more speed and less resource usage besides reliability.

On the list for enhancements this year is a better support for getting
"good shots" and some learning feature based on the finding history.

Already now with version 1.1.0, an image, that was found before is first searched in the place where it was found before (if this place is within the given region) and only if it is no longer there it will be searched in the given region.
So for example: the first search on the whole screen takes 400 msecs and subsequent searches will take only around 10 msecs if the image is still in place.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.