draw.mosaic_bbox

Description

Mosaics area bounded by bounding boxes over detected object

class Node(config=None, **kwargs)[source]

Mosaics areas bounded by bounding boxes on image.

The draw.mosaic_bbox node helps to anonymize detected objects by pixelating the areas bounded by bounding boxes in an image.

Inputs

img (numpy.ndarray): A NumPy array of shape \((height, width, channels)\) containing the image data in BGR format.

bboxes (numpy.ndarray): A NumPy array of shape \((N, 4)\) containing normalized bounding box coordinates of \(N\) detected objects. Each bounding box is represented as \((x_1, y_1, x_2, y_2)\) where \((x_1, y_1)\) is the top-left corner and \((x_2, y_2)\) is the bottom-right corner. The order corresponds to bbox_labels and bbox_scores.

Outputs

img (numpy.ndarray): A NumPy array of shape \((height, width, channels)\) containing the image data in BGR format.

Configs

mosaic_level (int) – default = 7.
Defines the resolution of a mosaic filter (width × height). The number corresponds to the number of rows and columns used to create a mosaic. For example, the default setting (mosaic_level = 7) creates a \(7 \times 7\) mosaic filter. Increasing the number increases the intensity of pixelization over an area.