Into

Modules

Documentation

classPiiOrientationEstimator

#include <PiiOrientationEstimator.h>

An operation that estimates the orientation of texture.

Inherits PiiDefaultOperation

Description

For each input image, an orientation histogram is calculated. The number of quantization levels can be set by the angles property.

Inputs

imageinput image. Any gray level or color image.

Outputs

histogramorientation histogram. Prominent peaks mean prominent orientations. Each bin in the histogram denotes the strength of texture orientation at a certain discrete angle. Note that the orientation histogram represents the direction of image gradient or "slope". A gradient pointing at 135 degrees means an oriented element pointing at 45 or 225 degrees. To get texture orientation instead of gradient direction, set the rotateHistogram flag to true. (PiiMatrix<float>)

Properties

int

The number of quantization levels for the orientation angle.

The type of orientation estimation.

bool

Output normalization.

bool

Rotate the orientation histogram by 90 degrees.

Public types

enum
{ Gradient, UnidirectionalGradient, Fourier }

Different ways of estimating texture orientation.

Constructors and destructor

Public member functions

virtual void
(
  • bool reset
)

Checks the operation for execution.

Protected member functions

int
( )
bool
virtual void

Executes one round of processing.

bool
void
(
  • int angles
)
void
void
(
  • bool normalize
)
void
(
  • bool rotateHistogram
)

Property details

  • int angles

    [read, write]

    The number of quantization levels for the orientation angle.

    The default value is 180. This number defines the length of the orientation histogram. Note that it is not possible to use the full circle with the FFT. Only the gradient-based estimator can also measure "slope direction". For the gradient-based estimator, the default quantization step is thus 360/180 = 2 degrees. For other estimators, the default value means 1 degree accuracy.

  • EstimationType estimationType

    [read, write]

    The type of orientation estimation.

    Different methods have different strengths and weaknesses. The default is UnidirectionalGradient.

  • bool normalized

    [read, write]

    Output normalization.

    If set to true (the default), the output histogram will always sum up to unity. Otherwise, the sum depends on input image size, gradient magnitudes etc.

  • bool rotateHistogram

    [read, write]

    Rotate the orientation histogram by 90 degrees.

    This effectively gives you the texture orientation instead of gradient direction. The default value is false.

Enumeration details

  • enum EstimationType

    Different ways of estimating texture orientation.

    • Gradient - local gradient based method. Works well in most cases, especially within small image windows. Faster than the Fourier-based technique. The gradient method separates orientations pointing to opposite directions and thus measures orientation over a full circle.

    • UnidirectionalGradient - same as Gradient, but combines orientations pointing to opposite directions, thus using only half of the orientation circle.

    • Fourier - Fourier transform based method. Captures weak repeating structures better than the gradient method. Typically requires larger samples than Gradient and is somewhat slower.

Function details

  • PiiOrientationEstimator

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

    ()
    [protected]
  • EstimationType estimationType

    ()
    [protected]
  • bool normalized

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

  • bool rotateHistogram

    ()
    [protected]
  • void setAngles

    (
    • int angles
    )
    [protected]
  • void setEstimationType

    ( )
    [protected]
  • void setNormalized

    (
    • bool normalize
    )
    [protected]
  • void setRotateHistogram

    (
    • bool rotateHistogram
    )
    [protected]
Notes (0)

Add a note

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