From c061ff14ee2b374c6d259980976fbca133a5c689 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Sat, 10 Jun 2023 14:13:43 -0500 Subject: [PATCH] increase alpha during calibration --- frigate/motion/improved_motion.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frigate/motion/improved_motion.py b/frigate/motion/improved_motion.py index 4e68720ba..882cd22ee 100644 --- a/frigate/motion/improved_motion.py +++ b/frigate/motion/improved_motion.py @@ -127,12 +127,16 @@ class ImprovedMotionDetector(MotionDetector): if self.motion_frame_count >= 10: # only average in the current frame if the difference persists for a bit cv2.accumulateWeighted( - resized_frame, self.avg_frame, self.config.frame_alpha + resized_frame, + self.avg_frame, + 0.2 if self.calibrating else self.config.frame_alpha, ) else: # when no motion, just keep averaging the frames together cv2.accumulateWeighted( - resized_frame, self.avg_frame, self.config.frame_alpha + resized_frame, + self.avg_frame, + 0.2 if self.calibrating else self.config.frame_alpha, ) self.motion_frame_count = 0