From c5858bf4b38ac1150d90cbb4367997c575941d02 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Thu, 19 Oct 2023 17:31:57 -0500 Subject: [PATCH] fix initial absolute zoom --- frigate/ptz/autotrack.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frigate/ptz/autotrack.py b/frigate/ptz/autotrack.py index 53a6e140c..2c91b0157 100644 --- a/frigate/ptz/autotrack.py +++ b/frigate/ptz/autotrack.py @@ -986,7 +986,7 @@ class PtzAutoTracker: # absolute zooming separately from pan/tilt if camera_config.onvif.autotracking.zooming == ZoomingModeEnum.absolute: # don't zoom on initial move - if not self.tracked_object_history[camera]: + if "target_box" not in self.tracked_object_metrics[camera]: zoom = current_zoom_level else: if ( @@ -994,6 +994,7 @@ class PtzAutoTracker: camera, obj, obj.obj_data["box"], debug_zoom ) ) is not None: + # divide zoom in 10 increments and always zoom out more than in level = ( self.ptz_metrics[camera]["ptz_max_zoom"].value - self.ptz_metrics[camera]["ptz_min_zoom"].value