newest shit
This commit is contained in:
@@ -118,11 +118,13 @@ def apply_green_mask(frame, masks):
|
|||||||
resized_mask = cv2.resize(
|
resized_mask = cv2.resize(
|
||||||
mask.astype(np.float32),
|
mask.astype(np.float32),
|
||||||
(frame.shape[1], frame.shape[0]),
|
(frame.shape[1], frame.shape[0]),
|
||||||
interpolation=cv2.INTER_LINEAR
|
interpolation=cv2.INTER_CUBIC
|
||||||
)
|
)
|
||||||
# Threshold the resized mask to obtain a boolean mask
|
# Threshold the resized mask to obtain a boolean mask
|
||||||
# add a small gausian blur to the mask to smooth out the edges
|
# 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
|
mask = resized_mask > 0.5
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ ffmpeg -i "$input_file" -c copy -f segment -segment_time "$time" -reset_timestam
|
|||||||
cd "$output_folder"
|
cd "$output_folder"
|
||||||
|
|
||||||
# Create a file list for the segments and move each segment to its own folder
|
# Create a file list for the segments and move each segment to its own folder
|
||||||
counter=1
|
counter=0
|
||||||
for segment in segment_*.mp4; do
|
for segment in segment_*.mp4; do
|
||||||
segment_folder="segment_$counter"
|
segment_folder="segment_$counter"
|
||||||
mkdir -p "$segment_folder"
|
mkdir -p "$segment_folder"
|
||||||
|
|||||||
Reference in New Issue
Block a user