Morphological Operations

Function: Performs morphological operations on the input image, including dilation, erosion, opening (erosion followed by dilation), closing (dilation followed by erosion); gradient operation (difference between dilation and erosion); top hat operation (difference between original image and its opening, used to separate lines or noise brighter than adjacent areas); black hat operation (difference between closing of the image and original image, used to extract small dark objects in bright backgrounds); hit-miss (intersection of foreground and background erosion operations, can achieve object thinning and pruning, often used for object recognition, image thinning). Only grayscale input is supported for hit-miss transform.

Input Parameters:

Name Type Valid Range Default Value Meaning

Image

Image

None

None

The input can be a color graph or a grayscale graph. This method handles many pairs of binarized graphs. Hit - Transform method not hit Only grayscale graphs are supported.

Output Parameters:

Name Type Valid Range Default Value Meaning

Morphological post-op image

Image

None

None

Image after morphological operation.

Parameter Settings:

Name Type Valid Range Default Value Meaning

Operation type

String

['Erosion', 'Dilation', 'Opening', 'Closing', 'Gradient', 'Top Hat', 'Black Hat', 'Hit-Miss Transform']

Opening

Morphological operation type, hit - miss transformation only supports grayscale diagrams, other methods can support color diagrams and grayscale diagrams.

Core size

List

None

[3, 3]

Core size.

Nucleus shape

String

['Rectangle', 'Cross', 'Ellipse', 'All-ones Matrix']

Rectangle

Nucleus shape.

Number of iterations

Integer

[1, 100]

1

In each operation, the number of consecutive executions of the corrosion and expansion algorithms.