Skip to content

GaussianBlur

Image processingfunctionOpenCV 5.0.0
import { GaussianBlur } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

Blurs an image using a Gaussian filter.

The function convolves the source image with the specified Gaussian kernel. In-place filtering is supported.

See: sepFilter2D, filter2D, blur, boxFilter, bilateralFilter, medianBlur

GaussianBlur(src: Mat, dst: Mat, ksize: Size, sigmaX: number, sigmaY: number, borderType: number, hint: number): void;
4 available overloads
GaussianBlur(src: Mat, dst: Mat, ksize: Size, sigmaX: number): void;
GaussianBlur(src: Mat, dst: Mat, ksize: Size, sigmaX: number, sigmaY: number): void;
GaussianBlur(src: Mat, dst: Mat, ksize: Size, sigmaX: number, sigmaY: number, borderType: number): void;
GaussianBlur(src: Mat, dst: Mat, ksize: Size, sigmaX: number, sigmaY: number, borderType: number, hint: number): void;
src

input image; the image can have any number of channels, which are processed independently, but the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.

dst

Output destination, filled by the native operation. output image of the same size and type as src.

ksize

Gaussian kernel size. ksize.width and ksize.height can differ but they both must be positive and odd. Or, they can be zero's and then they are computed from sigma.

sigmaX

Gaussian kernel standard deviation in X direction.

sigmaY

Gaussian kernel standard deviation in Y direction; if sigmaY is zero, it is set to be equal to sigmaX, if both sigmas are zeros, they are computed from ksize.width and ksize.height, respectively (see #getGaussianKernel for details); to fully control the result regardless of possible future modifications of all this semantics, it is recommended to specify all of ksize, sigmaX, and sigmaY.

borderType

pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.

hint

Implementation modification flags. See #AlgorithmHint

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.