Into

Modules

Documentation

classPiiQuantizerOperation

#include <PiiQuantizerOperation.h>

Quantizes any numeric matrix to discrete levels.

Inherits PiiDefaultOperation

Description

Inputs

imageinput image. Any numeric matrix.

Outputs

imageinput image quantized to discrete levels. PiiMatrix<int>.

Properties

int

The number of quantization levels (for training).

QVariantList

Quantization limits.

double

selectionProbability description

bool

training description

int

trainingPixels description

Constructors and destructor

Public member functions

virtual void
(
  • bool reset
)

Checks the operation for execution.

int
( )
QVariantList
( )
double
void
(
  • int levels
)
void
(
  • const QVariantList & limits
)
void
(
  • double selectionProbability
)
void
(
  • bool training
)
void
(
  • int trainingPixels
)
bool
int

Protected member functions

virtual void

Executes one round of processing.

Property details

  • int levels

    [read, write]

    The number of quantization levels (for training).

    This value has no effect is limits are manually set. If limits are learned, this value specifies the number of quantization levels. The default is 16.

  • QVariantList limits

    [read, write]

    Quantization limits.

    Limits must be represented as a monotonically increasing series of double values. The number of quantization levels equals to limit.size() + 1. See PiiQuantizer for details.

  • double selectionProbability

    [read, write]

    selectionProbability description

  • bool training

    [read, write]

    training description

  • int trainingPixels

    [read, write]

    trainingPixels description

Function details

  • PiiQuantizerOperation

    ()
  • ~PiiQuantizerOperation

    ()
  • virtual void check

    (
    • bool reset
    )
    [virtual]

    Checks the operation for execution.

    This function creates a suitable flow controller by calling createFlowController(). It then sets the flow controller to the active processor and sets the processor as the input controller for all inputs.

    If you change socket groupings in your overridden implementation, please call PiiDefaultOperation::check() after that. Otherwise, your new groupings will not be in effect.

    Reimplemented from PiiDefaultOperation.

  • int levels

    ()
  • QVariantList limits

    ()
  • double selectionProbability

    ()
  • void setLevels

    (
    • int levels
    )
  • void setLimits

    (
    • const QVariantList & limits
    )
  • void setSelectionProbability

    (
    • double selectionProbability
    )
  • void setTraining

    (
    • bool training
    )
  • void setTrainingPixels

    (
    • int trainingPixels
    )
  • bool training

    ()
  • int trainingPixels

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