color_rule_mask — DRIVE lane op

• 数据种类:rgbimage × table → table

• 调用: import fullseye as fs; fs.ledger.color_rule_mask(image, rules=None)(要直接调用实现,import laneops; laneops.color_rule_mask(image, rules=None);从台账取用则 opsdrive.get("color_rule_mask"))

• GPU:无(仅 CPU 参考实现)

用法

用明确的 HSV 规则将 RGB 分为白线、黄线或未知,并返回掩码与置信度。

> 以下的详细说明为原文 —— 摘要与标题已翻译。

trans_from_rgb の既存実装でRGB→HSVに変換する。白と黄のscoreを独立に計算して最大scoreを採るため、rulesをlistで渡した順序には依存しない。scoreが min_class_confidence未満、または上位2色の差がambiguity_margin以下なら unknownに棄却する。影・逆光・濡れ路面に合わせた自動較正はしない。

Parameters

image : (H, W, 3) rgbimage

0..1の有限なRGB画像。

rules : table or None

名前付きしきい値の上書き。[{"name":"white", "min_value":...}, ...]も可。

Returns

table

labels(0 unknown, 1 white, 2 yellow)、各mask、confidence、色ごとのscore、HSV、使った規則。

English: classify finite RGB pixels as white, yellow or unknown with explicit HSV thresholds after the existing trans_from_rgb conversion. Ambiguous pixels are rejected. White additionally requires local value contrast, so a uniformly bright road is not a white line; this is a fixed classical rule, not an illumination estimator.

呼び出し例::

import numpy as np

import laneops

rgb = np.array([[[0.9, 0.9, 0.9], [0.9, 0.75, 0.05], [0.3, 0.3, 0.3]]])

out = laneops.color_rule_mask(rgb, {})

assert out["labels"].tolist() == [[1, 2, 0]]

参考(示例数据、文献)

• 示例数据目录(下载 URL / 许可证) —— 2-D 用 skimage.data(BSD/公有领域)加合成图,3-D 给出真实数据源(Stanford/PDS 等)的下载 URL。

• 算子来历与参考文献 —— 该算子族所依据的研究/方法出处。

• 算法的正典(作者、年份)与用途见上面的族使用指南。

可运行的示例(实际调用该算子并已验证的样例)

• lane_ops_tour — py -3.11 examples/lane_ops_tour.py

类型可衔接的下一个算子(可接受 table 作为输入)

course_layout · course_occupancy · course_contains · world_build · world_camera · world_move · lidar_scan · rss_longitudinal_same

同类别(lane)

plane_topview_color · lane_boundary_fit · lane_center_path · stop_line_detect


*Provenance: laneops.py — DRIVE 算子登记表。本条目由 tools/opdocs.py md 自动生成(请勿手工编辑)。*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.