Into

Modules

Documentation

classPiiLabelingOperation

#include <PiiLabelingOperation.h>

Basic labeling operations.

Inherits PiiDefaultOperation

Description

Inputs

imagethe input image. Binary image. If the image is not binary, it will be automatically thresholded. (Any gray-level image type.)

Outputs

imagethe labeled image. A PiiMatrix<int> type in which objects are marked with increasing ordinal numbers 1,2,...,N. The background will be zero.
labelsthe number of distinct objects in the input image. (int)

Properties

Connectivity type for labeling.

double

A hysteresis for the thresholding.

bool

A flag that can be used to invert the automatic thresholding.

double

A static threshold value for automatic thresholding.

Constructors and destructor

Public member functions

double
bool
void
void
(
  • double hysteresis
)
void
(
  • bool inverse
)
void
(
  • double threshold
)
double

Protected member functions

virtual void

Executes one round of processing.

Property details

  • PiiImage::Connectivity connectivity

    [read, write]

    Connectivity type for labeling.

    The default is Connect4.

  • double hysteresis

    [read, write]

    A hysteresis for the thresholding.

    If this value is non-zero, threshold will decide the minimum value for a gray level that can be a "seed" for a connected object. A all pixels surrounding the seed that are brighter than threshold - hysteresis are joined to the connected component.

  • bool inverse

    [read, write]

    A flag that can be used to invert the automatic thresholding.

    If this value is set to true, dark objects will be considered targets. The default value is false.

  • double threshold

    [read, write]

    A static threshold value for automatic thresholding.

    Every pixel whose gray level is higher than this value will be considered an object. The default value is zero.

Function details

  • PiiLabelingOperation

    ()
  • PiiImage::Connectivity connectivity

    ()
  • double hysteresis

    ()
  • bool inverse

    ()
  • void setConnectivity

    ( )
  • void setHysteresis

    (
    • double hysteresis
    )
  • void setInverse

    (
    • bool inverse
    )
  • void setThreshold

    (
    • double threshold
    )
  • double threshold

    ()
  • virtual void process

    ()
    [protected, virtual]

    Executes one round of processing.

    This function is invoked by the processor if the necessary preconditions for a new processing round are met. This function does all the necessary calculations to create output objects and sends them to output sockets.

    Calls to process(), syncEvent(), and setProperty() are synchronized and cannot occur simultaneously. PiiDefaultOperation ensures this by locking processLock() for reading before calling process().

    Note: With time-consuming operations, one should occasionally check that the operation hasn't been interrupted, i.e. that state() returns Running.

    Exceptions
    PiiExecutionException

    whenever an unrecoverable error occurs during a processing round, the operation is interrupted, or finishes execution due to end of input data.

    Reimplemented from PiiDefaultOperation.

Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.