Fawkes API
Fawkes Development Version
|
Hough Transformation for N-dimensional representations. More...
#include "hough_transform.h"
Classes | |
class | Node |
Hough transform tree node. More... | |
Public Member Functions | |
HoughTransform (unsigned int num_dims) | |
Constructor. | |
~HoughTransform () | |
Destructor. | |
void | process (int **values, unsigned int num_values) |
Process some samples. | |
unsigned int | max (int *values) const |
Get maximum values. | |
unsigned int | filter (int **values, unsigned int min_count) |
Filter values by number of votes. | |
void | reset () |
Reset Hough transform. | |
Node * | root () |
Get root node. | |
Node * | create_node (Node *parent, unsigned int dims, int value=0) |
Create a new node. |
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.
HoughTransform::HoughTransform | ( | unsigned int | num_dims | ) |
Constructor.
num_dims | number of dimensions |
Definition at line 53 of file hough_transform.cpp.
HoughTransform::~HoughTransform | ( | ) |
Destructor.
Definition at line 68 of file hough_transform.cpp.
Create a new node.
parent | parent node of the new node |
dims | Dimensions remaining |
value | 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
values | upon 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_count | minimum number of votes required to consider a bucket |
Definition at line 127 of file hough_transform.cpp.
References HoughTransform::Node::filter().
Referenced by HoughTransform::Node::filter().
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.
values | upon return contains the maximum voted values |
Definition at line 108 of file hough_transform.cpp.
Referenced by HoughTransform::Node::depth(), and LaserHtSensorProcThread::loop().
void HoughTransform::process | ( | int ** | values, |
unsigned int | num_values | ||
) |
Process some samples.
values | two 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_values | number of rows in values |
Definition at line 87 of file hough_transform.cpp.
References HoughTransform::Node::insert().
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().
Referenced by LaserHtSensorProcThread::loop().
HoughTransform::Node * HoughTransform::root | ( | ) |
Get root node.
Definition at line 138 of file hough_transform.cpp.