mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-02 17:25:22 +03:00
Add class variable and update in process_frames
This commit is contained in:
parent
8fd8eaa270
commit
e072788f35
@ -24,8 +24,9 @@ class MotionDetector:
|
|||||||
)
|
)
|
||||||
self.mask = np.where(resized_mask == [0])
|
self.mask = np.where(resized_mask == [0])
|
||||||
self.save_images = False
|
self.save_images = False
|
||||||
|
self.improve_contrast = self.config.improve_contrast
|
||||||
|
|
||||||
def detect(self, frame, improve_contrast):
|
def detect(self, frame):
|
||||||
motion_boxes = []
|
motion_boxes = []
|
||||||
|
|
||||||
gray = frame[0 : self.frame_shape[0], 0 : self.frame_shape[1]]
|
gray = frame[0 : self.frame_shape[0], 0 : self.frame_shape[1]]
|
||||||
@ -38,7 +39,7 @@ class MotionDetector:
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Improve contrast
|
# Improve contrast
|
||||||
if improve_contrast:
|
if self.improve_contrast:
|
||||||
minval = np.percentile(resized_frame, 4)
|
minval = np.percentile(resized_frame, 4)
|
||||||
maxval = np.percentile(resized_frame, 96)
|
maxval = np.percentile(resized_frame, 96)
|
||||||
# don't adjust if the image is a single color
|
# don't adjust if the image is a single color
|
||||||
|
|||||||
@ -494,8 +494,10 @@ def process_frames(
|
|||||||
logger.info(f"{camera_name}: frame {frame_time} is not in memory store.")
|
logger.info(f"{camera_name}: frame {frame_time} is not in memory store.")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
motion_detector.improve_contrast = improve_contrast_enabled.value
|
||||||
|
|
||||||
# look for motion
|
# look for motion
|
||||||
motion_boxes = motion_detector.detect(frame, improve_contrast_enabled.value)
|
motion_boxes = motion_detector.detect(frame)
|
||||||
|
|
||||||
regions = []
|
regions = []
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user