Fawkes API  Fawkes Development Version
HoughTransform Class Reference

Hough Transformation for N-dimensional representations. More...

#include "hough_transform.h"

Public Member Functions

 HoughTransform (unsigned int num_dims)
 Constructor. More...
 
 ~HoughTransform ()
 Destructor. More...
 
void process (int **values, unsigned int num_values)
 Process some samples. More...
 
unsigned int max (int *values) const
 Get maximum values. More...
 
unsigned int filter (int **values, unsigned int min_count)
 Filter values by number of votes. More...
 
void reset ()
 Reset Hough transform. More...
 
Node * root ()
 Get root node. More...
 
Node * create_node (Node *parent, unsigned int dims, int value=0)
 Create a new node. More...
 

Detailed Description

Hough Transformation for N-dimensional representations.

This class implements a generic Hough transformation, which can operate on representations of arbitrary dimension (at least in theory ignoring computational feasibility). The implementation uses a tree structure to represent the buckets in the Hough space, to reduce the amount of memory required on sparse data sets and to allow fast insertion of new samples. The code is based on ideas from a Hough transform implemented in FireVision, but eliminating some of its limitations.

Author
Tim Niemueller

Definition at line 28 of file hough_transform.h.

Constructor & Destructor Documentation

HoughTransform::HoughTransform ( unsigned int  num_dims)

Constructor.

Parameters
num_dimsnumber of dimensions

Definition at line 53 of file hough_transform.cpp.

HoughTransform::~HoughTransform ( )

Destructor.

Definition at line 68 of file hough_transform.cpp.

Member Function Documentation

Node * HoughTransform::create_node ( Node *  parent,
unsigned int  dims,
int  value = 0 
)
inline

Create a new node.

Parameters
parentparent node of the new node
dimsDimensions remaining
valueinitial value
Returns
new node with given parent, dimensions, and initial value

Definition at line 89 of file hough_transform.h.

Referenced by reset().

unsigned int HoughTransform::filter ( int **  values,
unsigned int  min_count 
)

Filter values by number of votes.

This method filters all created buckets and returns only the ones which have at least min_count votes

Parameters
valuesupon return points to a newly allocated array of values with the size of number of values * number of dimensions. The memory must be freed when done by using free().
min_countminimum number of votes required to consider a bucket
Returns
number of values found

Definition at line 127 of file hough_transform.cpp.

Referenced by reset().

unsigned int HoughTransform::max ( int *  values) const

Get maximum values.

During processing the maximum values, i.e. the candidate with the maximum number of votes or the most filled bucket, is stored and can be retrieved with this method.

Parameters
valuesupon return contains the maximum voted values
Returns
number of votes of the values

Definition at line 108 of file hough_transform.cpp.

Referenced by LaserHtSensorProcThread::loop().

void HoughTransform::process ( int **  values,
unsigned int  num_values 
)

Process some samples.

Parameters
valuestwo dimensional array of values. The first index determines the sample index, the second index the dimension index. Thus its an array with the length of number of values of arrays with the length of the number of dimensions.
num_valuesnumber of rows in values

Definition at line 87 of file hough_transform.cpp.

Referenced by LaserHtSensorProcThread::loop().

void HoughTransform::reset ( void  )

Reset Hough transform.

This deletes the internal tree and creates a new empty one.

Definition at line 146 of file hough_transform.cpp.

References create_node(), and filter().

Referenced by LaserHtSensorProcThread::loop().

HoughTransform::Node * HoughTransform::root ( )

Get root node.

Returns
root node of internal tree, meant for debugging and performance evaluation

Definition at line 138 of file hough_transform.cpp.


The documentation for this class was generated from the following files: