def get_frame():
    camera.capture(rawCapture, format='bgr', use_video_port=True)
    frame = rawCapture.array
    decoded_objs = decode(frame)
    frame = display(frame, decoded_objs)
    (ret, jpeg) = cv2.imencode('.jpg', frame)
    rawCapture.truncate(0)
    return jpeg.tobytes()
def get_frame():
    camera.capture(rawCapture, format='bgr', use_video_port=True)
    frame = rawCapture.array
    decoded_objs = decode(frame)
    frame = display(frame, decoded_objs)
    (ret, jpeg) = cv2.imencode('.jpg', frame)
    rawCapture.truncate(0)
    return jpeg.tobytes()