# utils

Python API: `depthai_nodes.node.utils`

Helpers for coordinate remapping, cropping scripts, image layout, and suppression.

## Child Pages

 * [detection_config_generator](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/node/utils/detection_config_generator.md)
 * [message_remapping](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/node/utils/message_remapping.md)
 * [nms](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/node/utils/nms.md)
 * [util_constants](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/node/utils/util_constants.md)

## Functions

| Name | Description |
| --- | --- |
| [`to_planar`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/node/utils.md#utils-Functions-to_planar) | Converts the input image `arr` (NumPy array) to the planar format expected by depthai. The image is resized to the dimensions specified in `shape`. |

### function `to_planar`

```python
def to_planar(arr: np.ndarray, shape: tuple) -> np.ndarray
```

Converts the input image `arr` (NumPy array) to the planar format expected by depthai. The image is resized to the dimensions
specified in `shape`.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `arr` | `np.ndarray` | Input NumPy array (image). | required |
| `shape` | `tuple` | Target dimensions (width, height). | required |

Returns

| Type | Description |
| --- | --- |
| `np.ndarray` | A 1D NumPy array with the planar image data. |
