Package com.openinventor.imageviz.engines.mathematicalmorphology

The Mathematical Morphology is a theory for the analysis of geometrical structures. Morphology is based on the use of set operators (intersection, union, inclusion, complement) to transform an image. The transformed image has usually fewer details, implying a loss of information, but its main characteristics are still present. Once an image has been simplified by morphological processing, measurements can be computed to give a quantitative analysis of the image.

The basic morphological operators are either erosions or dilations. ImageViz supports several types of erosions and dilations such as: SoErosionCubeProcessing, SoErosionLineProcessing2d, SoErosionDiskProcessing2d and SoErosionSquareColorProcessing2d and SoDilationCubeProcessing, SoDilationLineProcessing2d, SoDilationDiskProcessing2d and SoDilationSquareColorProcessing2d.

Structuring Elements

Morphological transformation is based on a structuring element (B) characterized by shape, size and location of its center. Each pixel in an image is compared with B by moving B so that its center hits the pixel. Depending on the type of morphological transformation, the pixel value is reset to the value or average value of one or more of its neighbors.

There are two types of morphological transformations: regular and recursive. In a regular morphological transformation, the structuring element examines the pixel values in the original image to establish the new pixel value. In a recursive morphological transformation, the new values established by the structuring element are affected by the previously changed values. Regular morphological transformations are obviously more accurate, but require more time to compute.

2D image

On a square grid, a point may have 8 neighbors, in which case a basic structuring element is a square. Alternatively, a point may have 4 neighbors, and a basic structuring element is then a cross:

Figure 1: Structuring elements3D image

The central voxel (in red) may have 26 neighbors, and a basic structuring element is a cube. Alternatively a point may have 6 neighbors (voxels in green), and a basic structuring element is then a cross. A point may also have 18 neighbors.

Figure 2Figure 3: Structuring elements Type of connectivity

For engines supporting several connectivity types, the neighbor configuration can be set thanks to the neighborhood3d field (e.g., SoDilationCubeProcessing).