Mask hardness

This commit is contained in:
MikEarpp 2020-12-28 13:51:56 +01:00 committed by GitHub
parent 2bc8736fd9
commit 0cb8153300
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -294,8 +294,14 @@ class CameraState():
cv2.drawContours(frame_copy, [zone.contour], -1, zone.color, thickness)
if draw_options.get('mask'):
darkness = draw_options.get('mask')
if darkness > 1:
frame = np.copy(frame_copy)
mask_overlay = np.where(self.camera_config.mask==[0])
frame_copy[mask_overlay] = [0,0,0]
if darkness > 1:
darkness = darkness / 100 if darkness < 101 else 0.5
frame_copy = cv2.addWeighted(frame, 1 - darkness, frame_copy, 1, 0)
if draw_options.get('motion_boxes'):
for m_box in motion_boxes: