# lane_detection

Python API: `depthai_nodes.node.parsers.utils.lane_detection`

## Functions

| Name | Description |
| --- | --- |
| [`compute_lane_detection_points`](https://docs.luxonis.com/software-v3/ai-inference/inference/depthai-nodes/depthai-nodes-api-reference/node/parsers/utils/lane_detection.md#lane_detection-Functions-compute_lane_detection_points) | Decode UFLD lane points from a batched grid tensor. |

### function `compute_lane_detection_points`

```python
def compute_lane_detection_points(
    tensor: np.ndarray,
    *,
    row_anchors: list[int],
    griding_num: int,
    cls_num_per_lane: int,
    input_size: tuple[int, int],
) -> list[list[tuple[int, int]]]
```

Decode UFLD lane points from a batched grid tensor.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `tensor` | `np.ndarray` | Batched logits with grid classes, sampled rows, and lanes as the remaining axes; only the first batch item is used. | required |
| `row_anchors` | `list[int]` | Image row positions, in pixels, for the lane sampling grid. | required |
| `griding_num` | `int` | Number of horizontal grid cells, excluding the no-lane class. | required |
| `cls_num_per_lane` | `int` | Number of sampled row positions per lane. | required |
| `input_size` | `tuple[int, int]` | Model input size as `(width, height)`. | required |

Returns

| Type | Description |
| --- | --- |
| `list[list[tuple[int, int]]]` | One list per lane containing normalized XY point tuples. Lanes with fewer than three valid samples have empty lists. |
