0.10.2 Pattern matching not finding things and finding doubles

Bug #693323 reported by niknah
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
Fix Released
Undecided
Unassigned

Bug Description

Sikuli 0.10.2
64 bit ubuntu

I've been trying to figure out what's wrong with my sikuli script. It seems to be clicking on the same things twice, and not clicking on things sometimes.

Here is a sample file with test pattern.

* Click on the pattern image, change number of matches to 100
* All the Hippos in the middle 64x64 column are the same.
* If you select the whole hippo, the default 0.7 similarity will match even the black hippo shadow, but it won't match the hippos in the middle.
* If you had only picked the middle of the hippo and not the whole hippo (which I usually do cause it can't do transparency), play around with the similarity slider, watch the colors. Sometimes it'll have two matches overlapping each other.
* findAll() doesn't return the same number of matches as in the Match preview tab.

Revision history for this message
niknah (hankin0) wrote :
Revision history for this message
RaiMan (raimund-hocke) wrote :

I made a test with Sikuli X pre-version 1.0a04 on Mac.

I used the new App class to focus on the Preview window (where I had your reference image opened before):

preview = App("Preview")
preview.focus(); wait(1)
r = preview.window(1)

then I set up a test:

I recaptured the images with the light brown colored hippos.

hip0 = "the 64x64 hippo" # sim 0.7
hip1 = "the 64x64 hippo partly" # sim 0.7 - a ribbon with the eyes
patterns = (hip0, hip1)
for p in patterns:
 print p
 r.find(p).highlight(2)
 found=0
 f=r.findAll(p)
 while f.hasNext():
  x = f.next()
  x.highlight(1)
  print x
  found=found+1
 print "found:"+str(found)

These are the results (I deleted the highlight logs for the findAll() matches)

Hippo64.png
[log] highlight Match[1199,550 68x63] score=1,00, target=center for 2.0 secs (the single find)
Match[1199,464 68x63] score=1,00, target=center
Match[1199,550 68x63] score=1,00, target=center
Match[1198,637 68x63] score=1,00, target=center
Match[1198,273 68x63] score=1,00, target=center
Match[1198,376 68x63] score=1,00, target=center
Match[1302,379 68x63] score=1,00, target=center
Match[1412,381 68x63] score=1,00, target=center
Match[1517,382 68x63] score=1,00, target=center
Match[1313,466 68x63] score=0,98, target=center
Match[1345,555 68x63] score=0,96, target=center
found:10

Hippo64part.png
[log] highlight Match[1120,562 43x17] score=1,00, target=center for 2.0 secs (the single find)
Match[1209,393 43x17] score=1,00, target=center
Match[1120,562 43x17] score=1,00, target=center
Match[1066,564 43x17] score=1,00, target=center
Match[1299,570 43x17] score=1,00, target=center
Match[1356,572 43x17] score=1,00, target=center
Match[1209,654 43x17] score=1,00, target=center
Match[1210,567 43x17] score=1,00, target=center
Match[1210,481 43x17] score=1,00, target=center
Match[1209,290 43x17] score=1,00, target=center
Match[921,566 43x17] score=1,00, target=center
found:10

conclusions:
--- In both cases, the single find() returns the second match from findAll() ???
--- In general, no match comes more than one time
--- Hippo64.png: the gray, red an blue one are found with sim 1.0 (match 6 - 8) (that should not be!!!), the last 2 ones with sim < 1.0 are the slightly blurred one and the right one of the right couple (which seems to be ok)
--- Hippo64part.png: all matches seem to be ok

Sikuli X seems to still have a problem with colors, but the matches seem to be more reliable than with 10.2

Revision history for this message
niknah (hankin0) wrote :

Thanks for the quick response and taking a good detailed look at it!

I'll try out Sikuli X a bit more.

RaiMan (raimund-hocke)
Changed in sikuli:
status: New → In Progress
milestone: none → x1.0-rc2
summary: - Pattern matching not finding things and finding doubles
+ 0.10.2 Pattern matching not finding things and finding doubles
Revision history for this message
Tsung-Hsiang Chang (vgod) wrote :

The incorrect color matching with similarity 1.0 is fixed in X1.0 RC2.

Changed in sikuli:
status: In Progress → Fix Committed
RaiMan (raimund-hocke)
Changed in sikuli:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.