secure_pixelation/secure_pixelation/get_bounding_boxes.py

22 lines
428 B
Python

from __future__ import annotations
import cv2
import numpy as np
from .data_classes import RawImage
# https://learnopencv.com/how-to-select-a-bounding-box-roi-in-opencv-cpp-python/
def select_bounding_boxes(to_detect: str):
raw_image = RawImage(to_detect)
bounding_boxes = cv2.selectROIs(
windowName=raw_image.name,
img=raw_image.image,
fromCenter=False
)
print(bounding_boxes)