Files
mzxwww f3b06d6abe Add light bar detector and detect_test
- traditional CV pipeline referencing jlu_vision_26:
  HSV mask -> contour LightBar -> PCA corner refine -> pairing gates
- big/small armor classification (bar distance / bar length ratio)
- detect_test with synthetic selftest, 6/6 passed
- measured armor size 131.56x55mm, solver NaN guard + ITERATIVE fallback
2026-09-17 00:34:24 +08:00

52 lines
2.3 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
%YAML:1.0
---
# ============================================================
# 灯条检测参数(27RM)
# 敌方颜色:主人是红方 → 打蓝。用自己红板测试时可改成 red。
# 调参现场:./build/linux/x86_64/debug/detect_test 里按 c 切换颜色、r 重载本文件
# ============================================================
enemy_color: "blue"
# ---------- 蓝色 HSV 范围(OpenCV H∈[0,180], S/V∈[0,255]) ----------
blue_h_min: 100
blue_h_max: 140
blue_s_min: 60
blue_v_min: 60
# ---------- 红色 HSV 范围(H 跨 0 和 180 两端) ----------
red_h_min_1: 0
red_h_max_1: 12
red_h_min_2: 168
red_h_max_2: 180
red_s_min: 60
red_v_min: 60
# ---------- 形态学(闭运算补洞) ----------
# 注意:iters 别开大——远景灯条只有 2~3px 宽,腐蚀两轮会被整个抹掉
morph_kernel: 3
morph_iters: 1
# ---------- 灯条筛选 ----------
min_length: 8.0 # 最小灯条长度(px);8px ≈ 4.5m 处的 55mm 灯条
min_ratio: 1.5 # 长/宽最小比。远景灯条只有2px宽,模糊+阈值会把
# 掩膜撑宽到10px、比降到1.7,别设太高;真正的
# 防误检靠配对五道门
max_tilt_deg: 45.0 # 与竖直方向最大夹角
max_area: 200000.0
# ---------- 配对 ----------
max_angle_diff_deg: 15.0 # 两灯条倾角差上限
max_len_ratio: 2.2 # 两灯条长度比上限
max_center_y_ratio: 0.7 # 中心纵向差 / 平均灯条长 上限
big_small_ratio_thres: 3.0 # 灯条中心距/平均灯条长 > 此值 → 大装甲
# 小: 131.56/55 ≈ 2.4 大: 230/55 ≈ 4.2
# ---------- PCA 角点修正(jlu lightbar_corrector 同款参数) ----------
use_pca: 1 # 是否启用 PCA 角点修正。1 = 启用
pass_optimize_lightbar_width: 3 # 灯条宽度方向的搜索半径,单位像素。
normalize_max_brightness: 25.0 # 亮度归一化的最大值
lightbar_min_mean_brightness: 0.0 # 灯条平均亮度下限
padding_scale: 0.07 # 灯条宽度方向的搜索半径,单位像素。
search_start_ratio: 0.4 # 灯条宽度方向的搜索起始位置,单位像素。
search_end_ratio: 0.6 # 灯条宽度方向的搜索结束位置,单位像素。