morphologyEx
import { morphologyEx } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Performs advanced morphological transformations.
The function cv::morphologyEx can perform advanced morphological transformations using an erosion and dilation as basic operations.
Any of the operations can be done in-place. In case of multi-channel images, each channel is processed independently.
See: dilate, erode, getStructuringElement
Note: The number of iterations is the number of times erosion or dilatation operation will be applied. For instance, an opening operation (#MORPH_OPEN) with two iterations is equivalent to apply successively: erode -> erode -> dilate -> dilate (and not erode -> dilate -> erode -> dilate).
morphologyEx(src: Mat, dst: Mat, op: number, kernel: Mat, anchor: Point, iterations: number, borderType: number, borderValue: Scalar): void;5 available overloads
morphologyEx(src: Mat, dst: Mat, op: number, kernel: Mat): void;morphologyEx(src: Mat, dst: Mat, op: number, kernel: Mat, anchor: Point): void;morphologyEx(src: Mat, dst: Mat, op: number, kernel: Mat, anchor: Point, iterations: number): void;morphologyEx(src: Mat, dst: Mat, op: number, kernel: Mat, anchor: Point, iterations: number, borderType: number): void;morphologyEx(src: Mat, dst: Mat, op: number, kernel: Mat, anchor: Point, iterations: number, borderType: number, borderValue: Scalar): void;srcSource image. The number of channels can be arbitrary. The depth should be one of CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
dstOutput destination, filled by the native operation. Destination image of the same size and type as source image.
opType of a morphological operation, see #MorphTypes
kernelStructuring element. It can be created using #getStructuringElement.
anchorAnchor position with the kernel. Negative values mean that the anchor is at the kernel center.
iterationsNumber of times erosion and dilation are applied.
borderTypePixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported.
borderValueBorder value in case of a constant border. The default value has a special meaning.
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.