Filter
Auto-generated documentation for musicalgestures._filter module.
- Mgt-python / Modules / Musicalgestures / Filter
filter_frame
def filter_frame(motion_frame, filtertype, thresh, kernel_size):
Applies a threshold filter and then a median filter (of kernel_sizexkernel_size) to an image or videoframe.
Arguments
motion_framenp.array(uint8) - Input motion image.filtertypestr - 'Regular' turns all values belowthreshto 0. 'Binary' turns all values belowthreshto 0, abovethreshto 1. 'Blob' removes individual pixels with erosion method.threshfloat - A number in the range of 0 to 1. Eliminates pixel values less than given threshold.kernel_sizeint - Size of structuring element.
Returns
np.array(uint8)- The filtered frame.
filter_frame_ffmpeg
def filter_frame_ffmpeg(
filename,
cmd,
color,
blur,
filtertype,
threshold,
kernel_size,
use_median,
invert=False,
):