From b9649de3270021ac810142e0c0289717962258fa Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Tue, 24 Oct 2023 18:25:22 -0500 Subject: [PATCH] Don't generate region boxes from motion when autotracking (#8306) * no region boxes from motion boxes when ptz moving * debug contours and calibration * remove debugging * clarifying comment --- frigate/video.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frigate/video.py b/frigate/video.py index 7dab59bb3..b479fd725 100755 --- a/frigate/video.py +++ b/frigate/video.py @@ -22,6 +22,7 @@ from frigate.log import LogPipe from frigate.motion import MotionDetector from frigate.motion.improved_motion import ImprovedMotionDetector from frigate.object_detection import RemoteObjectDetector +from frigate.ptz.autotrack import ptz_moving_at_frame_time from frigate.track import ObjectTracker from frigate.track.norfair_tracker import NorfairTracker from frigate.types import PTZMetricsTypes @@ -626,8 +627,13 @@ def process_frames( ) ] - # only add in the motion boxes when not calibrating - if not motion_detector.is_calibrating(): + # only add in the motion boxes when not calibrating and a ptz is not moving via autotracking + # ptz_moving_at_frame_time() always returns False for non-autotracking cameras + if not motion_detector.is_calibrating() and not ptz_moving_at_frame_time( + frame_time, + ptz_metrics["ptz_start_time"].value, + ptz_metrics["ptz_stop_time"].value, + ): # find motion boxes that are not inside tracked object regions standalone_motion_boxes = [ b for b in motion_boxes if not inside_any(b, regions)