From eab3998ad06691d741fafdff862de495ec482555 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Sat, 16 Jan 2021 07:04:17 -0600 Subject: [PATCH] remove support for image masks --- frigate/util.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/frigate/util.py b/frigate/util.py index 536f29452..fa777b2ee 100755 --- a/frigate/util.py +++ b/frigate/util.py @@ -305,16 +305,9 @@ def create_mask(frame_shape, mask): return mask_img def add_mask(mask, mask_img): - if mask.startswith('poly,'): - points = mask.split(',')[1:] - contour = np.array([[int(points[i]), int(points[i+1])] for i in range(0, len(points), 2)]) - cv2.fillPoly(mask_img, pts=[contour], color=(0)) - else: - mask_file = cv2.imread(f"/config/{mask}", cv2.IMREAD_GRAYSCALE) - if mask_file is None or mask_file.size == 0: - logger.warning(f"Could not read mask file {mask}") - else: - mask_img[np.where(mask_file==[0])] = [0] + points = mask.split(',') + contour = np.array([[int(points[i]), int(points[i+1])] for i in range(0, len(points), 2)]) + cv2.fillPoly(mask_img, pts=[contour], color=(0)) class FrameManager(ABC): @abstractmethod