mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-11 01:02:48 +03:00
Dynamically update masks and zones for cameras (#18359)
* Include config publisher in api * Call update topic for passed topics * Update zones dynamically * Update zones internally * Support zone and mask reset * Handle updating objects config * Don't put status for needing to restart Frigate * Cleanup http tests * Fix tests
This commit is contained in:
committed by
Blake Blackshear
parent
dc187eee1c
commit
4dc526761c
@@ -35,12 +35,7 @@ class ImprovedMotionDetector(MotionDetector):
|
||||
self.avg_frame = np.zeros(self.motion_frame_size, np.float32)
|
||||
self.motion_frame_count = 0
|
||||
self.frame_counter = 0
|
||||
resized_mask = cv2.resize(
|
||||
config.mask,
|
||||
dsize=(self.motion_frame_size[1], self.motion_frame_size[0]),
|
||||
interpolation=cv2.INTER_AREA,
|
||||
)
|
||||
self.mask = np.where(resized_mask == [0])
|
||||
self.update_mask()
|
||||
self.save_images = False
|
||||
self.calibrating = True
|
||||
self.blur_radius = blur_radius
|
||||
@@ -236,6 +231,14 @@ class ImprovedMotionDetector(MotionDetector):
|
||||
|
||||
return motion_boxes
|
||||
|
||||
def update_mask(self) -> None:
|
||||
resized_mask = cv2.resize(
|
||||
self.config.mask,
|
||||
dsize=(self.motion_frame_size[1], self.motion_frame_size[0]),
|
||||
interpolation=cv2.INTER_AREA,
|
||||
)
|
||||
self.mask = np.where(resized_mask == [0])
|
||||
|
||||
def stop(self) -> None:
|
||||
"""stop the motion detector."""
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user