← Back to team overview

sikuli-driver team mailing list archive

[Bug 1203989] Re: [request] use a saved image the same way as a screen (virtual screen)

 

** Changed in: sikuli
    Milestone: 2.0.0 => 2.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/1203989

Title:
  [request] use a saved image the same way as a screen (virtual screen)

Status in Sikuli:
  In Progress

Bug description:
  Attempting to scan a previously saved screen capture.  The screen
  capture contains multiple (similar) blocks of data.  Each block
  contains three fields. Field 1 is a unique identifier, Field 2 will
  vary and must be ignored, Field 3 contains the content that will
  pass/fail this test step, but that content can also appear in other
  blocks of data.

  Desired Algorithm Pseudo Code:
  full_block = Pattern( "image1.png" ).similar(0.70) # image of block to find
  field1 = Pattern("subimage1.png").similar(0.95) # a sub-image of image1.png, can uniquely identify the block
  field2 = Pattern("subimage2.png") # sub-image of image1.png, a field to ignore, we won't do anything with it
  field3 = Pattern("subimage3.png").similar(0.95) # sub-image of image1.png, important field (can exist in multiple blocks, but we're checking to see if it exists in this block)

  f = Finder( "path\previouslyCapturedImage.png" )
  f.findAll(full_block) # search previouslyCapturedImage.png, will return multiple matches 
  while f.hasNext():
        current_match = f.next() 
        if current_match.find( field1 ):
              # We've uniquely the block, check unique identifier field1
              if current_match.find(field3):
                     print "Correct information found!"
              else:
                     print "Incorrect information found!"
              # We can exit now because we found unique identifier field1
              break
        else:
              # no match on unique identifier field 1, this means current_match is a different block, so skip to the next one
              continue

  This style of code works when using the Screen as the target of the
  find commands, but doesn't appear to work when using a previously
  saved image of the screen as the target. Any ideas on how to
  accomplish something similar? If my example isn't clear enough please
  let me know.

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


References