Into

Modules

Documentation

classPiiHoughTransformOperation

#include <PiiHoughTransformOperation.h>

Operation interface for Hough transform.

Inherits PiiDefaultOperation

Description

Hough transform is a technique which can be used to find imperfect instances of objects within a certain class of shapes by a voting procedure.

This voting procedure is carried out in a parameter space, from which object candidates are obtained as local maxima in a so-called accumulator space that is explicitly constructed by the choosed algorithm (for computing the Hough transform).

Classical Hough transform is concerned with the identification of lines in the image, but Hough transform has been extended to identifying positions of arbitrary shapes, most commonly circles or ellipses.

At the moment only linear Hough transform is implemented.

Inputs

imagean image to be transformed. Typically, the input image is binary, but any gray-level image can be used. All non-zero values in the input image will add to the transform. Higher values have higher weight.

Outputs

accumulatorthe accumulator array. See PiiTransforms::linearHough() for detailed information.
peaksdetected peaks in the transformation domain. The output value is a PiiMatrix<double> with at most peakCount rows. Each row stores the location of a peak , where d is the distance to the center of the image and is the slope of the line. If there are less than peakCount peaks, the number of rows in the matrix matches the number of peaks found. The rows of the matrix are ordered so that the highest peak comes first.
coordinatesa PiiMatrix<double> containing the locations of located geometric objects in the input image. peakCount highest peaks in the transformation domain are considered. With the linear Hough transform, the matric has 4 columns containing the begin and end points of a detected line (x1, y1, x2, y2). This ouput can be directly connected to the property input of PiiImageAnnotator.

Classes

struct
struct

Properties

double

The angleResolution defines number of degrees each column represents.

double

The distanceResolution defines distance (in number of pixels) what each row represents in the result matrix.

int

endAngle description

int

endDistance description

int

The number of highest peaks detected in the accumulator.

int

startAngle description

int

startDistance description

The transformType defines which kind Hough transform is done to input image.

Public types

enum
{ Linear, Circle }

Supported Hough transform types.

Constructors and destructor

virtual

Public member functions

double
virtual void
(
  • bool reset
)

Checks the operation for execution.

double
int
int
int
void
(
  • double resolution
)
void
(
  • double resolution
)
void
(
  • int endAngle
)
void
(
  • int endDistance
)
void
(
  • int value
)
void
(
  • int startAngle
)
void
(
  • int startDistance
)
void
int
int

Protected member functions

virtual void

Executes one round of processing.

Property details

  • double angleResolution

    [read, write]

    The angleResolution defines number of degrees each column represents.

    The default value is 1.0 which produces 180 columns in the result matrix.

  • double distanceResolution

    [read, write]

    The distanceResolution defines distance (in number of pixels) what each row represents in the result matrix.

    Default value is 1.0

  • int endAngle

    [read, write]

    endAngle description

  • int endDistance

    [read, write]

    endDistance description

  • int peakCount

    [read, write]

    The number of highest peaks detected in the accumulator.

  • int startAngle

    [read, write]

    startAngle description

  • int startDistance

    [read, write]

    startDistance description

  • TransformType type

    [read, write]

    The transformType defines which kind Hough transform is done to input image.

    Default type is Linear.

Enumeration details

  • enum TransformType

    Supported Hough transform types.

    • Linear - a linear Hough transform (searches lines from in input image). Circle - a circle Hough transform (searches circles in input image).

    Circle is not yet implemented.

Function details

  • PiiHoughTransformOperation

    ()
  • virtual ~PiiHoughTransformOperation

    ()
    [virtual]
  • double angleResolution

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

  • double distanceResolution

    ()
  • int endAngle

    ()
  • int endDistance

    ()
  • int peakCount

    ()
  • void setAngleResolution

    (
    • double resolution
    )
  • void setDistanceResolution

    (
    • double resolution
    )
  • void setEndAngle

    (
    • int endAngle
    )
  • void setEndDistance

    (
    • int endDistance
    )
  • void setPeakCount

    (
    • int value
    )
  • void setStartAngle

    (
    • int startAngle
    )
  • void setStartDistance

    (
    • int startDistance
    )
  • void setTransform

    ( )
  • int startAngle

    ()
  • int startDistance

    ()
  • TransformType transform

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