Table of Contents

Method GetStructuringElement

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

GetStructuringElement(MorphShapes, Size)

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.

public static Mat GetStructuringElement(MorphShapes shape, Size ksize)

Parameters

shape MorphShapes

Element shape that could be one of MorphShapes

ksize Size

Size of the structuring element.

Returns

Mat

GetStructuringElement(MorphShapes, Size, Point)

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.

public static Mat GetStructuringElement(MorphShapes shape, Size ksize, Point anchor)

Parameters

shape MorphShapes

Element shape that could be one of MorphShapes

ksize Size

Size of the structuring element.

anchor Point

Anchor 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.

Returns

Mat