firevision::RhtLinesModel Class Reference

Randomized Hough-Transform line model. More...

#include <models/shape/rht_lines.h>

Inheritance diagram for firevision::RhtLinesModel:

[legend]
List of all members.

Public Member Functions

 RhtLinesModel (float max_time=0.005, int max_iter=1000, unsigned int nr_candidates=40, float angle_from=0, float angle_range=2 *M_PI, int r_scale=1, float min_votes_ratio=0.2f, int min_votes=-1)
 Constructor.
virtual ~RhtLinesModel (void)
 Destructor.
std::string getName (void) const
 Get name of shape model.
int parseImage (unsigned char *buffer, ROI *roi)
 Parse image for given ROI.
int getShapeCount (void) const
 Get number of shapes.
LineShapegetShape (int id) const
 Get specific shape.
LineShapegetMostLikelyShape (void) const
 Get best candidate.
std::vector< LineShape > * getShapes ()
 Get shapes.

Detailed Description

Randomized Hough-Transform line model.

Definition at line 43 of file rht_lines.h.


Constructor & Destructor Documentation

firevision::RhtLinesModel::RhtLinesModel ( float  max_time = 0.005,
int  max_iter = 1000,
unsigned int  nr_candidates = 40,
float  angle_from = 0,
float  angle_range = 2 *M_PI,
int  r_scale = 1,
float  min_votes_ratio = 0.2f,
int  min_votes = -1 
)

Constructor.

Parameters:
max_time the maximum runtime of a single parseImage call in seconds, if you set max_iter to a small number this time may not be used completely
max_iter the maximum number of iterations one parseImage will do, if you set max_time to a short time this number may not be reached
nr_candidates the nr of candidates that is considered per pixel (the hole angle range is devided in this many parts/lines
angle_from The angle to start the candidates from, given in rad, 0 is straight up
angle_range the angle range the candidates are taken from starting at angle_from, given in rad, can be used for example to only search for horizontal lines
r_scale This can be done to reduce the size of the hough space and to map more lines to one line
min_votes_ratio The minimum ratio num_votes_per_line/total_num_votes that we have to have before a point in the hough space is considered to be a line, this may actually be higher if you use min_votes and set it to a higher number (set min_votes to 0 to only use min_votes_ration)
min_votes the minimum number of votes a point in the hough space has to have before it is considered to be a line. The number may actually be higher if min_votes_ratio is set too high (set min_votes_ration to 0 to use only min_votes)

Definition at line 45 of file rht_lines.cpp.

firevision::RhtLinesModel::~RhtLinesModel ( void   )  [virtual]

Destructor.

Definition at line 64 of file rht_lines.cpp.


Member Function Documentation

LineShape * firevision::RhtLinesModel::getMostLikelyShape ( void   )  const [virtual]

Get best candidate.

Returns:
best candidate shape, do not free.

Implements firevision::ShapeModel.

Definition at line 188 of file rht_lines.cpp.

std::string firevision::RhtLinesModel::getName ( void   )  const [inline, virtual]

Get name of shape model.

Returns:
name of shape model.

Implements firevision::ShapeModel.

Definition at line 74 of file rht_lines.h.

LineShape * firevision::RhtLinesModel::getShape ( int  id  )  const [virtual]

Get specific shape.

Parameters:
id shape ID
Returns:
shape, do NOT free!

Implements firevision::ShapeModel.

Definition at line 177 of file rht_lines.cpp.

int firevision::RhtLinesModel::getShapeCount ( void   )  const [virtual]

Get number of shapes.

Returns:
number of shapes.

Implements firevision::ShapeModel.

Definition at line 171 of file rht_lines.cpp.

vector< LineShape > * firevision::RhtLinesModel::getShapes (  ) 

Get shapes.

Returns:
vector of shapes

Definition at line 210 of file rht_lines.cpp.

References firevision::LineShape::calcPoints(), firevision::LineShape::count, firevision::RhtAccumulator::getNodes(), firevision::RhtAccumulator::getNumVotes(), firevision::LineShape::phi, and firevision::LineShape::r.

int firevision::RhtLinesModel::parseImage ( unsigned char *  buffer,
ROI roi 
) [virtual]

Parse image for given ROI.

Parameters:
buffer image buffer
roi ROI
Returns:
number of shapes found

Implements firevision::ShapeModel.

Definition at line 73 of file rht_lines.cpp.

References firevision::RhtAccumulator::accumulate(), firevision::LineShape::count, firevision::ROI::get_roi_buffer_start(), firevision::RhtAccumulator::getMax(), firevision::ROI::height, firevision::ROI::line_step, firevision::LineShape::phi, firevision::LineShape::r, fawkes::rad2deg(), firevision::RhtAccumulator::reset(), firevision::ROI::width, fawkes::point_t::x, and fawkes::point_t::y.


The documentation for this class was generated from the following files:
Generated on Tue Feb 22 13:33:04 2011 for Fawkes API by  doxygen 1.4.7