# map

Python API: `depthai_nodes.message.creators.map`

## Functions

| Name | Description |
| --- | --- |
| [`create_map_message`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/creators/map.md#map-Functions-create_map_message) | Create a float32 native map from a two-dimensional array. |

### function `create_map_message`

```python
def create_map_message(
    map_array: np.ndarray,
    min_max_scaling: bool = False,
) -> dai.beta.Map2D
```

Create a float32 native map from a two-dimensional array.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `map_array` | `np.ndarray` | NumPy array of shape `(H, W)`, `(1, H, W)`, or `(H, W, 1)`. A singleton leading or trailing axis is removed. | required |
| `min_max_scaling` | `bool` | Scale nonconstant maps to [0, 1] when true. Constant maps keep their original values. | `False` |

Returns

| Type | Description |
| --- | --- |
| `dai.beta.Map2D` | A native `Map2D` message containing the HW float32 map. |

Raises

| Type | Description |
| --- | --- |
| `ValueError` | If the input is not a NumPy array or has an unsupported shape. |
