Class SoLabelingProcessing

  • All Implemented Interfaces:

    public class SoLabelingProcessing
    extends SoImageVizEngine
    SoLabelingProcessing engine. The SoLabelingProcessing engine labels objects of a binary image.

    In this engine, the image is scanned from top to bottom and left to right. Each pixel of the same object takes the same value, and each object is assigned to a different value, starting from value 1. The assigned gray level depends on the location of the object in the image. The maximum gray level value gives the total number of objects in the original binary image. The algorithm works in three steps:

    • The first scan detects the start of each object.
    • The second scan gives the same gray level to all the pixels belonging to the same object.
    • The third optional scan checks that there is no hole in the numbers, i.e. that all objects have consecutive indices.

    A label image may be 16 or 32 bits per pixel. By default it is 2 bytes per pixel, but if the number of labels exceeds 65,535 then the output image is automatically converted to 4 bytes and then can manage more than 2 billion labels.

    File format/default:

    LabelingProcessing {

      computeMode MODE_AUTO
      neighborhood3d CONNECTIVITY_26
      inObjectImage NULL

    Library references: label