# line

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

## Functions

| Name | Description |
| --- | --- |
| [`create_line_detection_message`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/message/creators/line.md#line-Functions-create_line_detection_message) | Create a DepthAI message for a line detection. |

### function `create_line_detection_message`

```python
def create_line_detection_message(
    lines: np.ndarray,
    scores: np.ndarray,
) -> dai.beta.Lines
```

Create a DepthAI message for a line detection.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `lines` | `np.ndarray` | Detected lines of shape (N,4) meaning [...,[x_start, y_start, x_end, y_end],...]. | required |
| `scores` | `np.ndarray` | Confidence scores of detected lines of shape (N,). | required |

Returns

| Type | Description |
| --- | --- |
| `dai.beta.Lines` | Message containing the lines and confidence scores of detected lines. |

Raises

| Type | Description |
| --- | --- |
| `ValueError` | If the lines are not a numpy array. If the lines are not of shape (N,4). If the lines 2nd dimension is not of size 4. If the scores are not a numpy array. If the scores are not of shape (N,). If the scores do not have the same length as lines. |
