getStructuringElement
import { getStructuringElement } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Returns a structuring element of the specified size and shape for morphological operations.
The function constructs and returns the structuring element that can be further passed to #erode, #dilate or #morphologyEx. But you can also construct an arbitrary binary mask yourself and use it as the structuring element.
getStructuringElement(shape: number, ksize: Size, anchor: Point): Mat;2 available overloads
getStructuringElement(shape: number, ksize: Size): Mat;getStructuringElement(shape: number, ksize: Size, anchor: Point): Mat;shapeElement shape that could be one of #MorphShapes
ksizeSize of the structuring element.
anchorAnchor position within the element. The default value
(-1, -1)means that the anchor is at the center. Note that only the shape of a cross-shaped element depends on the anchor position. In other cases the anchor just regulates how much the result of the morphological operation is shifted.
The Mat 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.