Morphology functions apply structure elements to images. A structure element is like a stencil with holes. When the stencil is placed on an image then only some pixels are visible through the holes. The gray values of these pixels are collected and their external gray value (minimum or maximum) is computed.

This external gray value is assigned to that pixel of the resulting image which corresponds to the place of the origin of the stencil on the input image. When the stencil is placed at all positions of the input image, all pixels of the resulting image are thus assigned. When bigger structure elements are required than those which are provided, these can be achieved by iterating the small elements using the Count parameter.

The following functions are available:

Function

Description

Erode

Shrinks bright structures on a darker background in the input image. Thin connections between structures and small structures itself will disappear.

Dilate

Expands bright structures on a darker background in the input image. Small gaps between structures are filled and those structures become connected.

Open

First erodes (Erode class) the bright structures on a darker background in the input image, then it dilates (Dilate class) the result by the same number of steps. Thus it separates bright structures on a darker background, but approximately keeps the size of the structures.

Close

First dilates (Dilate class) the bright structures on a darker background in the input image, then it erodes (Erode class) the result by the same number of steps. Thus it connects bright structures on a darker background, but approximately keeps the size of the structures.

Top Hat (White)

Computes the difference between the original image and the image produced by an open operation (Open class). Bright structures which were flattened by the opening are strengthened in the result. This is like putting a top hat with the size of the open operation upon the structure and keep only the part inside the hat.

Top Hat (Black)

Computes the difference between the original image and the image produced by a close operation (Close class). Dark structures which were flattened by the closing are strengthened in the result. This is like lifting a top hat with the size of the close operation beneath the structure from the dark side and keep only the part inside the hat.

Gradient

Computes the difference between the dilated image and the eroded image (Dilate and Erode class). Since a point in the dilated image has the maximum gray value and the corresponding point in the eroded image has the minimum gray value within the structure element the difference is zero for regions of constant gray values and gets bigger for steeper gray value ramps or edges.

Watersheds

Computes the barriers between catchment basins of local minima in the gray valued input image. A local minimum is a connected plateau of points from which it is impossible to reach a point of lower gray value without first climbing up to higher gray values. A catchment basin of a local minimum is a connected component which contains that minimum and all downstream points to it. A downstream is a path of points along which gray values are monotonically descending. Thus all catchment basins of local minima are expanded until they collide with another catchment basins. At those point barriers (watersheds) are built up. The output image is binary and contains all watersheds. If the "Basins" flag is set, the catchment basins themselves are in the output image as uniquely labeled connected components without any border lines.

Grey Reconstruction

Works mainly as an iterated dilation (Dilate class) of the image, but with a constraint image as a second input image. After every dilation step the pixel wise minimum of the dilated image and the constraint image is computed and gives the next image to be dilated. The computation stops automatically when all the just dilated pixels are bigger than the corresponding ones in the constraint image.

Parameters

Parameter

Description

Structure Element

Here you select the desired structure element. Following elements are available: Horizontal, Diagonal 45°, Vertical, Diagonal 135°, Cross, Square, Octagon.

Count

Here you can adjust the number of repetitions to define the size of the structure element.

Binary

Only available for the Erode, Dilate, Open and Close function.

Activated: Increases calculation speed by creating a binary image before the morphology operation is applied. The resulting image contains black or white pixels instead of gray values.

Deactivated: Applies the morphology operation to a gray scale image. The results are finer graded compared to the results of the morphology operation applied to a binary image.