DGtal  1.5.beta
DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix > Class Template Reference

Aim: A functor Matrix -> std::pair<RealVector,RealVector> that returns the first and the second principal curvature directions by diagonalizing the given covariance matrix. This functor is valid only for 3D space. Note that by second we mean the direction with second greatest curvature in absolute value. More...

#include <DGtal/geometry/surfaces/estimation/IIGeometricFunctors.h>

Public Types

typedef IIPrincipalCurvaturesAndDirectionsFunctor< TSpace > Self
 
typedef TSpace Space
 
typedef Space::RealVector RealVector
 
typedef RealVector::Component Component
 
typedef TMatrix Matrix
 
typedef Matrix Argument
 
typedef std::tuple< double, double, RealVector, RealVectorQuantity
 
typedef Quantity Value
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CMatrix< Matrix >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CSpace< TSpace >))
 
 BOOST_STATIC_ASSERT ((Space::dimension==3))
 
Value operator() (const Argument &arg) const
 
void init (Component h, Component r)
 

Private Attributes

double dh5
 
double d6_PIr6
 
double d8_5r
 
Matrix eigenVectors
 A data member only used for temporary calculations. More...
 
RealVector eigenValues
 A data member only used for temporary calculations. More...
 

Detailed Description

template<typename TSpace, typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
class DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >

Aim: A functor Matrix -> std::pair<RealVector,RealVector> that returns the first and the second principal curvature directions by diagonalizing the given covariance matrix. This functor is valid only for 3D space. Note that by second we mean the direction with second greatest curvature in absolute value.

Description of template class 'IIPrincipalCurvaturesAndDirectionsFunctor'

Template Parameters
TSpacea model of CSpace, for instance SpaceND.
TMatrixa model of CMatrix, for instance SimpleMatrix.
See also
IntegralInvariantCovarianceEstimator

Definition at line 460 of file IIGeometricFunctors.h.

Member Typedef Documentation

◆ Argument

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
typedef Matrix DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::Argument

Definition at line 469 of file IIGeometricFunctors.h.

◆ Component

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
typedef RealVector::Component DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::Component

Definition at line 467 of file IIGeometricFunctors.h.

◆ Matrix

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
typedef TMatrix DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::Matrix

Definition at line 468 of file IIGeometricFunctors.h.

◆ Quantity

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
typedef std::tuple<double, double, RealVector, RealVector> DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::Quantity

Definition at line 470 of file IIGeometricFunctors.h.

◆ RealVector

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
typedef Space::RealVector DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::RealVector

Definition at line 466 of file IIGeometricFunctors.h.

◆ Self

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
typedef IIPrincipalCurvaturesAndDirectionsFunctor<TSpace> DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::Self

Definition at line 464 of file IIGeometricFunctors.h.

◆ Space

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
typedef TSpace DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::Space

Definition at line 465 of file IIGeometricFunctors.h.

◆ Value

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
typedef Quantity DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::Value

Definition at line 471 of file IIGeometricFunctors.h.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT() [1/2]

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::BOOST_CONCEPT_ASSERT ( (concepts::CMatrix< Matrix >)  )

◆ BOOST_CONCEPT_ASSERT() [2/2]

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::BOOST_CONCEPT_ASSERT ( (concepts::CSpace< TSpace >)  )

◆ BOOST_STATIC_ASSERT()

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::BOOST_STATIC_ASSERT ( (Space::dimension==3)  )

◆ init()

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
void DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::init ( Component  h,
Component  r 
)
inline

Initializes the functor with the gridstep and the ball Euclidean radius.

Definition at line 506 of file IIGeometricFunctors.h.

507  {
508  double r3 = r * r * r;
509  double r6 = r3 * r3;
510  d6_PIr6 = 6.0 / ( M_PI * r6 );
511  d8_5r = 8.0 / ( 5.0 * r );
512  double h2 = h * h;
513  dh5 = h2 * h2 * h;
514  }

References DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::d6_PIr6, DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::d8_5r, and DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::dh5.

◆ operator()()

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
Value DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::operator() ( const Argument arg) const
inline

Apply operator.

Parameters
argany symmetric positive matrix (covariance matrix
Returns
the principal curvature values and directions in a std::tuple.

Definition at line 484 of file IIGeometricFunctors.h.

485  {
486  Argument cp_arg = arg;
487  cp_arg *= dh5;
490 
491  ASSERT ( !std::isnan(eigenValues[0]) ); // NaN
492  ASSERT ( (std::abs(eigenValues[0]) <= std::abs(eigenValues[1]))
493  && (std::abs(eigenValues[1]) <= std::abs(eigenValues[2])) );
494 
495  Quantity res(d6_PIr6 * ( eigenValues[2] - ( 3.0 * eigenValues[1] )) + d8_5r,
496  d6_PIr6 * ( eigenValues[1] - ( 3.0 * eigenValues[2] )) + d8_5r,
497  eigenVectors.column( 1 ),
498  eigenVectors.column( 2 ));
499  return res;
500  }
static void getEigenDecomposition(const Matrix &matrix, Matrix &eigenVectors, Vector &eigenValues)
Compute both eigen vectors and eigen values from an input matrix.
Matrix eigenVectors
A data member only used for temporary calculations.
std::tuple< double, double, RealVector, RealVector > Quantity
RealVector eigenValues
A data member only used for temporary calculations.

References DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::d6_PIr6, DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::d8_5r, DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::dh5, DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::eigenValues, DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::eigenVectors, and DGtal::EigenDecomposition< TN, TComponent, TMatrix >::getEigenDecomposition().

Field Documentation

◆ d6_PIr6

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
double DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::d6_PIr6
private

◆ d8_5r

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
double DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::d8_5r
private

◆ dh5

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
double DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::dh5
private

◆ eigenValues

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
RealVector DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::eigenValues
mutableprivate

A data member only used for temporary calculations.

Definition at line 523 of file IIGeometricFunctors.h.

Referenced by DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::operator()().

◆ eigenVectors

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
Matrix DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::eigenVectors
mutableprivate

A data member only used for temporary calculations.

Definition at line 521 of file IIGeometricFunctors.h.

Referenced by DGtal::functors::IIPrincipalCurvaturesAndDirectionsFunctor< TSpace, TMatrix >::operator()().


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