diff --git a/frigate/motion.py b/frigate/motion.py index d426d681d..7219db93f 100644 --- a/frigate/motion.py +++ b/frigate/motion.py @@ -5,7 +5,7 @@ from frigate.config import MotionConfig class MotionDetector: - def __init__(self, frame_shape, config: MotionConfig): + def __init__(self, frame_shape, config: MotionConfig, improve_contrast_enabled): self.config = config self.frame_shape = frame_shape self.resize_factor = frame_shape[0] / config.frame_height @@ -24,7 +24,7 @@ class MotionDetector: ) self.mask = np.where(resized_mask == [0]) self.save_images = False - self.improve_contrast = self.config.improve_contrast + self.improve_contrast = improve_contrast_enabled.value def detect(self, frame): motion_boxes = [] diff --git a/frigate/video.py b/frigate/video.py index b3e40fbdb..f6960414d 100755 --- a/frigate/video.py +++ b/frigate/video.py @@ -354,7 +354,7 @@ def track_camera( objects_to_track = config.objects.track object_filters = config.objects.filters - motion_detector = MotionDetector(frame_shape, config.motion) + motion_detector = MotionDetector(frame_shape, config.motion, improve_contrast_enabled) object_detector = RemoteObjectDetector( name, labelmap, detection_queue, result_connection, model_shape ) @@ -494,8 +494,6 @@ def process_frames( logger.info(f"{camera_name}: frame {frame_time} is not in memory store.") continue - motion_detector.improve_contrast = improve_contrast_enabled.value - # look for motion motion_boxes = motion_detector.detect(frame)