mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-25 09:38:22 +03: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])
|
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:
|
def stop(self) -> None:
|
||||||
"""stop the motion detector."""
|
"""stop the motion detector."""
|
||||||
pass
|
pass
|
||||||
|
|||||||
@ -771,6 +771,7 @@ def process_frames(
|
|||||||
camera_enabled = camera_config.enabled
|
camera_enabled = camera_config.enabled
|
||||||
|
|
||||||
if "motion" in updated_configs:
|
if "motion" in updated_configs:
|
||||||
|
motion_detector.config = camera_config.motion
|
||||||
motion_detector.update_mask()
|
motion_detector.update_mask()
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user