← Back to team overview

sikuli-driver team mailing list archive

[Bug 1833356] Re: [1.1.3] findAll fails but image exists

 

Disagree
Bug Exists
1.1.3(2018-07-05_16:27)/Mac10.13.6/Java8(64)1.8.0_25-b17
workaround 
code

def Test_findAll(v_Image):
    v_Array = [] ; v_Result = 0
    if exists(v_Image,0.2):
        print "Image exists"
    else:
        print "Not Found"
        return v_Result,v_Array
    try:
        v = findAll(v_Image)
        v_Array = list(v)
        v_Result = 1
        print "findAll successful"
        print len(v_Array),"Items"
    except:
        v_Array = []
        if str(sys.exc_info()[0]).find("FindFailed",0)>0:
            print "@ " * 40
            print "sikuli bug image exists but findAll Fails"
            print "@ " * 40
            v_Result = 2
        else:
            print "$ " * 40
            print("Oops! unknown error",sys.exc_info()[0],"occured.")
            print "$ " * 40
            v_Result = 3
    finally:
        return v_Result,v_Array

def Find_All(v_Image):
    v_Result,v_Array = Test_findAll(v_Image)
    #print "v_Result,v_Array",v_Result,len(v_Array)
    if v_Result == 0: 
        print "Not Exists"
    if v_Result == 1: 
        print "Exists and finAll successful"
        exit(0)
    if v_Result == 2: 
        print "Exists sikuli bug findAll failed"
    if v_Result == 3:
        print "findAll Other Error force Crash"
        print "findAll Other Error force Crash", 1/0
        
        
#    print "Next but exit" ; exit(0)


#v_Image_p = "Close X big Region.png"
v_Image_p = "Close X big Region.png"
sx = 16 ; sy = 292 ; sw = 1076 ; sh = 443
setRect(sx,sy,sw,sh)
g_Find_Matching = 0.75


for i in range(20):
     print "^ " * 40 ,"Try with matching", g_Find_Matching
     v_Image = Pattern(v_Image_p).similar(g_Find_Matching)

     Find_All(v_Image)
     g_Find_Matching = g_Find_Matching - 0.01

output


^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ Try with matching 0.75

Not Found
Not Exists
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^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@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ 
sikuli bug image exists but findAll Fails
@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ 
Exists sikuli bug findAll failed
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ Try with matching 0.68
Image exists

@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ 
sikuli bug image exists but findAll Fails
@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ 
Exists sikuli bug findAll failed
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ Try with matching 0.67

Image exists

findAll successful
1 Items
Exists and finAll successful
[info] Exit code: 0



** Attachment added: "Screen"
   https://bugs.launchpad.net/sikuli/+bug/1833356/+attachment/5276040/+files/Ghost_Invader.png

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

Title:
  [1.1.3] findAll fails but image exists

Status in Sikuli:
  Invalid

Bug description:
  Code
  def Find_All_Close_X(v_Image):
      if exists(v_Image,0.2):
          v_Pos = find(v_Image)
          print "v_Pos",v_Pos
          hover(Location(v_Pos.x,v_Pos.y))
          print "hovering",v_Pos.x,v_Pos.y
          popup("Found and hovering")
          v_Result = findAll(v_Image)    
      else:
          print "Not Found"
  v_Image_p = "/home/jeff/SikuliScripts_Linux/Subs/Vikings/Close X big Region.png"
  sx = 422 ; sy = 132 ; sw = 505 ; sh = 270
  setRect(sx,sy,sw,sh)
  g_Find_Matching = 0.85
  for i in range(20):
      print "^ " * 40 ,"Try", g_Find_Matching
      v_Image = Pattern(v_Image_p).similar(g_Find_Matching)

      Find_All_Close_X(v_Image)
      g_Find_Matching = g_Find_Matching - 0.01

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


References