← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #259550]: issue in comparing two images

 

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

RaiMan proposed the following answer:
@Eugene
LOL, much ado about nothing ...

A major reason for the problems we are currently discussing in version
1.1.0 at least, is the above mentioned bug in the CheckLastSeenFirst
feature, which is fixed now (available January 5th).

So this workaround helps in such cases until then (taking Eugenes
pressed/unpressed example):

Settings.CheckLastSeen = False
pressed = "image of pressed button.png"
notpressed = "image of not pressed button.png"
if exists(Pattern(pressed).exact(), 0):
    print "button is pressed"
if exists(Pattern(notpressed).exact(), 0):
    print "button is not pressed"

The evaluated scores of the button images used against the other
(pressed-image on unpressed button and vice versa) result in a score of
rounded 0.97 (exactly 0.960901379585 and 0.96352738142), which is really
enough to distinguish.

In the original example of this question the match scores are 0.99413305521 and 0.994715809822, which again are enough to distinguish with Pattern().exact(), but are "rather low" (a significant difference to 1.0000000000000...)  because of the large areas of even color.
When leaving out most of the background with the shots, the match score goes up to 0.999999.....

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