ReadFramework
|
Implements robust line fitting algorithms. More...
#include <Algorithms.h>
Public Member Functions | |
LineFitting (const QVector< Vector2D > &pts) | |
Line | fitLineLMS () const |
Fits a line to the given set using the Least Median Squares method. In contrast to the official LMS, we extensively sample lines if the combinatorial effort is less than num sets. More... | |
Line | fitLine () const |
Protected Member Functions | |
void | sample (const QVector< Vector2D > &pts, QVector< Vector2D > &set, int setSize=2) const |
Returns randomly sampled pts. More... | |
double | medianResiduals (const QVector< Vector2D > &pts, const Line &line) const |
Returns the median of the squared distances between pts and the line. More... | |
Protected Attributes | |
int | mNumSets = 1000 |
int | mSetSize = 2 |
double | mEps = 0.1 |
double | mMinLength = 2 |
QVector< Vector2D > | mPts |
Implements robust line fitting algorithms.
rdf::LineFitting::LineFitting | ( | const QVector< Vector2D > & | pts | ) |
Line rdf::LineFitting::fitLine | ( | ) | const |
Line rdf::LineFitting::fitLineLMS | ( | ) | const |
Fits a line to the given set using the Least Median Squares method. In contrast to the official LMS, we extensively sample lines if the combinatorial effort is less than num sets.
|
protected |
Returns the median of the squared distances between pts and the line.
pts | The point set. |
line | The current fitting line. |
|
protected |
Returns randomly sampled pts.
pts | Input points. |
set | A randomly sampled set of size setSize. |
setSize | The set size returned. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |