def get_blobs(): c = Controller() im = Image(get_image()) blobs = c.process_image_blobs(im) if blobs: #print [b._mWidth*b._mHeight for b in blobs] r = [[b.x,b.y,b._mWidth*b._mHeight] for b in blobs if b._mWidth*b._mHeight>50] return r return None
def get_blobs2(): c = Controller() im = Image(get_image()) blobs = c.process_image_blobs(im) im.show() if blobs: r = [[b.x,b.y] for b in blobs] for blob in r: process_blob(im,blob) return r return None
def run(left=True): c = Controller() c.object_left = left while c.is_high(): im = Image(get_image()) blob = c.process_image(im) if blob: c.go_to() print c.distance else: print "Cant see it" if debug and blob: circlelayer = DrawingLayer((im.width, im.height)) circlelayer.circle(blob, 10) im.addDrawingLayer(circlelayer) im.applyLayers() d = im.show() c.go_back()