HtLinesModel Class Reference
Hough-Transform line matcher. More...
#include <models/shape/ht_lines.h>

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) | |
| Creates a new HtLinesModel instance. | |
| virtual | ~HtLinesModel (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. | |
| LineShape * | getShape (int id) const |
| Get specific shape. | |
| LineShape * | getMostLikelyShape (void) const |
| Get best candidate. | |
| std::vector< LineShape > * | getShapes () |
| Get all lines found. | |
Detailed Description
Hough-Transform line matcher.Definition at line 38 of file ht_lines.h.
Constructor & Destructor Documentation
| 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 | |||
| ) |
Creates a new HtLinesModel instance.
Constructor.
- Parameters:
-
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) nr_candidates number of candidates angle_from slope of lines from angle_range angle range r_scale r scale min_votes_ratio min votes ratio min_votes minimum number of votes for a candidate to consider
Definition at line 48 of file ht_lines.cpp.
| HtLinesModel::~HtLinesModel | ( | void | ) | [virtual] |
Member Function Documentation
| LineShape * HtLinesModel::getMostLikelyShape | ( | void | ) | const [virtual] |
Get best candidate.
- Returns:
- best candidate shape, do not free.
Implements ShapeModel.
Definition at line 162 of file ht_lines.cpp.
| std::string HtLinesModel::getName | ( | void | ) | const [inline, virtual] |
Get name of shape model.
- Returns:
- name of shape model.
Implements ShapeModel.
Definition at line 64 of file ht_lines.h.
| LineShape * HtLinesModel::getShape | ( | int | id | ) | const [virtual] |
Get specific shape.
- Parameters:
-
id shape ID
- Returns:
- shape, do NOT free!
Implements ShapeModel.
Definition at line 151 of file ht_lines.cpp.
| int HtLinesModel::getShapeCount | ( | void | ) | const [virtual] |
Get number of shapes.
- Returns:
- number of shapes.
Implements ShapeModel.
Definition at line 145 of file ht_lines.cpp.
| vector< LineShape > * HtLinesModel::getShapes | ( | ) |
Get all lines found.
- Returns:
- vector with all line shapes.
Definition at line 184 of file ht_lines.cpp.
References LineShape::calcPoints(), RhtAccumulator::getNodes(), and RhtAccumulator::getNumVotes().
| int HtLinesModel::parseImage | ( | unsigned char * | buffer, | |
| ROI * | roi | |||
| ) | [virtual] |
Parse image for given ROI.
- Parameters:
-
buffer image buffer roi ROI
- Returns:
- number of shapes found
Implements ShapeModel.
Definition at line 70 of file ht_lines.cpp.
References RhtAccumulator::accumulate(), ROI::get_roi_buffer_start(), RhtAccumulator::getMax(), ROI::height, ROI::line_step, fawkes::rad2deg(), RhtAccumulator::reset(), ROI::width, fawkes::point_t::x, and fawkes::point_t::y.
The documentation for this class was generated from the following files:
- src/firevision/models/shape/ht_lines.h
- src/firevision/models/shape/ht_lines.cpp

