newest shit

This commit is contained in:
2024-10-21 19:49:59 -07:00
parent 535a984cba
commit 7d4caa820d
2 changed files with 5 additions and 3 deletions

View File

@@ -118,11 +118,13 @@ def apply_green_mask(frame, masks):
resized_mask = cv2.resize(
mask.astype(np.float32),
(frame.shape[1], frame.shape[0]),
interpolation=cv2.INTER_LINEAR
interpolation=cv2.INTER_CUBIC
)
# Threshold the resized mask to obtain a boolean mask
# add a small gausian blur to the mask to smooth out the edges
resized_mask = cv2.GaussianBlur(resized_mask, (50, 50), 0)
blurred_mask = cv2.GaussianBlur(resized_mask, (5, 5), 0)
combined_mask = np.maximum(combined_mask, blurred_mask)
mask = resized_mask > 0.5
else: