Patate Lib  0.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Grenaille::CovariancePlaneFit< DataPoint, _WFunctor, T > Class Template Reference

Inherits Grenaille::Concept::FittingProcedureConcept< DataPoint, _WFunctor, T >, and T.

Detailed Description

template<class DataPoint, class _WFunctor, typename T>
class Grenaille::CovariancePlaneFit< DataPoint, _WFunctor, T >

Plane fitting procedure using only points position.

Note
This procedure requires two passes to fit a plane

This class can also computes the surface variation measure introduced in [7]. The solver used to analyse the covariance matrix is stored for further use.

Warning
This class is currently untested and should not be used !
See Also
CompactPlane

Public Types

typedef Base::Scalar Scalar
 Scalar type inherited from DataPoint.
 
typedef Base::VectorType VectorType
 Vector type inherited from DataPoint.
 
typedef Base::MatrixType MatrixType
 Vector type inherited from DataPoint.
 
typedef _WFunctor WFunctor
 Weight Function.
 
typedef
Eigen::SelfAdjointEigenSolver
< MatrixType
Solver
 Solver used to analyse the covariance matrix.
 

Public Member Functions

 CovariancePlaneFit ()
 Default constructor.
 
void setWeightFunc (const WFunctor &_w)
 Init the WeightFunc, without changing the other internal states. More...
 
void init (const VectorType &_evalPos)
 Set the evaluation position and reset the internal states. More...
 
bool addNeighbor (const DataPoint &_nei)
 Add a neighbor to perform the fit. More...
 
FIT_RESULT finalize ()
 Finalize the fitting procedure. More...
 
Scalar potential () const
 Value of the scalar field at the evaluation point.
 
VectorType normal () const
 Value of the normal of the primitive at the evaluation point.
 
const Solversolver () const
 Reading access to the Solver used to analyse the covariance matrix.
 
Scalar surfaceVariation () const
 Implements [7] surface variation. More...
 
- Public Member Functions inherited from Grenaille::Concept::FittingProcedureConcept< DataPoint, _WFunctor, T >
void setWeightFunc (const WFunctor &w)
 Init the WeightFunc, without changing the other internal states. More...
 
void init (const VectorType &evalPos)
 Set the evaluation position and reset the internal states. More...
 
bool addNeighbor (const DataPoint &nei)
 Add a neighbor to perform the fit. More...
 
FIT_RESULT finalize ()
 Finalize the fitting procedure. More...
 

Protected Types

enum  { Check = Base::PROVIDES_PLANE }
 

Protected Attributes

Scalar m_sumW
 Sum of queries weight.
 
VectorType m_cog
 Gravity center of the neighborhood.
 
VectorType m_evalPos
 Center of the evaluation basis.
 
MatrixType m_cov
 Covariance matrix.
 
Solver m_solver
 Solver used to analyse the covariance matrix.
 
WFunctor m_w
 Weight function (must inherits BaseWeightFunc)
 

Member Function Documentation

template<class DataPoint , class _WFunctor , typename T >
bool CovariancePlaneFit::addNeighbor ( const DataPoint &  _nei)
inline

Add a neighbor to perform the fit.

Returns
false if param nei is not a valid neighbour (weight = 0)
template<class DataPoint , class _WFunctor , typename T >
FIT_RESULT CovariancePlaneFit::finalize ( )
inline

Finalize the fitting procedure.

Returns
the corresponding state of the fitting
Warning
Must be called be for any use of the fitting output
template<class DataPoint , class _WFunctor , typename T >
void CovariancePlaneFit::init ( const VectorType _evalPos)
inline

Set the evaluation position and reset the internal states.

Warning
Must be called be for any computation
template<class DataPoint , class _WFunctor , typename T >
void Grenaille::CovariancePlaneFit< DataPoint, _WFunctor, T >::setWeightFunc ( const WFunctor _w)
inline

Init the WeightFunc, without changing the other internal states.

Warning
Must be called be for any computation
template<class DataPoint , class _WFunctor , typename T >
CovariancePlaneFit< DataPoint, _WFunctor, T >::Scalar CovariancePlaneFit::surfaceVariation ( ) const
inline

Implements [7] surface variation.

It computes the ratio \( d \frac{\lambda_0}{\sum_i \lambda_i} \) with d the dimension of the ambient space.

Returns
0 for invalid fits