# 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

### 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`.

Parameters

 * `arr` (`np.ndarray`): Input NumPy array (image).
 * `shape` (`tuple`): Target dimensions (width, height).

Returns

 * `np.ndarray`: A 1D NumPy array with the planar image data.
