Into

Modules

Documentation

classPiiBoundaryFinderOperation

#include <PiiBoundaryFinderOperation.h>

Extracts boundaries of connected objects in images.

Inherits PiiDefaultOperation

Description

Inputs

imageinput image. This is usually a binary image or a labeled image, but any gray-level image works. To avoid a separate thresholding step one can set the threshold property to a non-zero value.

Outputs

boundary0-N polygons that contain the boundaries of the detected objects. Each polygon is represented as a M-by-2 PiiMatrix<int> in which each row stores stores the (x,y) coordinates of a boundary point in the order the algorithm traversed the boundary. The flow level of this output is one higher than the image input.
boundariesall boundaries extracted from the input image concatenated to one matrix.
limitsthe indices of boundary polygon ends (PiiMatrix<int>). The first vector is always at index 0, and the first limit is the index of the start row of the second one. If the first polygon has 120 points and the second one 90 points, limits will be the 1-by-2 matrix (120, 210).
maskboundary mask. A gray-level image in which the detected edges are marked according to their type. See PiiBoundaryFinder for an explanation.

Properties

int

The maximum number of connected pixels allowed to form a boundary.

int

The minimum number of connected pixels required to form a boundary.

double

A static threshold for binarizing a gray-level input image.

Constructors and destructor

Protected member functions

int
int
virtual void

Executes one round of processing.

void
(
  • int maxLength
)
void
(
  • int minLength
)
void
(
  • double threshold
)
double

Property details

  • int maxLength

    [read, write]

    The maximum number of connected pixels allowed to form a boundary.

    If a detected boundary has more pixels, it will be discarded.

  • int minLength

    [read, write]

    The minimum number of connected pixels required to form a boundary.

    If a detected boundary has less pixels, it will be discarded.

  • double threshold

    [read, write]

    A static threshold for binarizing a gray-level input image.

    Every pixel in the image whose gray level is higher than threshold is taken to be part of an object. The default value is zero, which assumes a pre-binarized or labeled input image. Setting this value to a non-zero value may be useful in avoiding a separate thresholding step.

Function details

  • PiiBoundaryFinderOperation

    ()
  • int maxLength

    ()
    [protected]
  • int minLength

    ()
    [protected]
  • 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.

  • void setMaxLength

    (
    • int maxLength
    )
    [protected]
  • void setMinLength

    (
    • int minLength
    )
    [protected]
  • void setThreshold

    (
    • double threshold
    )
    [protected]
  • double threshold

    ()
    [protected]
Notes (0)

Add a note

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