# utils

Python API: `depthai_nodes.message.utils`

Message-copying strategies and detection geometry helpers.

## Child Pages

 * [detection_utils](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/utils/detection_utils.md)

## Functions

| Name | Description |
| --- | --- |
| [`copy_message`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/utils.md#utils-Functions-copy_message) | Copy a DepthAI message using the first supported copying strategy. |

### function `copy_message`

```python
def copy_message(msg: dai.Buffer) -> dai.Buffer
```

Copy a DepthAI message using the first supported copying strategy.

Prefer the message's native `copy()` method, then the supported custom message copiers, and finally `copy.deepcopy`. Buffer
ownership follows the selected strategy; native copies may share underlying pixel storage.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `msg` | `dai.Buffer` | Message to copy. | required |

Returns

| Type | Description |
| --- | --- |
| `dai.Buffer` | A copy of the input message. |

Raises

| Type | Description |
| --- | --- |
| `TypeError` | If no copying strategy supports the message type. |
