edge-cpp.json 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. {
  2. "_note": [
  3. "现场模板(**C++ 版专用**):二维边缘几何证据后端(docs/edge_evidence.md),不需要 NPU / OpenCV / 模型权重。",
  4. "用法:/opt/portcv/bin/portcv_run -c /opt/portcv/configs/edge-cpp.json",
  5. "先自检参数:portcv_run -c configs/edge-cpp.json --check-config(只打印生效参数后退出)",
  6. "键名与 Python 侧同名同义;本文件的 run.backend=edge 只有 C++ 版认识,Python 侧请继续用 configs/rk3588-rtsp.json。",
  7. "edge.* 分两组:§7 表(现场整定用,docs/edge_evidence.md §7)与实现级补充键(§8 采样回来后并入 §7)。",
  8. "edge.allow_state2 按 §11 第 10 条:首次上线先置 false(只输出 1 / 0 / 255),验收通过后再改 true。",
  9. "plc.modbus.port 要与 PLC 侧 MB_CLIENT 目标端口一致;标准 502 在 Linux 需要特权(见 deploy/README.md)。",
  10. "source.* 是取流开关(2026-10-10 落地):type=none 不取流(默认,Frame.gray=nullptr→输出 255 安全值);",
  11. " 真机把 type 改成 rtsp|usb|file(或 gst 自写管线)并填 uri,且构建要开 -DPORTCV_WITH_GSTREAMER=ON;",
  12. " 没有相机时用 type=synth(uri=gondola|flatbed|ground|empty,零依赖、同 seed 逐像素可复现)。",
  13. " 取流层的校验在启动时做:类型不认识/缺 uri/未编译进来 一律报错退出,不静默降级。",
  14. " 整定与回归:--dump-frames <jsonl> --dump-dir <dir> 出黄金语料,再用 scripts/replay_check.py 对拍(见 docs/runtime_route_decision.md §4)。"
  15. ],
  16. "source": {
  17. "type": "none",
  18. "uri": "",
  19. "_comment": "真机示例:type=rtsp + uri=rtsp://user:pass@192.168.1.64:554/Streaming/Channels/101(日志会掩掉口令)"
  20. },
  21. "run": {
  22. "backend": "edge",
  23. "max_fps": 15.0,
  24. "warmup_frames": 3
  25. },
  26. "plc": {
  27. "enabled": true,
  28. "modbus": {
  29. "host": "0.0.0.0",
  30. "port": 1502,
  31. "unit_id": 1,
  32. "input_addr": 0,
  33. "holding_addr": 0,
  34. "allow_unit_any": true
  35. }
  36. },
  37. "decision": {
  38. "window": 9,
  39. "window_s": 1.0,
  40. "min_votes": 4,
  41. "min_confidence": 0.45,
  42. "min_dwell_s": 0.2,
  43. "hold_s": 0.6,
  44. "lost_timeout_s": 1.5,
  45. "low_fps_threshold": 3.0
  46. },
  47. "calibration": {
  48. "_comment": "P0-5 标定记录:填 configs/calib/<站点>-<机位>.json;留空则不做判定。hold_on_stale=true 时标定不可信会清 RESULT_VALID/STABLE(PLC 不得据此自动动作)。",
  49. "stale": false,
  50. "record": "",
  51. "max_age_days": 180,
  52. "px_per_m_tolerance": 0.1,
  53. "box_height_tolerance_m": 0.02,
  54. "hold_on_stale": true
  55. },
  56. "scene": {
  57. "mode": "composed",
  58. "roi": [
  59. [0.03, 0.1],
  60. [0.97, 0.1],
  61. [0.97, 0.99],
  62. [0.03, 0.99]
  63. ]
  64. },
  65. "edge": {
  66. "box_height_m": 2.591,
  67. "band_high": [0.55, 0.85],
  68. "band_low": [0.0, 0.1],
  69. "gap_band": [0.1, 0.45],
  70. "cross_ratio": [0.1, 0.35],
  71. "line_angle_deg": 8.0,
  72. "min_len_track": 0.3,
  73. "min_len_cross_px": 20.0,
  74. "min_out_ratio": 0.3,
  75. "grad_pct": 0.9,
  76. "texture_period": [0.03, 0.2],
  77. "near_edge_px": 60.0,
  78. "motion_hold_s": 1.5,
  79. "allow_state2": false,
  80. "work_width": 960,
  81. "use_clahe": true,
  82. "clahe_tiles": 8,
  83. "clahe_clip": 3.0,
  84. "box_is_on_left": true,
  85. "motion_gate": true,
  86. "motion_shift_max_px": 6.0,
  87. "motion_blur_ratio": 0.75
  88. }
  89. }