mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-26 19:06:11 +01:00
remove support for image masks
This commit is contained in:
parent
a3dfd3a8e0
commit
eab3998ad0
@ -305,16 +305,9 @@ def create_mask(frame_shape, mask):
|
|||||||
return mask_img
|
return mask_img
|
||||||
|
|
||||||
def add_mask(mask, mask_img):
|
def add_mask(mask, mask_img):
|
||||||
if mask.startswith('poly,'):
|
points = mask.split(',')
|
||||||
points = mask.split(',')[1:]
|
contour = np.array([[int(points[i]), int(points[i+1])] for i in range(0, len(points), 2)])
|
||||||
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))
|
||||||
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]
|
|
||||||
|
|
||||||
class FrameManager(ABC):
|
class FrameManager(ABC):
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
|
Loading…
Reference in New Issue
Block a user