# lane_detection

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

## 函数

### 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]]]:
```

从批处理网格张量解码 UFLD 车道点。

参数

 * `tensor` (`np.ndarray`): 批处理的 logits，包含网格类别、采样行和车道作为其余轴；仅使用第一个批处理项。
 * `row_anchors` (`list[int]`): 车道采样网格的图像行位置（像素）。
 * `griding_num` (`int`): 水平网格单元格的数量，不包括无车道类别。
 * `cls_num_per_lane` (`int`): 每条车道采样的行位置数量。
 * `input_size` (`tuple[int, int]`): 模型输入大小，格式为 `(宽度, 高度)`。

返回

 * `list[list[tuple[int, int]]]`: 每条车道一个列表，包含归一化的 XY 点元组。有效样本少于三个的车道将返回空列表。
