From 3e9b3711dcab42a9369c1e06e6ed2d5e6fc58073 Mon Sep 17 00:00:00 2001 From: Michael Wei Date: Fri, 27 Nov 2020 07:38:38 +0000 Subject: [PATCH] Use cv2.bitwise_and instead of numpy.where --- frigate/motion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frigate/motion.py b/frigate/motion.py index 2210ba481..31ffe5e89 100644 --- a/frigate/motion.py +++ b/frigate/motion.py @@ -48,7 +48,7 @@ class MotionDetector(): # black out everything in the avg_delta where there isnt motion in the current frame avg_delta_image = cv2.convertScaleAbs(self.avg_delta) - avg_delta_image[np.where(current_thresh==[0])] = [0] + avg_delta_image = cv2.bitwise_and(avg_delta_image, current_thresh) # then look for deltas above the threshold, but only in areas where there is a delta # in the current frame. this prevents deltas from previous frames from being included