← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #248324]: sikuli-java: findAll() with a small image returns false matches

 

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

RaiMan proposed the following answer:
1. if both images (yes and no) are visible on the screen and you take an image of yes to search, the match should select yes in any case (provided, that the image shot does not contain much background (even colored areas) towards the edges, which reduces the score and risks false positives).
hence: as long as the distinguishing inner pixel area is nearly as large as the image shot, the match score should be >0.9.
this should work down to images of about 10x10, below that it might get worse. 

… and all this is not a must, but only increasing risk for false
positives, so there are many cases, where it might work as expected.

2. same case, but only <no> is visible. using <yes> as image and 0.7,
you might get a match. The only way to avoid this: use a Pattern with a
higher score (the score at which yes would be found (should be >0.9, see
above))

3. as mentioned by Eugene: color does not add much difference to the score due to the used statistical match algorithm, but if the wanted image is visible on the screen, it should be found as the best match.
Only in cases, where it is not visible, there is a risk for false positives, if the minSimilarity is not high enough.

If you want to be sure:
match = find(<yes>)
if match.exists(Pattern(<yes>).exact()):
    print "it its yes"
else:
    print "it is not yes, might be no"

looks a bit crude, but this can be used for example to first find a
button, and then check, wether it is activated or not (greyed out).

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