Skip to content

gapi_morphologyEx

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

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

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

Performs advanced morphological transformations.

The function 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.

Note: - Function textual ID is "org.opencv.imgproc.filters.morphologyEx"

  • 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).

See: dilate, erode, getStructuringElement

gapi_morphologyEx(src: GMat, op: number, kernel: Mat, anchor: Point, iterations: number, borderType: number, borderValue: Scalar): GMat;
5 available overloads
gapi_morphologyEx(src: GMat, op: number, kernel: Mat): GMat;
gapi_morphologyEx(src: GMat, op: number, kernel: Mat, anchor: Point): GMat;
gapi_morphologyEx(src: GMat, op: number, kernel: Mat, anchor: Point, iterations: number): GMat;
gapi_morphologyEx(src: GMat, op: number, kernel: Mat, anchor: Point, iterations: number, borderType: number): GMat;
gapi_morphologyEx(src: GMat, op: number, kernel: Mat, anchor: Point, iterations: number, borderType: number, borderValue: Scalar): GMat;
src

Input image.

op

Type of a morphological operation, see #MorphTypes

kernel

Structuring element. It can be created using #getStructuringElement.

anchor

Anchor position within the element. Both negative values mean that the anchor is at the kernel center.

iterations

Number of times erosion and dilation are applied.

borderType

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

borderValue

Border value in case of a constant border. The default value has a special meaning.

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.