# segmentation

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

## Functions

### create_segmentation_message

```python
def create_segmentation_message(mask: np.ndarray) -> SegmentationMask:
```

Create a DepthAI message for segmentation mask.

Parameters

 * `mask` (`np.ndarray`): Segmentation map array of shape (H, W) where each value represents a segmented object class. Index 255
   represents background.

Returns

 * `SegmentationMask`: Segmentation mask message.

Raises

 * `ValueError`: If mask is not a numpy array. If mask is not 2D. If mask is not of type uint8.
