coordinator.py 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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': 2.5, # PTZ到位后稳定等待时间(秒) - 增加以确保画面清晰
  26. 'capture_wait_time': 0.5, # 抓拍间隔时间(秒)
  27. 'auto_zoom_wait_time': 1.0, # AutoZoom变焦后额外等待时间(秒) - 等待镜头对焦
  28. 'return_to_panorama': True, # 完成后是否回到全景默认位置
  29. 'default_pan': 0.0, # 默认pan角度
  30. 'default_tilt': 0.0, # 默认tilt角度
  31. 'default_zoom': 1, # 默认zoom(广角,1=最小变焦)
  32. },
  33. }
  34. CALIBRATION_CONFIG = {
  35. 'interval': 24 * 60 * 60, # 校准间隔(秒),默认24小时
  36. 'daily_calibration_time': '08:00', # 每日自动校准时间 (HH:MM格式)
  37. 'quick_mode': True,
  38. 'auto_save': True,
  39. 'load_on_startup': True, # 启动时是否加载上次保存的校准数据
  40. 'force_daily_recalibration': True, # 每日校准是否强制重新校准(不使用已有数据)
  41. 'min_valid_points': 4,
  42. 'rms_error_threshold': 5.0,
  43. # 校准结果保存路径
  44. 'calibration_file': '/home/admin/dsh/calibration.json',
  45. 'overlap_discovery': {
  46. 'pan_range': (0, 360),
  47. 'tilt_range': (-30, 30),
  48. 'pan_step': 20,
  49. 'tilt_step': 15,
  50. 'min_match_threshold': 8,
  51. 'stabilize_time': 2.0,
  52. 'max_overlap_ranges': 3,
  53. 'min_positions_per_range': 3,
  54. },
  55. }