parameters: (camera)
return_statement: return None
docstring: Function to return an image from our camera using OpenCV
docstring_summary: Function to return an image from our camera using OpenCV
docstring_tokens: Function to return an image from our camera using OpenCV
function: def get_image_from_camera(camera):
      """Function to return an image from our camera using OpenCV"""
      if camera:
          # if predictor is too slow frames get buffered, this is designed to
          # flush that buffer
          ret, frame = camera.read()
          if not ret:
              raise Exception("your capture device is not returning images")
          return frame
      return None
function_tokens: def get_image_from_camera ( camera ) : if camera : # if predictor is too slow frames get buffered, this is designed to # flush that buffer ret , frame = camera . read ( ) if not ret : raise Exception ( "your capture device is not returning images" ) return frame return None