s6.utils.bounding_box_selectorΒΆ
- class s6.utils.bounding_box_selector.BoundingBoxSelector(color=(0, 255, 0), border_width=2, show_text=True)
Bases:
objectInteractive bounding box selector using OpenCV window.
Example
selector = BoundingBoxSelector(color=(0,255,0), border_width=2, show_text=True) bbox2d = selector.select(image)
- Parameters:
color β BGR tuple for rectangle color.
border_width β Thickness of the rectangle border.
show_text β Whether to display x,y,w,h text on the rectangle.
- select(image: ndarray, window_name: str = 'Select BoundingBox') BoundingBox2D
Show image in a window and let user draw a bounding box by dragging the mouse. Press Enter to confirm selection and close the window.
- Parameters:
image β The image array to select bounding box from.
window_name β The name of the OpenCV window.
- Returns:
The selected bounding box.
- Return type:
BoundingBox2D