Skip to content

NVR with realtime local object detection for IP cameras

Setting motion masks to zero, rather than 255, will speed up calibration, as the average frame starts out at zero (#9992)

JCfc94fcb2ac66
diff --git a/frigate/motion/improved_motion.py b/frigate/motion/improved_motion.py
index e09c1547f1..6fb17ec299 100644
--- a/frigate/motion/improved_motion.py
+++ b/frigate/motion/improved_motion.py
@@ -101,7 +101,8 @@ class ImprovedMotionDetector(MotionDetector):
# mask frame
# this has to come after contrast improvement
- resized_frame[self.mask] = [255]
+ # Setting masked pixels to zero, to match the average frame at startup
+ resized_frame[self.mask] = [0]
resized_frame = gaussian_filter(resized_frame, sigma=1, radius=self.blur_radius)