From c95758580fe71d0a4901b03f6cdc0decb4dc745c Mon Sep 17 00:00:00 2001 From: James Tanner-McLeod Date: Tue, 28 May 2024 14:44:20 -0400 Subject: [PATCH] Draw motion mask first (#11598) This draws the motion mask before the other overlay elements (such as bounding boxes), so that they are still visible. Fixes #11592 --- frigate/object_processing.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frigate/object_processing.py b/frigate/object_processing.py index 676c175ec..7ac0b7276 100644 --- a/frigate/object_processing.py +++ b/frigate/object_processing.py @@ -498,6 +498,10 @@ class CameraState: frame_copy = cv2.cvtColor(frame_copy, cv2.COLOR_YUV2BGR_I420) # draw on the frame + if draw_options.get("mask"): + mask_overlay = np.where(self.camera_config.motion.mask == [0]) + frame_copy[mask_overlay] = [0, 0, 0] + if draw_options.get("bounding_boxes"): # draw the bounding boxes on the frame for obj in tracked_objects.values(): @@ -622,10 +626,6 @@ class CameraState: ) cv2.drawContours(frame_copy, [zone.contour], -1, zone.color, thickness) - if draw_options.get("mask"): - mask_overlay = np.where(self.camera_config.motion.mask == [0]) - frame_copy[mask_overlay] = [0, 0, 0] - if draw_options.get("motion_boxes"): for m_box in motion_boxes: cv2.rectangle(