← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #664943]: Pattern Matching precision problem

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
What system? what Java?

*** THIS USED TO WORK AROUND DECEMBER SO SOMETHING EITHER IN SIKULI OR IN JAVA HAS CHANGED ***
I just checked: I did not change anything, that could have influenced the image search implementation.

I made a test, but could not reproduce the problem you report, this is
my script:

icons = ["icon.png"]
icons.append(Pattern(icon).similar(0.94))
for icon in icons:
  print "\n**** icon:", icon
  match = find(icon)
  print "find:", match.getScore(), match
  matches = findAll(icon)
  while matches.hasNext():
    match = matches.next()
    print "findAll:", match.getScore(), match

... and this is the output:

**** icon: icon.png
find: 0.94692838192 M[288,571 16x16]@S(S(0)[0,0 1280x800]) S:0,95 C:296,579 [299 msec]
findAll: 0.946929812431 M[288,571 16x16]@S(S(0)[0,0 1280x800]) S:0,95 C:296,579 [-1 msec]
findAll: 0.94692838192 M[67,514 16x16]@S(S(0)[0,0 1280x800]) S:0,95 C:75,522 [-1 msec]
findAll: 0.945029377937 M[876,307 16x16]@S(S(0)[0,0 1280x800]) S:0,95 C:884,315 [-1 msec]
findAll: 0.910441339016 M[74,571 16x16]@S(S(0)[0,0 1280x800]) S:0,91 C:82,579 [-1 msec]
findAll: 0.910438299179 M[252,514 16x16]@S(S(0)[0,0 1280x800]) S:0,91 C:260,522 [-1 msec]
findAll: 0.910372138023 M[876,286 16x16]@S(S(0)[0,0 1280x800]) S:0,91 C:884,294 [-1 msec]
findAll: 0.849138140678 M[471,582 16x16]@S(S(0)[0,0 1280x800]) S:0,85 C:479,590 [-1 msec]
findAll: 0.849138140678 M[433,524 16x16]@S(S(0)[0,0 1280x800]) S:0,85 C:441,532 [-1 msec]
findAll: 0.798312544823 M[1076,467 16x16]@S(S(0)[0,0 1280x800]) S:0,80 C:1084,475 [-1 msec]
findAll: 0.797399103642 M[876,383 16x16]@S(S(0)[0,0 1280x800]) S:0,80 C:884,391 [-1 msec]
findAll: 0.79739767313 M[876,409 16x16]@S(S(0)[0,0 1280x800]) S:0,80 C:884,417 [-1 msec]
findAll: 0.719521164894 M[20,2 16x16]@S(S(0)[0,0 1280x800]) S:0,72 C:28,10 [-1 msec]

**** icon: P(icon.png) S: 0.94
find: 0.94692838192 M[288,571 16x16]@S(S(0)[0,0 1280x800]) S:0,95 C:296,579 [249 msec]
findAll: 0.946929812431 M[288,571 16x16]@S(S(0)[0,0 1280x800]) S:0,95 C:296,579 [-1 msec]
findAll: 0.94692838192 M[67,514 16x16]@S(S(0)[0,0 1280x800]) S:0,95 C:75,522 [-1 msec]
findAll: 0.945029377937 M[876,307 16x16]@S(S(0)[0,0 1280x800]) S:0,95 C:884,315 [-1 msec]

Are your sure, that nothing has changed in your target GUI.
Images that only get scores of 0.9 and lower are not optimal. The more background the image has towards the edges, the lower the score.
read: http://sikulix-2014.readthedocs.io/en/latest/basicinfo.html#sikulix-how-does-it-find-images-on-the-screen

So check if in your case something has changed in the background pixels
around your image.  Recapture offending images concentrating on the key
aspects and avoiding as much surrounding background as possible.

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