Skip to content

gapi_blur

gapifunctionOpenCV 5.0.0
import { gapi_blur } from '@banou/opencv-wasm'

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

ARGUMENTSsrc, ksize, anchor, borderType
FUNCTIONgapi_blur
RETURN TYPEGMat
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Blurs an image using the normalized box filter.

The function smooths an image using the kernel:

\texttt{K} =  \frac{1}{\texttt{ksize.width*ksize.height}} \begin{bmatrix} 1 & 1 & 1 &  \cdots & 1 & 1  \\ 1 & 1 & 1 &  \cdots & 1 & 1  \\ \hdotsfor{6} \\ 1 & 1 & 1 &  \cdots & 1 & 1  \\ \end{bmatrix}

The call blur(src, ksize, anchor, borderType) is equivalent to boxFilter(src, src.type(), ksize, anchor, true, borderType).

Supported input matrix data types are CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1. Output image must have the same type, size, and number of channels as the input image.

Note: - Rounding to nearest even is procedeed if hardware supports it, if not - to nearest.

  • Function textual ID is "org.opencv.imgproc.filters.blur"

See: boxFilter, bilateralFilter, GaussianBlur, medianBlur

gapi_blur(src: GMat, ksize: Size, anchor: Point, borderType: number, borderValue: Scalar): GMat;
4 available overloads
gapi_blur(src: GMat, ksize: Size): GMat;
gapi_blur(src: GMat, ksize: Size, anchor: Point): GMat;
gapi_blur(src: GMat, ksize: Size, anchor: Point, borderType: number): GMat;
gapi_blur(src: GMat, ksize: Size, anchor: Point, borderType: number, borderValue: Scalar): GMat;
src

Source image.

ksize

blurring kernel size.

anchor

anchor point; default value Point(-1,-1) means that the anchor is at the kernel center.

borderType

border mode used to extrapolate pixels outside of the image, see cv::BorderTypes

borderValue

border value in case of constant border type

Returns

The GMat result. Release returned native handles with using or delete(), including handles nested in results.

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.