Into

Modules

Documentation

classPiiColorPercentiles

#include <PiiColorPercentiles.h>

An operation that calculates percentiles from color histograms.

Inherits PiiDefaultOperation

Description

Inputs

imagea color image the percentiles are extracted from. Accepts all image types. For gray-scale images, the color channels are ignored. For example, the 90% percentile for any color channel (R:90, B:90, G:90) is the same.
roiregion-of-interest. See PiiRoi for a description. Optional.

Outputs

featuresa feature vector that contains the extracted percentiles in the defined order. (PiiMatrix<int>)

Properties

Set a type of the feature set.

int

The number of quantization levels for the input images.

The extracted percentiles as a list of strings.

Set a prebuilt feature set.

The type or the roi input, if connected.

Set an universal feature set.

Public types

enum
{ Universal, Prebuilt, Custom }

Possible choices for a feature set.

enum
{ WoodDefectDetection, WoodDefectRecognition }

An enumeration for prebuilt sets of RGB percentiles.

enum
{ Absolute10, Absolute20, Absolute30, Difference10, Difference20, Difference30, Absolute10R, Absolute20R, Absolute30R, Difference10R, Difference20R, Difference30R, Absolute10G, Absolute20G, Absolute30G, Difference10G, Difference20G, Difference30G, Absolute10B, Absolute20B, Absolute30B, Difference10B, Difference20B, Difference30B }

Universal sets percentiles.

Constructors and destructor

Protected member functions

virtual void

Called by setState() just before the operation changes to a new state.

virtual void
(
  • bool reset
)

Checks the operation for execution.

int
( )
virtual void

Executes one round of processing.

void
void
(
  • int levels
)
void
( )
void
void
void

Property details

  • FeatureSetType featureSetType

    [read, write]

    Set a type of the feature set.

  • int levels

    [read, write]

    The number of quantization levels for the input images.

    If a non-positive number is given, the maximum value of the image/color channel is found and used (after adding one). For 8 bit gray-scale images, use 256. The default value is 256.

  • QStringList percentiles

    [read, write]

    The extracted percentiles as a list of strings.

    The format for each percentile is C:P[-C:P], where C is the color channel (R, G, or B, or more generally 0-2), and P is the percentile value as an integer in the range 0-100. R:50 and 0:50 both denote the 50% percentile of the red color channel.

    Optionally, a difference of percentiles may be used. For example, R:99-G:1 means the difference between the 99% percentile of red and the 1% percentile of green.

    The feature vector emitted by the operation contains the given percentiles in the defined order.

  • PrebuiltFeatureSet prebuiltFeatureSet

    [read, write]

    Set a prebuilt feature set.

  • PiiImage::RoiType roiType

    [read, write]

    The type or the roi input, if connected.

    The default value is AutoRoi.

  • UniversalFeatureSet universalFeatureSet

    [read, write]

    Set an universal feature set.

Enumeration details

  • enum FeatureSetType

    Possible choices for a feature set.

    • Universal - uniformly sampled percentiles, either absolute or differential.

    • Prebuilt - prebuilt application-specific sets.

    • Custom - user-defined custom percentiles (see percentiles).

  • enum PrebuiltFeatureSet

    An enumeration for prebuilt sets of RGB percentiles.

    • WoodDefectDetection - 13 percentiles for defect detection in wood inspection.

    • WoodDefectRecognition - 15 percentiles for defect recognition (classification) in wood inspection

  • enum UniversalFeatureSet

    Universal sets percentiles.

    • Absolute10 - absolute differences from each color channels in 10 percentage unit steps (10, 20, ..., 90). 27 percentiles in total.

    • Absolute20 - absolute differences from each color channels in 20 percentage unit steps (20, 40, 60, 80). 12 percentiles in total.

    • Absolute30 - absolute differences from each color channels in 30 percentage unit steps (30, 60, 90). 9 percentiles in total.

    • Difference10 - intra-channel percentile differences for each color channel in 10 percentage unit steps. (10-1, 20-1, ..., 90-1). 27 percentiles in total.

    • Difference20 - intra-channel percentile differences for each color channel in 20 percentage unit steps. (20-10, 40-10, 60-10, 80-10). 12 percentiles in total.

    • Difference30 - intra-channel percentile differences for each color channel in 30 percentage unit steps. (30-10, 60-10, 90-10). 9 percentiles in total.

    • {Absolute,Difference}[123]0[RGB] (e.g. Absolute10G or Difference30B) - one-channel versions of the above. Percentiles are calculated from the specified color channel only. The length of the feature vector is one third of the corresponding three-channel version. These features are useful for gray-scale images and when one needs to discard two of the color channels.

Function details

  • PiiColorPercentiles

    ()
  • ~PiiColorPercentiles

    ()
  • virtual void aboutToChangeState

    ( )
    [protected, virtual]

    Called by setState() just before the operation changes to a new state.

    The function will be called independent of the cause of the state change (internal or external). Derived classes may implement this function to perform whatever functionality is needed when a state changes. The default implementation does nothing.

    Reimplemented from PiiBasicOperation.

  • virtual void check

    (
    • bool reset
    )
    [protected, 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.

  • FeatureSetType featureSetType

    ()
    [protected]
  • int levels

    ()
    [protected]
  • QStringList percentiles

    ()
    [protected]
  • PrebuiltFeatureSet prebuiltFeatureSet

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

  • PiiImage::RoiType roiType

    ()
    [protected]
  • void setFeatureSetType

    ( )
    [protected]
  • void setLevels

    (
    • int levels
    )
    [protected]
  • void setPercentiles

    ( )
    [protected]
  • void setPrebuiltFeatureSet

    ( )
    [protected]
  • void setRoiType

    ( )
    [protected]
  • void setUniversalFeatureSet

    ( )
    [protected]
  • UniversalFeatureSet universalFeatureSet

    ()
    [protected]
Notes (0)

Add a note

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