mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
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
This commit is contained in:
parent
ced5ab203f
commit
c95758580f
@ -498,6 +498,10 @@ class CameraState:
|
|||||||
|
|
||||||
frame_copy = cv2.cvtColor(frame_copy, cv2.COLOR_YUV2BGR_I420)
|
frame_copy = cv2.cvtColor(frame_copy, cv2.COLOR_YUV2BGR_I420)
|
||||||
# draw on the frame
|
# 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"):
|
if draw_options.get("bounding_boxes"):
|
||||||
# draw the bounding boxes on the frame
|
# draw the bounding boxes on the frame
|
||||||
for obj in tracked_objects.values():
|
for obj in tracked_objects.values():
|
||||||
@ -622,10 +626,6 @@ class CameraState:
|
|||||||
)
|
)
|
||||||
cv2.drawContours(frame_copy, [zone.contour], -1, zone.color, thickness)
|
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"):
|
if draw_options.get("motion_boxes"):
|
||||||
for m_box in motion_boxes:
|
for m_box in motion_boxes:
|
||||||
cv2.rectangle(
|
cv2.rectangle(
|
||||||
|
Loading…
Reference in New Issue
Block a user