Exemplo n.º 1
0
def update_pic():
   global output_count
   with picamera.PiCamera() as camera:
      camera.resolution = (640, 480)
      im_name = "img/org_img_{0}.jpg".format(output_count)      
      camera.capture(im_name)
      
      result, output_img = findObject.analyzeImage(im_name, 1.0, True) # the result class from the image analysis
      sleep(0.1)
      
      a=result.lenA # number of pixels left of the box
      b= result.lenB # number of pixels right of the box

      h=result.height # height og the box in pixels
      c_x=result.posX
      c_y=result.posY
      isBox = result.isBox
      cv2.imwrite("img/Hueimg/hue_img_{0}.jpg".format(output_count), output_img)
      output_count += 1
      print "a=", a
      print "b=", b
      print "posx:", c_x
      print "posy:", c_y
      #print "isBox:", isBox      
      return a,b,h,isBox
Exemplo n.º 2
0
def getResult():
    with picamera.PiCamera() as camera:
        camera.resolution = (640, 480)
        im_name = "img/temp_img.jpg"
        camera.capture(im_name)

        result, output_img = findObject.analyzeImage(
            im_name, 1.0, True)  # the result class from the image analysis
        return result