Morphological Transformations

You are currently viewing the documentation for version 1.8.1. To access documentation for other versions, click the "Switch Version" button located in the upper-right corner of the page.

■ To use the latest version, visit the Mech-Mind Download Center to download it.

■ If you're unsure about the version of the product you are using, please contact Mech-Mind Technical Support for assistance.

Function

This Step processes an image using morphological operations.

morphological transformations functional description

Usage Scenario

This Step is usually used for image pre-processing. When the quality of images is not ideal and further adjustment is needed, you need to apply operations such as dilation, erosion, and opening and closing to denoise, fill, etc. based on actual requirements.

Input and Output

When ClosingOperator is selected, the input and output are as shown in the figure below.

morphological transformations input and output

Parameter Description

Morphological Transformations

Description: This parameter is used to choose the type of morphological transformation.

Default setting: DilateOperator

List of options: ClosingOperator, DilateOperator, ErodeOperator, OpeningOperator, and Skeleton.

Instruction:

  1. ClosingOperator: Closing is reverse of Opening, Dilation followed by Erosion. It is useful in closing small holes inside the foreground objects, or small black points on the object.

    Kernel Size

    Default value: 21 px

    Instruction: The size of the kernel should be set according to the measurement requirements. A larger size is accompanied by better erosion performance after dilation. Please refer to the configuration example for the corresponding result.

    Kernel Shape

    Default setting: Rectangle (MORPH_RECT)

    Options: Rectangle (MORPH_RECT), Cross shape (MORPH_CROSS), and Ellipse (MORPH_ELLIPSE).

    Instruction: It is recommended to keep the default setting. However, you may configure the setting according to specific requirements.

    Performance on image detail restoration: MORPH_RECT < MORPH_CROSS < MORPH_ELLIPSE

    • Time required for operation: MORPH_RECT < MORPH_CROSS < MORPH_ELLIPSE

  2. DilateOperator: Dilation. It is mainly used to increase the object area and join broken parts of an object.

    Kernel Size

    Default value: 3 px

    Instruction: The size of the kernel should be set according to the measurement requirements. The larger the kernel size, the more dilated the object area. Please refer to the configuration example for the corresponding result.

    Kernel Shape

    Default setting: Rectangle (MORPH_RECT)

    Options: Rectangle (MORPH_RECT), Cross shape (MORPH_CROSS), and Ellipse (MORPH_ELLIPSE).

    Instruction: It is recommended to keep the default setting. However, you may configure the setting according to specific requirements.

    Performance on image detail restoration: MORPH_RECT < MORPH_CROSS < MORPH_ELLIPSE

    • Time required for operation: MORPH_RECT < MORPH_CROSS < MORPH_ELLIPSE

  3. ErodeOperator: Erosion. It is mainly used to remove small noises and detach two connected objects.

    Kernel Size

    Default value: 3 px

    Instruction: The size of the kernel should be set according to the measurement requirements. The larger the kernel size, the greater the erosion of the object area. Please refer to the configuration example for the corresponding result.

    Kernel Shape

    Default setting: Rectangle (MORPH_RECT)

    Options: Rectangle (MORPH_RECT), Cross shape (MORPH_CROSS), and Ellipse (MORPH_ELLIPSE).

    Instruction: It is recommended to keep the default setting. However, you may configure the setting according to specific requirements.

    Performance on image detail restoration: MORPH_RECT < MORPH_CROSS < MORPH_ELLIPSE

    • Time required for operation: MORPH_RECT < MORPH_CROSS < MORPH_ELLIPSE

  4. OpeningOperator: Opening is another name of erosion followed by dilation. It is useful in removing noise.

    Kernel Size

    Default value: 21 px

    Instruction: The size of the kernel should be set according to the measurement requirements. Please refer to the configuration example for the corresponding result.

    Kernel Shape

    Default setting: Rectangle (MORPH_RECT)

    Options: Rectangle (MORPH_RECT), Cross shape (MORPH_CROSS), and Ellipse (MORPH_ELLIPSE).

    Instruction: It is recommended to keep the default setting. However, you may configure the setting according to specific requirements.

    Performance on image detail restoration: MORPH_RECT < MORPH_CROSS < MORPH_ELLIPSE

    • Time required for operation: MORPH_RECT < MORPH_CROSS < MORPH_ELLIPSE

  5. Skeleton: Extract the contour of the object. Please refer to the configuration example for the corresponding result.

Configuration Examples

ClosingOperator

When ClosingOperator is selected, the size increase of the kernel is shown in the images below (the kernel size grows by degrees and from image 1 to 3):

morphological transformations contrast effects of closing operator1

DilateOperator

When DilateOperator is selected, the size increase of the kernel is shown in the images below (The kernel size grows by degrees and from image 1 to 3):

morphological transformations contrast effects of dilate operator1

ErodeOperator

When ErodeOperator is selected, the size increase of the kernel is shown in the images below (The kernel size grows by degrees and from image 1 to 3):

morphological transformations contrast effects of erode operator1

OpeningOperator

When OpeningOperator is selected, the size increase of the kernel is shown in the images below (The kernel size grows by degrees and from image 1 to 3):

morphological transformations contrast effects of opening operator1

Skeleton

The images before and after Skeleton is selected are as follows:

morphological transformations contrast effects of skeleton1

We Value Your Privacy

We use cookies to provide you with the best possible experience on our website. By continuing to use the site, you acknowledge that you agree to the use of cookies. If you decline, a single cookie will be used to ensure you're not tracked or remembered when you visit this website.