nav_algo.computer_vision.detectors.utils module¶
-
nav_algo.computer_vision.detectors.utils.
find_distance_largest_contour
(contours_output, img_height, img_width, obstacle_width)¶ Calculates distances from each contour and creates list of obstacle distances from camera. :param img_height: height of image passed in, in pixels :type img_height: int
- Returns
A list where each element represents an obstacle distance in meters.
- Return type
list
-
nav_algo.computer_vision.detectors.utils.
find_distances
(contours_output, img_height, img_width, obstacle_width)¶ Calculates distances from each contour and creates list of obstacle distances from camera. :param img_height: height of image passed in, in pixels :type img_height: int
- Returns
A list where each element represents an obstacle distance in meters.
- Return type
list
-
nav_algo.computer_vision.detectors.utils.
get_coords
(distance, x_displacement, direction, curr_x, curr_y)¶ get_coord(distance, x_displacement, direction, curr_x, curr_y) returns the x and y coordinates of the center of an obstacle given a calculated [distance] in front of the boat at coordinates [curr_x], [curr_y] facing [direction]
- Returns
The x coordinate of the obstacle center. float: The y coordinate of the obstacle center.
- Return type
float