pass fps to motion detector

This commit is contained in:
Blake Blackshear 2023-06-04 09:42:30 -05:00
parent 3b74c79919
commit 3c58d44f91
4 changed files with 7 additions and 1 deletions

View File

@ -10,6 +10,7 @@ class MotionDetector(ABC):
self,
frame_shape: Tuple[int, int, int],
config: MotionConfig,
fps: int,
improve_contrast,
threshold,
contour_area,

View File

@ -13,6 +13,7 @@ class CNTMotionDetector(MotionDetector):
self,
frame_shape: Tuple[int, int, int],
config: MotionConfig,
fps: int,
improve_contrast,
threshold,
contour_area,
@ -41,7 +42,9 @@ class CNTMotionDetector(MotionDetector):
# bool useHistory = true,
# int maxPixelStability = 15*60,
# bool isParallel = true);
self.bg_subtractor = cv2.bgsegm.createBackgroundSubtractorCNT()
self.bg_subtractor = cv2.bgsegm.createBackgroundSubtractorCNT(
fps, True, fps * 60, True
)
self.save_images = False
self.frame_counter = 0

View File

@ -11,6 +11,7 @@ class FrigateMotionDetector(MotionDetector):
self,
frame_shape,
config: MotionConfig,
fps: int,
improve_contrast_enabled,
motion_threshold,
motion_contour_area,

View File

@ -466,6 +466,7 @@ def track_camera(
motion_detector = CNTMotionDetector(
frame_shape,
config.motion,
config.detect.fps,
improve_contrast_enabled,
motion_threshold,
motion_contour_area,