|
@@ -351,7 +351,12 @@ class Coordinator:
|
|
|
should_move = False
|
|
should_move = False
|
|
|
|
|
|
|
|
if should_move:
|
|
if should_move:
|
|
|
- self.ptz.track_target(x_ratio, y_ratio)
|
|
|
|
|
|
|
+ if self.enable_calibration and self.calibrator and self.calibrator.is_calibrated():
|
|
|
|
|
+ pan, tilt = self.calibrator.transform(x_ratio, y_ratio)
|
|
|
|
|
+ zoom = self.ptz.ptz_config.get('default_zoom', 8)
|
|
|
|
|
+ self.ptz.goto_exact_position(pan, tilt, zoom)
|
|
|
|
|
+ else:
|
|
|
|
|
+ self.ptz.track_target(x_ratio, y_ratio)
|
|
|
self.last_ptz_position = (x_ratio, y_ratio)
|
|
self.last_ptz_position = (x_ratio, y_ratio)
|
|
|
|
|
|
|
|
# 执行OCR识别 (仅在 OCR 启用时)
|
|
# 执行OCR识别 (仅在 OCR 启用时)
|
|
@@ -473,7 +478,11 @@ class Coordinator:
|
|
|
zoom: 变倍
|
|
zoom: 变倍
|
|
|
"""
|
|
"""
|
|
|
if self.enable_ptz_tracking and self.enable_ptz_camera:
|
|
if self.enable_ptz_tracking and self.enable_ptz_camera:
|
|
|
- self.ptz.move_to_target(x_ratio, y_ratio, zoom)
|
|
|
|
|
|
|
+ if self.enable_calibration and self.calibrator and self.calibrator.is_calibrated():
|
|
|
|
|
+ pan, tilt = self.calibrator.transform(x_ratio, y_ratio)
|
|
|
|
|
+ self.ptz.goto_exact_position(pan, tilt, zoom or self.ptz.ptz_config.get('default_zoom', 8))
|
|
|
|
|
+ else:
|
|
|
|
|
+ self.ptz.move_to_target(x_ratio, y_ratio, zoom)
|
|
|
|
|
|
|
|
def capture_snapshot(self) -> Optional[np.ndarray]:
|
|
def capture_snapshot(self) -> Optional[np.ndarray]:
|
|
|
"""
|
|
"""
|