Package com.openinventor.imageviz.engines.mathematicalmorphology
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
.
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.
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:
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.
Type of connectivity
For engines supporting several connectivity types, the neighbor configuration can be set thanks to the neighborhood3d field (e.g., SoDilationCubeProcessing
).