Class SoTopHatProcessing

  • All Implemented Interfaces:

    public class SoTopHatProcessing
    extends SoImageVizEngine
    As of Open Inventor 2023.2. ImageViz API is replaced by the new ImageDev toolkit.
    SoTopHatProcessing image filter. The SoTopHatProcessing engine performs a Top-Hat algorithm on a gray level image.

    The Top-Hat segmentation extracts small elements and details from given images. It detects the dark or the bright area, corresponding to the valleys or the narrow peaks. There exist two types of Top-Hat transform:

    • The Black Top-Hat: it is defined as the difference between the closing with a particular kernel and the input image. The smaller is the kernel, the smaller are the elements in the Top-Hat image. A threshold allows selecting the darker elements of the Top-Hat result, i.e., the depth of the selected valleys. See Figure 1.
    • The White Top-Hat: it is defined as the difference between the input image and its opening (using a particular kernel). The threshold allows selecting the brighter elements of the Top-Hat result.

    Figure 1: Black Top-Hat computation The Top-Hat module is divided into two phases:

    • The Top-Hat image computation, depending on the Top-Hat type and the closing/opening parameters; (step 1 and 2 on figure 1)
    • The Thresholding, to select the valleys/narrow peaks depth. (step 3 on figure 1)

    The SoTopHatProcessing engine also includes a rough and a smooth mode. Whereas the rough mode uses a standard structuring element, the smooth mode employs a more sophisticated volumic structuring element, a rhombodecahedron, which usually generates a much more precise Top-Hat.

    File format/default:

    TopHatProcessing {

      computeMode MODE_AUTO
      elementShape ROUGH
      inGrayImage NULL
      elementSize 3
      objectLightness BRIGHT_OBJECTS
      thresholdLevel 128.0f 255.0f

    Library references: high_tophat tophat

    • Field Detail

      • inGrayImage

        public final SoSFImageDataAdapter inGrayImage
        Input grey level image. Default value is NULL. Supported types include: grayscale binary label image.
      • elementSize

        public final SoSFInt32 elementSize
        The half size of the structuring element. A structuring element always has an odd side length (3x3, 5x5, etc) which is defined by 2 * elementSize + 1. Default value is 3.
      • thresholdLevel

        public final SoSFVec2f thresholdLevel
        The low and high threshold levels. Default value is SbVec2f(128.0f,255.0f).
    • Constructor Detail

      • SoTopHatProcessing

        public SoTopHatProcessing()