Image Component Library (ICL)
|
Direct Least Square Fitting specialization for 2D input data. More...
#include <LeastSquareModelFitting2D.h>
Public Member Functions | |
LeastSquareModelFitting2D () | |
Default constructor for creating dummy instances. | |
LeastSquareModelFitting2D (int modelDim, DesignMatrixGen gen, DynMatrix< double > *constraintMatrix=0) | |
Constructor with given parameters. | |
std::vector< double > | fit (const std::vector< utils::Point32f > &points) |
fits the model to the given data points and returns optimal parameter set | |
icl64f | getError (const std::vector< double > &model, const utils::Point32f &p) |
computes the error for a given data point | |
Static Public Member Functions | |
static void | line_gen (const utils::Point32f &p, double *d) |
DesignMatrixGenerator for the 3-parameter line model. | |
static void | circle_gen (const utils::Point32f &p, double *d) |
DesignMatrixGenerator for the 4 parameter circle model. | |
static void | restr_ellipse_gen (const utils::Point32f &p, double *d) |
DesignMatrixGenerator for the 5 parameter restricted ellipse model. | |
static void | ellipse_gen (const utils::Point32f &p, double *d) |
DesignMatrixGenerator for the 6 parameter general ellipse model. | |
Private Types | |
typedef LeastSquareModelFitting < double, utils::Point32f > | Super |
super type |
Direct Least Square Fitting specialization for 2D input data.
Specialized least square model fitting for 2D data. Also some special desing matrix creation methods are provided
typedef LeastSquareModelFitting<double, utils::Point32f> icl::math::LeastSquareModelFitting2D::Super [private] |
super type
Default constructor for creating dummy instances.
icl::math::LeastSquareModelFitting2D::LeastSquareModelFitting2D | ( | int | modelDim, |
DesignMatrixGen | gen, | ||
DynMatrix< double > * | constraintMatrix = 0 |
||
) | [inline] |
Constructor with given parameters.
static void icl::math::LeastSquareModelFitting2D::circle_gen | ( | const utils::Point32f & | p, |
double * | d | ||
) | [inline, static] |
DesignMatrixGenerator for the 4 parameter circle model.
static void icl::math::LeastSquareModelFitting2D::ellipse_gen | ( | const utils::Point32f & | p, |
double * | d | ||
) | [inline, static] |
DesignMatrixGenerator for the 6 parameter general ellipse model.
std::vector<double> icl::math::LeastSquareModelFitting2D::fit | ( | const std::vector< utils::Point32f > & | points | ) | [inline] |
fits the model to the given data points and returns optimal parameter set
Internally we use a workaround when the matrix inversion fails due to stability problems. If the standard matrix inversion fails, a SVD-based inversion is used
create design matrix D
create the scatter matrix S
use eigen vector for the largest eigen value
Reimplemented from icl::math::LeastSquareModelFitting< double, utils::Point32f >.
icl64f icl::math::LeastSquareModelFitting2D::getError | ( | const std::vector< double > & | model, |
const utils::Point32f & | p | ||
) | [inline] |
computes the error for a given data point
if model is 0, the last fitted model is used
Reimplemented from icl::math::LeastSquareModelFitting< double, utils::Point32f >.
static void icl::math::LeastSquareModelFitting2D::line_gen | ( | const utils::Point32f & | p, |
double * | d | ||
) | [inline, static] |
DesignMatrixGenerator for the 3-parameter line model.
static void icl::math::LeastSquareModelFitting2D::restr_ellipse_gen | ( | const utils::Point32f & | p, |
double * | d | ||
) | [inline, static] |
DesignMatrixGenerator for the 5 parameter restricted ellipse model.