mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-01-03 06:15:02 +00:00
Ensure motion is correctly set when adjusting masks
This commit is contained in:
parent
4b3c0b019d
commit
edeab2f491
@ -239,6 +239,12 @@ class ImprovedMotionDetector(MotionDetector):
|
||||
)
|
||||
self.mask = np.where(resized_mask == [0])
|
||||
|
||||
# Reset motion detection state when mask changes
|
||||
# so motion detection can quickly recalibrate with the new mask
|
||||
self.avg_frame = np.zeros(self.motion_frame_size, np.float32)
|
||||
self.calibrating = True
|
||||
self.motion_frame_count = 0
|
||||
|
||||
def stop(self) -> None:
|
||||
"""stop the motion detector."""
|
||||
pass
|
||||
|
||||
@ -771,6 +771,7 @@ def process_frames(
|
||||
camera_enabled = camera_config.enabled
|
||||
|
||||
if "motion" in updated_configs:
|
||||
motion_detector.config = camera_config.motion
|
||||
motion_detector.update_mask()
|
||||
|
||||
if (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user