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.