coordinator.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. """
  2. 联动控制配置
  3. """
  4. COORDINATOR_CONFIG = {
  5. 'tracking_timeout': 5.0,
  6. 'min_person_size': 50,
  7. 'max_tracking_targets': 3,
  8. 'detection_fps': 2, # 检测帧率(每秒检测帧数),默认每秒2帧
  9. 'detection_interval': 0.5, # 兼容保留:检测间隔(秒),由detection_fps计算得出
  10. 'ptz_command_cooldown': 0.5,
  11. 'ptz_position_threshold': 0.03,
  12. # 目标选择策略配置
  13. 'target_selection': {
  14. 'strategy': 'area', # 策略: 'area'(面积优先), 'confidence'(置信度优先), 'hybrid'(混合)
  15. 'area_weight': 0.6, # 混合模式下面积权重
  16. 'confidence_weight': 0.4, # 混合模式下置信度权重
  17. 'min_area_threshold': 5000, # 最小面积阈值(像素²),小于此值的目标优先级降低
  18. 'prefer_center': True, # 是否优先选择靠近画面中心的目标
  19. 'center_weight': 0.2, # 中心位置权重
  20. 'switch_on_lost': True, # 当前目标丢失时是否切换到次优目标
  21. 'stickiness': 0.3, # 目标粘性(0-1),值越大越不容易切换目标
  22. },
  23. }
  24. CALIBRATION_CONFIG = {
  25. 'interval': 24 * 60 * 60,
  26. 'quick_mode': True,
  27. 'auto_save': True,
  28. 'load_on_startup': True, # 启动时是否加载上次保存的校准数据
  29. 'min_valid_points': 4,
  30. 'rms_error_threshold': 5.0,
  31. # 校准结果保存路径
  32. 'calibration_file': '/home/admin/dsh/calibration.json',
  33. 'overlap_discovery': {
  34. 'pan_range': (0, 360),
  35. 'tilt_range': (-30, 30),
  36. 'pan_step': 20,
  37. 'tilt_step': 15,
  38. 'min_match_threshold': 8,
  39. 'stabilize_time': 2.0,
  40. 'max_overlap_ranges': 3,
  41. 'min_positions_per_range': 3,
  42. },
  43. }