numeric
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
numeric::PlaneFitting< Scalar > Class Template Reference

#include <PlaneFitting.hpp>

Classes

class  Result
 
class  ResultNormal
 

Public Types

typedef Eigen::Matrix< Scalar, 3, 1 > Vector3
 
typedef Eigen::Matrix< Scalar, 3, 3 > Matrix3
 

Public Member Functions

 PlaneFitting ()
 
 PlaneFitting (const Vector3 &p, Scalar weight=1.0)
 
void scale (Scalar scale)
 scale the statistics Note that this will not have influence on the solution, but will only change the relative weighting towards additional datums. More...
 
void clear ()
 clears all previous input to the update method More...
 
void update (const PlaneFitting &other)
 
void update (const Vector3 &p, Scalar weight=1.0)
 
Result solve () const
 Solve the regression and return a result object. More...
 
Vector3 getCoeffs () const
 Get the coefficients of the fitted plane. More...
 
Matrix3 getCovariance () const
 calculate the covariance matrix More...
 
ResultNormal solveNormal () const
 
Vector3 getNormal () const
 

Public Attributes

Scalar x
 
Scalar y
 
Scalar z
 
Scalar xx
 
Scalar yy
 
Scalar xy
 
Scalar xz
 
Scalar yz
 
Scalar zz
 
Scalar n
 

Detailed Description

template<class Scalar>
class numeric::PlaneFitting< Scalar >

Performs a linear least squares regression of a plane to a set of points in 3D space. The points are added incrementally using the update method, and can be weighted according to their contribution to the fit. A call to getCoeffs() will solve the regression and return the coefficients of the fitted plane. Note that the linear least squares fit is over the distance on the z-axis, and not actually the shortest distance to the plane.

Member Typedef Documentation

◆ Matrix3

template<class Scalar>
typedef Eigen::Matrix<Scalar,3,3> numeric::PlaneFitting< Scalar >::Matrix3

◆ Vector3

template<class Scalar>
typedef Eigen::Matrix<Scalar,3,1> numeric::PlaneFitting< Scalar >::Vector3

Constructor & Destructor Documentation

◆ PlaneFitting() [1/2]

template<class Scalar>
numeric::PlaneFitting< Scalar >::PlaneFitting ( )
inline

◆ PlaneFitting() [2/2]

template<class Scalar>
numeric::PlaneFitting< Scalar >::PlaneFitting ( const Vector3 p,
Scalar  weight = 1.0 
)
inlineexplicit

Member Function Documentation

◆ clear()

template<class Scalar>
void numeric::PlaneFitting< Scalar >::clear ( )
inline

clears all previous input to the update method

◆ getCoeffs()

template<class Scalar>
Vector3 numeric::PlaneFitting< Scalar >::getCoeffs ( ) const
inline

Get the coefficients of the fitted plane.

will return all zeros if no input was given to the update() method.

Note this function will call the solve function internally. If you need both coefficients and covariance matrix it is more efficient to call solve directly.

Returns
is a three vector <a,b,c> such that the plane is given by z = a * x + b * y + c

◆ getCovariance()

template<class Scalar>
Matrix3 numeric::PlaneFitting< Scalar >::getCovariance ( ) const
inline

calculate the covariance matrix

Note this function will call the solve function internally. If you need both coefficients and covariance matrix it is more efficient to call solve directly.

Returns
coefficient covariance matrix

◆ getNormal()

template<class Scalar>
Vector3 numeric::PlaneFitting< Scalar >::getNormal ( ) const
inline

◆ scale()

template<class Scalar>
void numeric::PlaneFitting< Scalar >::scale ( Scalar  scale)
inline

scale the statistics Note that this will not have influence on the solution, but will only change the relative weighting towards additional datums.

◆ solve()

template<class Scalar>
Result numeric::PlaneFitting< Scalar >::solve ( ) const
inline

Solve the regression and return a result object.

the result object can be queried for different aspects like coefficients, residuals or covariance matrix.

Returns
result object of the regression

◆ solveNormal()

template<class Scalar>
ResultNormal numeric::PlaneFitting< Scalar >::solveNormal ( ) const
inline

◆ update() [1/2]

template<class Scalar>
void numeric::PlaneFitting< Scalar >::update ( const PlaneFitting< Scalar > &  other)
inline

◆ update() [2/2]

template<class Scalar>
void numeric::PlaneFitting< Scalar >::update ( const Vector3 p,
Scalar  weight = 1.0 
)
inline

Member Data Documentation

◆ n

template<class Scalar>
Scalar numeric::PlaneFitting< Scalar >::n

◆ x

template<class Scalar>
Scalar numeric::PlaneFitting< Scalar >::x

◆ xx

template<class Scalar>
Scalar numeric::PlaneFitting< Scalar >::xx

◆ xy

template<class Scalar>
Scalar numeric::PlaneFitting< Scalar >::xy

◆ xz

template<class Scalar>
Scalar numeric::PlaneFitting< Scalar >::xz

◆ y

template<class Scalar>
Scalar numeric::PlaneFitting< Scalar >::y

◆ yy

template<class Scalar>
Scalar numeric::PlaneFitting< Scalar >::yy

◆ yz

template<class Scalar>
Scalar numeric::PlaneFitting< Scalar >::yz

◆ z

template<class Scalar>
Scalar numeric::PlaneFitting< Scalar >::z

◆ zz

template<class Scalar>
Scalar numeric::PlaneFitting< Scalar >::zz

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