dilate
import { dilate } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
example: samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp
Erosion and Dilation sample code

Check tutorial_erosion_dilatation "the corresponding tutorial" for more details
Dilates an image by using a specific structuring element.
The function dilates the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the maximum is taken:
\texttt{dst} (x,y) = \max _{(x',y'): \, \texttt{kernel} (x',y') \ne0 } \texttt{src} (x+x',y+y')
The function supports the in-place mode. Dilation can be applied several ( iterations ) times. In case of multi-channel images, each channel is processed independently.
See: erode, morphologyEx, getStructuringElement
dilate(src: Mat, dst: Mat, kernel: Mat, anchor: Point, iterations: number, borderType: number, borderValue: Scalar): void;5 available overloads
dilate(src: Mat, dst: Mat, kernel: Mat): void;dilate(src: Mat, dst: Mat, kernel: Mat, anchor: Point): void;dilate(src: Mat, dst: Mat, kernel: Mat, anchor: Point, iterations: number): void;dilate(src: Mat, dst: Mat, kernel: Mat, anchor: Point, iterations: number, borderType: number): void;dilate(src: Mat, dst: Mat, kernel: Mat, anchor: Point, iterations: number, borderType: number, borderValue: Scalar): void;srcinput image; the number of channels can be arbitrary, but the depth should be one of CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
dstOutput destination, filled by the native operation. output image of the same size and type as src.
kernelstructuring element used for dilation; if
kernel=Mat(), a3 x 3rectangular structuring element is used. Kernel can be created using #getStructuringElementanchorposition of the anchor within the element; default value (-1, -1) means that the anchor is at the element center.
iterationsnumber of times dilation is applied.
borderTypepixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.
borderValueborder value in case of a constant border
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.