From c16ee3186f1fe2d81e797e8da2c4f3718eafb654 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Thu, 10 Sep 2020 17:37:58 -0500 Subject: [PATCH] fix masks --- frigate/video.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frigate/video.py b/frigate/video.py index c8632a8e8..b9d735d78 100755 --- a/frigate/video.py +++ b/frigate/video.py @@ -83,7 +83,7 @@ def filtered(obj, objects_to_track, object_filters, mask=None): x_location = min(int((obj[2][2]-obj[2][0])/2.0)+obj[2][0], len(mask[0])-1) # if the object is in a masked location, don't add it to detected objects - if (not mask is None) and (mask[y_location][x_location][0] == 0): + if (not mask is None) and (mask[y_location][x_location] == 0): return True return False @@ -208,7 +208,7 @@ def track_camera(name, config, frame_queue, frame_shape, detection_queue, detect mask = None if mask is None: - mask = np.zeros((frame_shape[0], frame_shape[1], 1), np.uint8) + mask = np.zeros((frame_shape[0], frame_shape[1]), np.uint8) mask[:] = 255 motion_detector = MotionDetector(frame_shape, mask, resize_factor=6)