← Back to team overview

sikuli-driver team mailing list archive

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

 

** Changed in: sikuli
       Status: New => In Progress

** Changed in: sikuli
     Assignee: (unassigned) => RaiMan (raimund-hocke)

** Tags added: ide

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/768940

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

Status in Sikuli:
  In Progress

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/768940/+subscriptions


References