예제 #1
0
        cv2.imwrite("wtTest.png",  self.wt)
        #  hunt for the appropriate number in each partitioned image
        if db: cvs(db,self.wt,'weight',0)  
        self.nwt =  xrdTyp(self.wt,'wt',db,trb)            
        self.nfat = xrdTyp(self.fat,'fat',db,trb)            
        self.nh2o = xrdTyp(self.h2o,'h2o',db,trb)
        #cvs(db,self.cropped,'input',0)
        return(None)
    
if  __name__ == '__main__':
    global db,trb
    db = 0

    filename = 'ScTest/T2015Doris/20150130_093919.jpg'
    filename = "input.png"
    print 'weight.py', filename
    
          
    s = Scale(filename,db,trb)
   
    print  s.name, 'wt is' ,s.nwt,'iHunt global'
    for i in iHunt:
        print i
    cvs(db,s.cropped ,'test image display',0)   #   test image display
  
    cvd()
    idGen(0,trb)   # close file and cleanup
    trb.close()
    
    
예제 #2
0
except IOError as e:
    print "I/O error({0}): {1}".format(e.errno, e.strerror)
    trb = open('VM-trb.txt','w')            # catch all problem file for VMs


print 'input test file ', tfile
c = [0,0,0] ; f = [0,0,0]
correct = 0; failed = 0;
def srtkey(lin):
    f = eval(lin)[1]
    fds =  f.find(r'\201')        #   will return date of file
    #print f[fds:]
    return(f[fds:])

gen = open('0idGRule.py','w')     ##  open file for write
idGen(1,gen)    # open file

with open(tfile,'r' ) as fr:
     
  for line in fr:
  #for line in sorted(fr, key = srtkey,reverse=True) :
      print line
      print eval(line)[1]
    
      x = eval(line)
      #   line has wt,fat,h20 , " filename"
      wfile = x[1]             #   filename 
      data = eval( x[0])
      trueWt = data[0]         #   see key above
      prob = False
      #rd  = rScale(wfile,False )