medianBlur
import { medianBlur } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
example: samples/cpp/tutorial_code/ImgProc/Smoothing/Smoothing.cpp
Sample code for simple filters
Check tutorial_gausian_median_blur_bilateral_filter "the corresponding tutorial" for more details
Blurs an image using the median filter.
The function smoothes an image using the median filter with the \texttt{ksize} \times \texttt{ksize} aperture. Each channel of a multi-channel image is processed independently.
In-place operation is supported.
Note: The median filter uses #BORDER_REPLICATE internally to cope with border pixels, see #BorderTypes
See: bilateralFilter, blur, boxFilter, GaussianBlur
medianBlur(src: Mat, dst: Mat, ksize: number): void;srcinput 1-, 3-, or 4-channel image; when ksize is 3 or 5, the image depth should be CV_8U, CV_16U, or CV_32F, for larger aperture sizes, it can only be CV_8U.
dstOutput destination, filled by the native operation. destination array of the same size and type as src.
ksizeaperture linear size; it must be odd and greater than 1, for example: 3, 5, 7 ...
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.