From 6f90e35b68f30c8aec848603cfa68ad7a3ebc9c6 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sun, 3 Sep 2023 11:09:50 -0500 Subject: [PATCH] increase edge threshold --- frigate/ptz/autotrack.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/frigate/ptz/autotrack.py b/frigate/ptz/autotrack.py index 175507756..815557b8a 100644 --- a/frigate/ptz/autotrack.py +++ b/frigate/ptz/autotrack.py @@ -288,14 +288,16 @@ class PtzAutoTracker: zoom_level = self.ptz_metrics[camera]["ptz_zoom_level"].value # ensure zooming level is in range - # if so, check if bounding box is 10% of an edge + # if so, check if bounding box is 20% of an edge # if so, try zooming in, otherwise try zooming out + edge_threshold = 0.2 + if 0 < zoom_level <= 1: if ( - bb_left > 0.1 * camera_width - and bb_right < 0.9 * camera_width - and bb_top > 0.1 * camera_height - and bb_bottom < 0.9 * camera_height + bb_left > edge_threshold * camera_width + and bb_right < (1 - edge_threshold) * camera_width + and bb_top > edge_threshold * camera_height + and bb_bottom < (1 - edge_threshold) * camera_height ): zoom = min(1.0, zoom_level + 0.1) else: