coordinator.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. """
  2. 联动控制配置
  3. """
  4. COORDINATOR_CONFIG = {
  5. 'tracking_timeout': 5.0,
  6. 'min_person_size': 50,
  7. 'max_tracking_targets': 3,
  8. # detection_fps 已移至 DETECTION_CONFIG,此处不再重复定义
  9. 'ptz_command_cooldown': 0.5,
  10. 'ptz_position_threshold': 0.03,
  11. # 目标选择策略配置
  12. 'target_selection': {
  13. 'strategy': 'area', # 策略: 'area'(面积优先), 'confidence'(置信度优先), 'hybrid'(混合)
  14. 'area_weight': 0.6, # 混合模式下面积权重
  15. 'confidence_weight': 0.4, # 混合模式下置信度权重
  16. 'min_area_threshold': 5000, # 最小面积阈值(像素²),小于此值的目标优先级降低
  17. 'prefer_center': True, # 是否优先选择靠近画面中心的目标
  18. 'center_weight': 0.2, # 中心位置权重
  19. 'switch_on_lost': True, # 当前目标丢失时是否切换到次优目标
  20. 'stickiness': 0.3, # 目标粘性(0-1),值越大越不容易切换目标
  21. },
  22. # 顺序抓拍模式配置
  23. 'sequential_mode': {
  24. 'enabled': True, # 是否启用顺序抓拍模式
  25. 'ptz_stabilize_time': 1.0, # PTZ到位后稳定等待时间(秒)
  26. 'capture_wait_time': 0.5, # 抓拍间隔时间(秒)
  27. 'return_to_panorama': True, # 完成后是否回到全景默认位置
  28. 'default_pan': 0.0, # 默认pan角度
  29. 'default_tilt': 0.0, # 默认tilt角度
  30. 'default_zoom': 1, # 默认zoom(广角,1=最小变焦)
  31. },
  32. }
  33. CALIBRATION_CONFIG = {
  34. 'interval': 24 * 60 * 60, # 校准间隔(秒),默认24小时
  35. 'daily_calibration_time': '08:00', # 每日自动校准时间 (HH:MM格式)
  36. 'quick_mode': True,
  37. 'auto_save': True,
  38. 'load_on_startup': True, # 启动时是否加载上次保存的校准数据
  39. 'force_daily_recalibration': True, # 每日校准是否强制重新校准(不使用已有数据)
  40. 'min_valid_points': 4,
  41. 'rms_error_threshold': 5.0,
  42. # 校准结果保存路径
  43. 'calibration_file': '/home/admin/dsh/calibration.json',
  44. 'overlap_discovery': {
  45. 'pan_range': (0, 360),
  46. 'tilt_range': (-30, 30),
  47. 'pan_step': 20,
  48. 'tilt_step': 15,
  49. 'min_match_threshold': 8,
  50. 'stabilize_time': 2.0,
  51. 'max_overlap_ranges': 3,
  52. 'min_positions_per_range': 3,
  53. },
  54. }