Ponca  e26a0e88a45818354616c1a7180bcd203aecad3c
Point Cloud Analysis library
Loading...
Searching...
No Matches
Ponca::CovarianceFitBase< DataPoint, _WFunctor, T > Class Template Reference

Line fitting procedure that minimize the orthogonal distance between the samples and the fitted primitive. More...

#include <covarianceFit.h>

+ Inheritance diagram for Ponca::CovarianceFitBase< DataPoint, _WFunctor, T >:
+ Collaboration diagram for Ponca::CovarianceFitBase< DataPoint, _WFunctor, T >:

Public Types

using Scalar = typename DataPoint::Scalar
 Alias to scalar type.
 
using VectorType = typename Base::VectorType
 Alias to vector type.
 
using WFunctor = typename Base::WFunctor
 Alias to weight function.
 
using MatrixType = typename DataPoint::MatrixType
 Alias to matrix type.
 
using Solver = Eigen::SelfAdjointEigenSolver< MatrixType >
 Solver used to analyse the covariance matrix.
 

Public Member Functions

CovarianceFitBase< DataPoint, _WFunctor, T > & covarianceFit ()
 Explicit conversion to CovarianceFitBase , to access methods potentially hidden by heritage.
 
const CovarianceFitBase< DataPoint, _WFunctor, T > & covarianceFit () const
 Explicit conversion to CovarianceFitBase , to access methods potentially hidden by heritage.
 
void init (const VectorType &_evalPos)
 Set the evaluation position and reset the internal states.
 
bool addLocalNeighbor (Scalar w, const VectorType &localQ, const DataPoint &attributes)
 Add a neighbor to perform the fit.
 
FIT_RESULT finalize ()
 Finalize the procedure.
 
Scalar surfaceVariation () const
 Implements [12] surface variation.
 
const Solversolver () const
 Reading access to the Solver used to analyse the covariance matrix.
 

Protected Types

enum  { Check = Base::PROVIDES_MEAN_POSITION , PROVIDES_POSITION_COVARIANCE }
 
using Base = T
 Base class of the procedure.
 

Protected Attributes

MatrixType m_cov {MatrixType::Zero()}
 Covariance matrix.
 
Solver m_solver
 Solver used to analyse the covariance matrix.
 

Detailed Description

template<class DataPoint, class _WFunctor, typename T>
class Ponca::CovarianceFitBase< DataPoint, _WFunctor, T >

Line fitting procedure that minimize the orthogonal distance between the samples and the fitted primitive.

See also
Line
CovariancePlaneFit which use a similar approach for Plane estimation
Warning
This class is valid only in 3D.

Definition at line 32 of file covarianceFit.h.

Member Typedef Documentation

◆ Base

template<class DataPoint , class _WFunctor , typename T >
using Ponca::CovarianceFitBase< DataPoint, _WFunctor, T >::Base = T
protected

Base class of the procedure.

Definition at line 34 of file covarianceFit.h.

◆ MatrixType

template<class DataPoint , class _WFunctor , typename T >
using Ponca::CovarianceFitBase< DataPoint, _WFunctor, T >::MatrixType = typename DataPoint::MatrixType

Alias to matrix type.

Definition at line 44 of file covarianceFit.h.

◆ Scalar

template<class DataPoint , class _WFunctor , typename T >
using Ponca::CovarianceFitBase< DataPoint, _WFunctor, T >::Scalar = typename DataPoint::Scalar

Alias to scalar type.

Definition at line 34 of file covarianceFit.h.

◆ Solver

template<class DataPoint , class _WFunctor , typename T >
using Ponca::CovarianceFitBase< DataPoint, _WFunctor, T >::Solver = Eigen::SelfAdjointEigenSolver<MatrixType>

Solver used to analyse the covariance matrix.

Definition at line 46 of file covarianceFit.h.

◆ VectorType

template<class DataPoint , class _WFunctor , typename T >
using Ponca::CovarianceFitBase< DataPoint, _WFunctor, T >::VectorType = typename Base::VectorType

Alias to vector type.

Definition at line 34 of file covarianceFit.h.

◆ WFunctor

template<class DataPoint , class _WFunctor , typename T >
using Ponca::CovarianceFitBase< DataPoint, _WFunctor, T >::WFunctor = typename Base::WFunctor

Alias to weight function.

Definition at line 34 of file covarianceFit.h.

Member Enumeration Documentation

◆ anonymous enum

template<class DataPoint , class _WFunctor , typename T >
anonymous enum
protected

Definition at line 37 of file covarianceFit.h.

Member Function Documentation

◆ addLocalNeighbor()

template<class DataPoint , class _WFunctor , typename T >
bool CovarianceFitBase::addLocalNeighbor ( Scalar  w,
const VectorType localQ,
const DataPoint &  attributes 
)
inline

Add a neighbor to perform the fit.

Returns
false if param nei is not a valid neighbour (weight = 0)

Definition at line 21 of file covarianceFit.hpp.

◆ covarianceFit() [1/2]

template<class DataPoint , class _WFunctor , typename T >
CovarianceFitBase< DataPoint, _WFunctor, T > & Ponca::CovarianceFitBase< DataPoint, _WFunctor, T >::covarianceFit ( )
inline

Explicit conversion to CovarianceFitBase , to access methods potentially hidden by heritage.

Definition at line 54 of file covarianceFit.h.

◆ covarianceFit() [2/2]

template<class DataPoint , class _WFunctor , typename T >
const CovarianceFitBase< DataPoint, _WFunctor, T > & Ponca::CovarianceFitBase< DataPoint, _WFunctor, T >::covarianceFit ( ) const
inline

Explicit conversion to CovarianceFitBase , to access methods potentially hidden by heritage.

Definition at line 54 of file covarianceFit.h.

◆ finalize()

template<class DataPoint , class _WFunctor , typename T >
FIT_RESULT CovarianceFitBase::finalize ( )
inline

Finalize the procedure.

Returns
Fitting Status
Warning
Must be called be for any use of the fitting output

Definition at line 35 of file covarianceFit.hpp.

◆ init()

template<class DataPoint , class _WFunctor , typename T >
void CovarianceFitBase::init ( const VectorType _evalPos)
inline

Set the evaluation position and reset the internal states.

Warning
Must be called be for any computation (but after #setWeightFunc)

Definition at line 13 of file covarianceFit.hpp.

◆ solver()

template<class DataPoint , class _WFunctor , typename T >
const Solver & Ponca::CovarianceFitBase< DataPoint, _WFunctor, T >::solver ( ) const
inline

Reading access to the Solver used to analyse the covariance matrix.

Definition at line 64 of file covarianceFit.h.

◆ surfaceVariation()

template<class DataPoint , class _WFunctor , typename T >
CovarianceFitBase< DataPoint, _WFunctor, T >::Scalar CovarianceFitBase::surfaceVariation ( ) const
inline

Implements [12] 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

Definition at line 60 of file covarianceFit.hpp.

Member Data Documentation

◆ m_cov

template<class DataPoint , class _WFunctor , typename T >
MatrixType Ponca::CovarianceFitBase< DataPoint, _WFunctor, T >::m_cov {MatrixType::Zero()}
protected

Covariance matrix.

Definition at line 50 of file covarianceFit.h.

◆ m_solver

template<class DataPoint , class _WFunctor , typename T >
Solver Ponca::CovarianceFitBase< DataPoint, _WFunctor, T >::m_solver
protected

Solver used to analyse the covariance matrix.

Definition at line 51 of file covarianceFit.h.