[request] need different match scores for different brightness of same (nearly gray scale) image (enabled / disabled)

Bug #768940 reported by RaiMan
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
SikuliX
In Progress
Wishlist
RaiMan

Bug Description

A button in a toolbar might be enabled or disabled. It seems, that if the button image is nearly gray scale (nearly no colored pixels), the image is found with score 1.0 in all cases (enabled/disabled button on enabled/disabled toolbar).

The testcase (available at https://files.me.com/rhocke/s4wkeh) wil run on a Mac out of the box.

This bug is based on the related question, where more information can be found.

Here the script and the results from the above mentioned testcase:

[code]
fillButtonEnabled = "fillButtonEnabled.png"
fillButtonDisabled = "fillButtonDisabled.png"

def myFind(btn, tb):
 m = toolbars[tb].find(Pattern(btn))
 m.highlight(1)
 print "Found %s on %s as %s"%(btn, tb, str(m))

toolbarEnabled = "toolbarEnabled.png"
toolbarDisabled = "toolbarDisabled.png"

dir = getBundlePath()
import os

toolbars = {}
# find both buttons on both toolbars
for tb in (toolbarEnabled, toolbarDisabled):
 os.popen('open "'+os.path.join(dir, tb)+'"') # opens the toolbar image in Preview.app
 wait(2)
 toolbars[tb] = selectRegion("select " + tb)
 for btn in (fillButtonEnabled, fillButtonDisabled):
  myFind(btn, tb)
[end code]

My results:

[log] highlight Match[114,197 32x13] score=1,00, target=center for 1.0 secs
Found fillButtonEnabled.png on toolbarEnabled.png as Match[114,197 32x13] score=1,00, target=center

[log] highlight Match[115,197 32x13] score=1,00, target=center for 1.0 secs
Found fillButtonDisabled.png on toolbarEnabled.png as Match[115,197 32x13] score=1,00, target=center

[log] highlight Match[105,223 32x13] score=1,00, target=center for 1.0 secs
Found fillButtonEnabled.png on toolbarDisabled.png as Match[105,223 32x13] score=1,00, target=center

[log] highlight Match[106,223 32x13] score=1,00, target=center for 1.0 secs
Found fillButtonDisabled.png on toolbarDisabled.png as Match[106,223 32x13] score=1,00, target=center

Tags: ide
RaiMan (raimund-hocke)
Changed in sikuli:
importance: Undecided → Wishlist
RaiMan (raimund-hocke)
Changed in sikuli:
status: New → In Progress
assignee: nobody → RaiMan (raimund-hocke)
tags: added: ide
RaiMan (raimund-hocke)
Changed in sikuli:
importance: Wishlist → Medium
milestone: none → x1.1
RaiMan (raimund-hocke)
Changed in sikuli:
milestone: 1.1.0 → 1.2.0
RaiMan (raimund-hocke)
Changed in sikuli:
importance: Medium → Wishlist
milestone: 2.0.0 → 2.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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