ovl.directions.directing_functions module

ovl.directions.directing_functions.center_directions(contours, image: numpy.ndarray)[source]

Returns the average center of the contours or list of contours that are the final targets

This is the default directions function since it doesnt calculate any directions, only finds the center

Parameters:
  • contours – the final contours - your targets
  • image – the image from which it was found
ovl.directions.directing_functions.target_amount_directions(contours, image: numpy.ndarray)[source]

Counts the amount of successful object detections.

Parameters:
  • contours – the final contours - your targets
  • image – the image from which it was found
Returns:

the amount of targets detected

ovl.directions.directing_functions.xy_normalized_directions(contours, image: numpy.ndarray)[source]

Returns the direction the detect objects (contours) are compared to the center of the image, this is returned in normalized screen space -1 to 1 (-1 meaning the most left compared to the center, and 1 the most right compared to the center and 0 meaning perfectly centered

xy_normalized_directions returns x and y center directions,

For example: If the center of the targets are the center of the image (width / 2, height / 2) the returned values are 0 and 0 meaning the camera is centered on the target

Parameters:
  • contours – the final contours found after filtering - your targets
  • image – the image from which it was found
Returns:

the normalized screen space x and y coordinates of your final targets