← Back to team overview

sikuli-driver team mailing list archive

[Bug 1251163] [NEW] [request] add feature to get pixel color of a captured image

 

Public bug reported:

Hi! I'm trying to find colored pixels in a region with this code, but no luck :(
Can someone tell me whats wrong?

def findItemsOfColor():
    area = Region(playground.x + 75,playground.y + 90,600,400)
    area.highlight(1)
    wait(1)
    x = area.x
    y = area.y
    i=0 
    while i==0:
        x = x+1
        p = Location(x,y)
        aColor = Color(0x6969FF)
        if myRobot.getPixelColor(p.x, p.y) == aColor:
            print "FOUND ITEM!!!"
            click(x+4,y+4)
            wait(1)
        if x > area.x + area.w:
            print "Searched row"
            x = area.x
            y = y + 1
            if y > area.y + area.h:
                i = 1
                break

** Affects: sikuli
     Importance: High
     Assignee: RaiMan (raimund-hocke)
         Status: In Progress

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

** Changed in: sikuli
   Importance: Undecided => High

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

** Changed in: sikuli
    Milestone: None => 1.1.0

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

Title:
  [request] add feature to get pixel color of a captured image

Status in Sikuli:
  In Progress

Bug description:
  Hi! I'm trying to find colored pixels in a region with this code, but no luck :(
  Can someone tell me whats wrong?

  def findItemsOfColor():
      area = Region(playground.x + 75,playground.y + 90,600,400)
      area.highlight(1)
      wait(1)
      x = area.x
      y = area.y
      i=0 
      while i==0:
          x = x+1
          p = Location(x,y)
          aColor = Color(0x6969FF)
          if myRobot.getPixelColor(p.x, p.y) == aColor:
              print "FOUND ITEM!!!"
              click(x+4,y+4)
              wait(1)
          if x > area.x + area.w:
              print "Searched row"
              x = area.x
              y = y + 1
              if y > area.y + area.h:
                  i = 1
                  break

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


Follow ups

References