DGtal  1.5.beta
DGtal::functors::IIGaussianCurvature3DFunctor< TSpace, TMatrix > Struct Template Reference

Aim: A functor Matrix -> Real that returns the Gaussian curvature by diagonalizing the given covariance matrix. This functor is valid starting from 3D space. Note that the Gaussian curvature is computed by multiplying the two gretest curvature values in absolute value. More...

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

Public Types

typedef IIGaussianCurvature3DFunctor< TSpace > Self
 
typedef TSpace Space
 
typedef Space::RealVector RealVector
 
typedef RealVector::Component Component
 
typedef TMatrix Matrix
 
typedef Matrix Argument
 
typedef Component Quantity
 
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

Quantity dh5
 
Quantity d6_PIr6
 
Quantity 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>>
struct DGtal::functors::IIGaussianCurvature3DFunctor< TSpace, TMatrix >

Aim: A functor Matrix -> Real that returns the Gaussian curvature by diagonalizing the given covariance matrix. This functor is valid starting from 3D space. Note that the Gaussian curvature is computed by multiplying the two gretest curvature values in absolute value.

Description of template class 'IIGaussianCurvature3DFunctor'

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

Definition at line 666 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::IIGaussianCurvature3DFunctor< TSpace, TMatrix >::Argument

Definition at line 675 of file IIGeometricFunctors.h.

◆ Component

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

Definition at line 673 of file IIGeometricFunctors.h.

◆ Matrix

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

Definition at line 674 of file IIGeometricFunctors.h.

◆ Quantity

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

Definition at line 676 of file IIGeometricFunctors.h.

◆ RealVector

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

Definition at line 672 of file IIGeometricFunctors.h.

◆ Self

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

Definition at line 670 of file IIGeometricFunctors.h.

◆ Space

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

Definition at line 671 of file IIGeometricFunctors.h.

◆ Value

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

Definition at line 677 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::IIGaussianCurvature3DFunctor< 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::IIGaussianCurvature3DFunctor< 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::IIGaussianCurvature3DFunctor< 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::IIGaussianCurvature3DFunctor< TSpace, TMatrix >::init ( Component  h,
Component  r 
)
inline

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

Parameters
hthe gridstep
rthe ball radius

Definition at line 712 of file IIGeometricFunctors.h.

713  {
714  double r3 = r * r * r;
715  double r6 = r3 * r3;
716  d6_PIr6 = 6.0 / ( M_PI * r6 );
717  d8_5r = 8.0 / ( 5.0 * r );
718  double h2 = h * h;
719  dh5 = h2 * h2 * h;
720  }

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

◆ operator()()

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

Apply operator.

Parameters
argany symmetric positive matrix (covariance matrix
Returns
the Gaussian curvature value for the II covariance matrix, which is the second highest eigenvalue * second highest eigenvalue.

Definition at line 690 of file IIGeometricFunctors.h.

691  {
692  Argument cp_arg = arg;
693  cp_arg *= dh5;
696 
697  ASSERT ( !std::isnan(eigenValues[0]) ); // NaN
698  ASSERT ( (std::abs(eigenValues[0]) <= std::abs(eigenValues[1]))
699  && (std::abs(eigenValues[1]) <= std::abs(eigenValues[2])) );
700 
701  Value k1 = d6_PIr6 * ( eigenValues[2] - ( 3.0 * eigenValues[1] )) + d8_5r;
702  Value k2 = d6_PIr6 * ( eigenValues[1] - ( 3.0 * eigenValues[2] )) + d8_5r;
703  return k1 * k2;
704  }
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.
RealVector eigenValues
A data member only used for temporary calculations.

References DGtal::functors::IIGaussianCurvature3DFunctor< TSpace, TMatrix >::d6_PIr6, DGtal::functors::IIGaussianCurvature3DFunctor< TSpace, TMatrix >::d8_5r, DGtal::functors::IIGaussianCurvature3DFunctor< TSpace, TMatrix >::dh5, DGtal::functors::IIGaussianCurvature3DFunctor< TSpace, TMatrix >::eigenValues, DGtal::functors::IIGaussianCurvature3DFunctor< 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>>
Quantity DGtal::functors::IIGaussianCurvature3DFunctor< TSpace, TMatrix >::d6_PIr6
private

◆ d8_5r

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

◆ dh5

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

◆ eigenValues

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

A data member only used for temporary calculations.

Definition at line 730 of file IIGeometricFunctors.h.

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

◆ eigenVectors

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

A data member only used for temporary calculations.

Definition at line 728 of file IIGeometricFunctors.h.

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


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