edge-v2-rtsp.json 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. {
  2. "_note": [
  3. "真机 RTSP 前视 v2 模板:把 source.uri 换成现场相机地址即可上线。",
  4. "Python: python -m portcv run -c configs/edge-v2-rtsp.json",
  5. "C++ : portcv_run -c configs/edge-v2-rtsp.json",
  6. "判据与 edge-v2-front.json 完全相同(evidence_v2.enabled / require_commit / allow_state2 都是 true)。",
  7. "require_commit=true:commit 不成立时内部输出 255,PublishGate 保持上一稳定值。",
  8. "allow_state2=true:平车 2 已打开提交;顶层与 commit 两个开关串联,任一 false 都会回退为只识别、不提交。",
  9. "P0-Q3:平车 2 必须是『薄车面边梁 + 车面下方暗带』;地面/下层箱顶/月台的厚亮面不判 2(宁可 255)。",
  10. "P0-Q3:敞车 1 的门板阵列必须横跨 >=0.23×工作宽;贴合形态还需斜撑。",
  11. "P0-Q4:天空电线用竖向梯度块覆盖率找车体顶,车体顶以上的亮/暗带剔除;空车歧义帧不判 2(255)。",
  12. "P0-Q4 空车兜底:车体全宽 + 低阈值 + 立柱 3~16 根;空 C70 判 1,平车 23 根瓦楞 >16 判 2。",
  13. "px_per_m=0 表示用箱体竖棱自标尺;现场若已标定可填固定值(A/B 实测约 115.6)。",
  14. "source.stale_frame_s:长于该时间没拿到新帧会置 FRAME_TIMEOUT;相机 15fps 建议 0.6,低帧率可放宽到 1.0。"
  15. ],
  16. "run": {
  17. "mode": "composed",
  18. "backend": "evidence-v2",
  19. "max_fps": 15.0,
  20. "warmup_frames": 3,
  21. "log_level": "INFO",
  22. "log_json": false,
  23. "save_on_change": true,
  24. "output_dir": "runs/edge_v2",
  25. "preview": false
  26. },
  27. "health": {
  28. "enabled": true,
  29. "work_width": 320,
  30. "blur_var_min": 18.0,
  31. "dark_clip_ratio_max": 0.97,
  32. "bright_clip_ratio_max": 0.55,
  33. "low_texture_ratio_max": 0.88,
  34. "degrade_persist_s": 0.8,
  35. "recover_persist_s": 1.5
  36. },
  37. "source": {
  38. "type": "rtsp",
  39. "uri": "rtsp://admin:passwd@192.168.1.64:554/Streaming/Channels/101",
  40. "width": 0,
  41. "height": 0,
  42. "buffer_size": 2,
  43. "use_gst": false,
  44. "reconnect_s": 3.0,
  45. "stale_frame_s": 0.6
  46. },
  47. "calibration": {
  48. "_comment": "P0-5 标定记录:填 configs/calib/<站点>-<机位>.json;留空则不做判定(只受 stale 开关控制)。hold_on_stale=true 时标定不可信会清 RESULT_VALID/STABLE。",
  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. [
  60. 0.03,
  61. 0.1
  62. ],
  63. [
  64. 0.97,
  65. 0.1
  66. ],
  67. [
  68. 0.97,
  69. 0.99
  70. ],
  71. [
  72. 0.03,
  73. 0.99
  74. ]
  75. ]
  76. },
  77. "evidence_v2": {
  78. "enabled": true,
  79. "view": "front",
  80. "work_width": 960,
  81. "window": [
  82. 0.24,
  83. 0.02,
  84. 0.78,
  85. 0.95
  86. ],
  87. "band_min_h": 3,
  88. "band_max_h_ratio": 0.15,
  89. "bed_search_ratio": 0.4,
  90. "box_bottom_max_ratio": 0.78,
  91. "below_start_ratio": 0.07,
  92. "below_height_ratio": 0.55,
  93. "below_min_height_px": 24,
  94. "min_door_posts": 5,
  95. "max_door_posts": 16,
  96. "max_bed_gap_px": 40.0,
  97. "flat_max_door_posts": 4,
  98. "max_post_spacing_cv": 6.0,
  99. "min_post_len_ratio": 0.3,
  100. "min_post_spacing_px": 24.0,
  101. "min_diagonal_braces": 1,
  102. "min_post_span_ratio": 0.23,
  103. "texture_top_enable": true,
  104. "texture_grad_th": 50.0,
  105. "texture_block_px": 16,
  106. "texture_block_hit_ratio": 0.03,
  107. "texture_coverage_min": 0.5,
  108. "texture_run_rows": 3,
  109. "texture_smooth_rows": 7,
  110. "texture_top_margin_ratio": 0.02,
  111. "body_fallback_enable": true,
  112. "body_bottom_ratio": 0.75,
  113. "body_min_opacity": 0.5,
  114. "body_min_roi_px": 90,
  115. "body_canny_lo_pct": 0.55,
  116. "body_canny_hi_pct": 0.75,
  117. "body_min_points": 4,
  118. "body_grad_pct": 0.6,
  119. "body_min_inlier_ratio": 0.5,
  120. "body_run_min_len_ratio": 0.2,
  121. "body_min_post_len_ratio": 0.15,
  122. "body_x_margin_ratio": 0.03,
  123. "body_min_posts": 3,
  124. "vehicle_min_span_ratio": 0.5,
  125. "vehicle_max_posts": 60,
  126. "empty_vehicle_enable": true,
  127. "empty_min_posts": 3,
  128. "empty_min_span_ratio": 0.6,
  129. "empty_min_opacity": 0.55,
  130. "empty_min_wall_h_ratio": 0.25,
  131. "empty_min_post_len_ratio": 0.3,
  132. "empty_fallback_max_posts": 4,
  133. "empty_min_diagonal_braces": 1,
  134. "empty_flatbed_enable": true,
  135. "empty_flatbed_min_gap_px": 16.0,
  136. "empty_flatbed_max_plane_edge": 0.12,
  137. "empty_flatbed_max_gray_drop": 80.0,
  138. "empty_top_margin_ratio": 0.0,
  139. "allow_state3": true,
  140. "min_wall_opacity": 0.35,
  141. "wall_edge_density_ref": 0.14,
  142. "wall_edge_density_span": 0.04,
  143. "ground_block_px": 32,
  144. "ground_density_lo": 0.02,
  145. "ground_density_hi": 0.35,
  146. "min_zero_ground_ratio": 0.65,
  147. "deck_min_len_ratio": 0.3,
  148. "contact_max_h_ratio": 0.12,
  149. "under_deck_dark_delta": 12.0,
  150. "under_deck_min_h_ratio": 0.01,
  151. "under_deck_search_h_ratio": 0.1,
  152. "max_flat_gap_px": 40.0,
  153. "box_height_m": 2.591,
  154. "px_per_m": 0.0,
  155. "min_scale_px": 60.0,
  156. "motion_diff_max": 12.0,
  157. "motion_grad_ratio_min": 0.72,
  158. "require_commit": true,
  159. "allow_state2": true,
  160. "structure_hits_min": 0.6,
  161. "min_bed_roi_px": 90,
  162. "reject_hoist_high": true,
  163. "hoist_dark_max": 75,
  164. "hoist_band_frac": 0.035,
  165. "hoist_line_ratio": 0.2,
  166. "hoist_dark_ratio": 0.55,
  167. "hoist_bright_delta": 12.0,
  168. "reject_spreader_contact": true,
  169. "spreader_dark_max": 110,
  170. "spreader_dark_ratio": 0.55,
  171. "commit": {
  172. "gap_m_max": 0.1,
  173. "gap_px_hard_max": 8.0,
  174. "stable_frames": 5,
  175. "structure_frames": 5,
  176. "min_structure_hits": 0.6,
  177. "max_gap_rise_m": 0.01,
  178. "allow_state1": true,
  179. "allow_state2": true,
  180. "allow_state3": true,
  181. "require_motion_ok": true,
  182. "require_view_known": true,
  183. "use_plc_arrival": true
  184. }
  185. },
  186. "decision": {
  187. "window": 9,
  188. "window_s": 1.0,
  189. "min_votes": 4,
  190. "min_confidence": 0.45,
  191. "min_dwell_s": 0.2,
  192. "hold_s": 0.6,
  193. "lost_timeout_s": 1.5,
  194. "low_fps_threshold": 3.0
  195. },
  196. "plc": {
  197. "enabled": true,
  198. "push": "modbus_server",
  199. "modbus": {
  200. "host": "0.0.0.0",
  201. "port": 1502,
  202. "unit_id": 1,
  203. "input_addr": 0,
  204. "holding_addr": 0,
  205. "allow_unit_any": true
  206. },
  207. "gating": false,
  208. "gating_timeout_ms": 800,
  209. "heartbeat_ms": 500,
  210. "confidence_scale": 1000,
  211. "min_publish_interval_ms": 50
  212. }
  213. }