coordinator.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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, # 校准间隔(秒),默认24小时
  26. 'daily_calibration_time': '08:00', # 每日自动校准时间 (HH:MM格式)
  27. 'quick_mode': True,
  28. 'auto_save': True,
  29. 'load_on_startup': True, # 启动时是否加载上次保存的校准数据
  30. 'force_daily_recalibration': True, # 每日校准是否强制重新校准(不使用已有数据)
  31. 'min_valid_points': 4,
  32. 'rms_error_threshold': 5.0,
  33. # 校准结果保存路径
  34. 'calibration_file': '/home/admin/dsh/calibration.json',
  35. 'overlap_discovery': {
  36. 'pan_range': (0, 360),
  37. 'tilt_range': (-30, 30),
  38. 'pan_step': 20,
  39. 'tilt_step': 15,
  40. 'min_match_threshold': 8,
  41. 'stabilize_time': 2.0,
  42. 'max_overlap_ranges': 3,
  43. 'min_positions_per_range': 3,
  44. },
  45. }