Fawkes API Fawkes Development Version
firevision::HtLinesModel Class Reference

Hough-Transform line matcher. More...

#include <>>

Inheritance diagram for firevision::HtLinesModel:

Public Member Functions

 HtLinesModel (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. More...
 
virtual ~HtLinesModel (void)
 Destructor. More...
 
std::string getName (void) const
 Get name of shape model. More...
 
int parseImage (unsigned char *buffer, ROI *roi)
 Parse image for given ROI. More...
 
int getShapeCount (void) const
 Get number of shapes. More...
 
LineShapegetShape (int id) const
 Get specific shape. More...
 
LineShapegetMostLikelyShape (void) const
 Get best candidate. More...
 
std::vector< LineShape > * getShapes ()
 Get all lines found. More...
 
- Public Member Functions inherited from firevision::ShapeModel
virtual ~ShapeModel ()
 Virtual empty destructor. More...
 
virtual std::string getName (void) const =0
 Get name of shape model. More...
 
virtual int parseImage (unsigned char *buffer, ROI *roi)=0
 Parse image for given ROI. More...
 
virtual int getShapeCount (void) const =0
 Get number of shapes. More...
 
virtual ShapegetShape (int id) const =0
 Get specific shape. More...
 
virtual ShapegetMostLikelyShape (void) const =0
 Get best candidate. More...
 

Detailed Description

Hough-Transform line matcher.

Definition at line 40 of file ht_lines.h.

Constructor & Destructor Documentation

◆ HtLinesModel()

firevision::HtLinesModel::HtLinesModel ( 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.

Creates a new HtLinesModel instance

Parameters
nr_candidatesthe nr of candidates that is considered per pixel (the hole angle range is devided in this many parts/lines
angle_fromThe angle to start the candidates from, given in rad, 0 is straight up
angle_rangethe 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_scaleThis can be done to reduce the size of the hough space and to map more lines to one line
min_votes_ratioThe 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_votesthe 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 60 of file ht_lines.cpp.

◆ ~HtLinesModel()

firevision::HtLinesModel::~HtLinesModel ( void  )
virtual

Destructor.

Definition at line 80 of file ht_lines.cpp.

Member Function Documentation

◆ getMostLikelyShape()

LineShape * firevision::HtLinesModel::getMostLikelyShape ( void  ) const
virtual

Get best candidate.

Returns
best candidate shape, do not free.

Implements firevision::ShapeModel.

Definition at line 171 of file ht_lines.cpp.

◆ getName()

std::string firevision::HtLinesModel::getName ( void  ) const
inlinevirtual

Get name of shape model.

Returns
name of shape model.

Implements firevision::ShapeModel.

Definition at line 56 of file ht_lines.h.

◆ getShape()

LineShape * firevision::HtLinesModel::getShape ( int  id) const
virtual

Get specific shape.

Parameters
idshape ID
Returns
shape, do NOT free!

Implements firevision::ShapeModel.

Definition at line 161 of file ht_lines.cpp.

◆ getShapeCount()

int firevision::HtLinesModel::getShapeCount ( void  ) const
virtual

Get number of shapes.

Returns
number of shapes.

Implements firevision::ShapeModel.

Definition at line 155 of file ht_lines.cpp.

◆ getShapes()

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

Get all lines found.

Returns
vector with all line shapes.

Definition at line 192 of file ht_lines.cpp.

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

◆ parseImage()

int firevision::HtLinesModel::parseImage ( unsigned char *  buffer,
ROI roi 
)
virtual

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