gapi_boxFilter
import { gapi_boxFilter } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Blurs an image using the box filter.
The function smooths an image using the kernel:
\texttt{K} = \alpha \begin{bmatrix} 1 & 1 & 1 & \cdots & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \hdotsfor{6} \\ 1 & 1 & 1 & \cdots & 1 & 1 \end{bmatrix}
where
\alpha = \begin{cases} \frac{1}{\texttt{ksize.width*ksize.height}} & \texttt{when } \texttt{normalize=true} \\1 & \texttt{otherwise} \end{cases}
Unnormalized box filter is useful for computing various integral characteristics over each pixel neighborhood, such as covariance matrices of image derivatives (used in dense optical flow algorithms, and so on). If you need to compute pixel sums over variable-size windows, use cv::integral.
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.boxfilter"
See: sepFilter, gaussianBlur, medianBlur, integral
gapi_boxFilter(src: GMat, dtype: number, ksize: Size, anchor: Point, normalize: boolean, borderType: number, borderValue: Scalar): GMat;5 available overloads
gapi_boxFilter(src: GMat, dtype: number, ksize: Size): GMat;gapi_boxFilter(src: GMat, dtype: number, ksize: Size, anchor: Point): GMat;gapi_boxFilter(src: GMat, dtype: number, ksize: Size, anchor: Point, normalize: boolean): GMat;gapi_boxFilter(src: GMat, dtype: number, ksize: Size, anchor: Point, normalize: boolean, borderType: number): GMat;gapi_boxFilter(src: GMat, dtype: number, ksize: Size, anchor: Point, normalize: boolean, borderType: number, borderValue: Scalar): GMat;srcSource image.
dtypethe output image depth (-1 to set the input image data type).
ksizeblurring kernel size.
anchorAnchor position within the kernel. The default value
(-1,-1)means that the anchor is at the kernel center.normalizeflag, specifying whether the kernel is normalized by its area or not.
borderTypePixel extrapolation method, see cv::BorderTypes
borderValueborder value in case of constant border type
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.