neodroidvision.utilities.visualisation.bounding_box_visualisation.draw_bounding_box_on_image¶
- neodroidvision.utilities.visualisation.bounding_box_visualisation.draw_bounding_box_on_image(image: Image, x_min: Union[int, float], y_min: Union[int, float], x_max: Union[int, float], y_max: Union[int, float], labels: Optional[Iterable] = (), *, line_color: Optional[ColorEnum] = None, thickness: Union[int, float] = 2, use_normalized_coordinates=True, label_inside: bool = True, text_color: Optional[ColorEnum] = None)[source]¶
Adds a bounding box to an image.
Bounding box coordinates can be specified in either absolute (pixel) or normalized coordinates by setting the use_normalized_coordinates argument.
Each string in display_str_list is displayed on a separate line above the bounding box in black text on a rectangle filled with the input ‘color’. If the top of the bounding box extends to the edge of the image, the strings are displayed below the bounding box.
Args: :param image: a PIL.Image object.
- Parameters
x_min – x_min of bounding box.
y_min – y_min of bounding box.
x_max – x_max of bounding box.
y_max – y_max of bounding box.
line_color – color to draw bounding box.
thickness – line thickness. Default value is 2.
labels – list of strings to display in box (each to be shown on its own line).
use_normalized_coordinates – If True (default), treat coordinates
y_min, x_min, y_max, x_max as relative to the image. Otherwise treat coordinates as absolute.
- Parameters
label_inside –
text_color –