Don't zero out motion during calibration (#8163)

* don't zero out motion boxes

* define detect resolution to speed up tests
This commit is contained in:
Blake Blackshear
2023-10-14 08:05:44 -04:00
committed by GitHub
parent fa6c6c50d0
commit 9ea10f8541
5 changed files with 125 additions and 23 deletions

View File

@@ -20,3 +20,7 @@ class MotionDetector(ABC):
@abstractmethod
def detect(self, frame):
pass
@abstractmethod
def is_calibrating(self):
pass

View File

@@ -38,6 +38,9 @@ class FrigateMotionDetector(MotionDetector):
self.threshold = threshold
self.contour_area = contour_area
def is_calibrating(self):
return False
def detect(self, frame):
motion_boxes = []

View File

@@ -49,6 +49,9 @@ class ImprovedMotionDetector(MotionDetector):
self.contrast_values[:, 1:2] = 255
self.contrast_values_index = 0
def is_calibrating(self):
return self.calibrating
def detect(self, frame):
motion_boxes = []
@@ -141,7 +144,6 @@ class ImprovedMotionDetector(MotionDetector):
# if calibrating or the motion contours are > 80% of the image area (lightning, ir, ptz) recalibrate
if self.calibrating or pct_motion > self.config.lightning_threshold:
motion_boxes = []
self.calibrating = True
if self.save_images: