# detection_utils

Python API: `depthai_nodes.message.utils.detection_utils`

## Functions

| Name | Description |
| --- | --- |
| [`compute_area`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/utils/detection_utils.md#detection_utils-Functions-compute_area) | Computes the normalized area of a detection bounding box. |

### function `compute_area`

```python
def compute_area(detection: dai.ImgDetection | dai.SpatialImgDetection)
```

Computes the normalized area of a detection bounding box.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `detection` | `dai.ImgDetection | dai.SpatialImgDetection` | Detection object to compute the area for. Can be of type dai.ImgDetection, or dai.SpatialImgDetection. | required |

Returns

| Type | Description |
| --- | --- |
| `float` | Normalized area (width * height) of the detection bounding box. |
