DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::functors::IINormalDirectionFunctor< TSpace, TMatrix > Class Template Reference

Aim: A functor Matrix -> RealVector that returns the normal direction by diagonalizing the given covariance matrix. More...

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

Public Types

typedef IINormalDirectionFunctor< TSpace > Self
 
typedef TSpace Space
 
typedef Space::RealVector RealVector
 
typedef RealVector::Component Component
 
typedef TMatrix Matrix
 
typedef Matrix Argument
 
typedef RealVector Quantity
 
typedef Quantity Value
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CMatrix< Matrix >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CSpace< TSpace >))
 
 IINormalDirectionFunctor ()
 Default constructor.
 
 IINormalDirectionFunctor (const Self &)
 Copy constructor. Nothing to do.
 
Selfoperator= (const Self &)
 
Value operator() (const Argument &arg) const
 
void init (Component, Component)
 

Private Attributes

Matrix eigenVectors
 A data member only used for temporary calculations.
 
RealVector eigenValues
 A data member only used for temporary calculations.
 

Detailed Description

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

Aim: A functor Matrix -> RealVector that returns the normal direction by diagonalizing the given covariance matrix.

Description of template class 'IINormalDirectionFunctor'

Template Parameters
TSpacea model of CSpace, for instance SpaceND.
TMatrixa model of CMatrix, for instance SimpleMatrix.
See also
IntegralInvariantCovarianceEstimator
Examples
dec/exampleHeatLaplace.cpp.

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

Definition at line 76 of file IIGeometricFunctors.h.

◆ Component

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

Definition at line 74 of file IIGeometricFunctors.h.

◆ Matrix

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

Definition at line 75 of file IIGeometricFunctors.h.

◆ Quantity

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

Definition at line 77 of file IIGeometricFunctors.h.

◆ RealVector

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

Definition at line 73 of file IIGeometricFunctors.h.

◆ Self

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

Definition at line 71 of file IIGeometricFunctors.h.

◆ Space

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

Definition at line 72 of file IIGeometricFunctors.h.

◆ Value

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

Definition at line 78 of file IIGeometricFunctors.h.

Constructor & Destructor Documentation

◆ IINormalDirectionFunctor() [1/2]

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
DGtal::functors::IINormalDirectionFunctor< TSpace, TMatrix >::IINormalDirectionFunctor ( )
inline

Default constructor.

Definition at line 84 of file IIGeometricFunctors.h.

84{}

◆ IINormalDirectionFunctor() [2/2]

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
DGtal::functors::IINormalDirectionFunctor< TSpace, TMatrix >::IINormalDirectionFunctor ( const Self & )
inline

Copy constructor. Nothing to do.

Definition at line 86 of file IIGeometricFunctors.h.

86{}

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT() [1/2]

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
DGtal::functors::IINormalDirectionFunctor< 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::IINormalDirectionFunctor< TSpace, TMatrix >::BOOST_CONCEPT_ASSERT ( (concepts::CSpace< TSpace >) )

◆ init()

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

Initializes the functor with the gridstep and the ball Euclidean radius. Not used for this estimator.

Definition at line 118 of file IIGeometricFunctors.h.

118{}

◆ operator()()

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

Apply operator.

Parameters
argany symmetric positive matrix (covariance matrix
Returns
the normal direction for the II covariance matrix, which is the eigenvector associated with the smallest eigenvalue.

Definition at line 98 of file IIGeometricFunctors.h.

99 {
100 EigenDecomposition<Space::dimension, Component, Matrix>
101 ::getEigenDecomposition( arg, eigenVectors, eigenValues );
102
103 ASSERT ( !std::isnan(eigenValues[0]) ); // NaN
104#ifdef DEBUG
105 for( Dimension i_dim = 1; i_dim < Space::dimension; ++i_dim )
106 {
107 ASSERT ( std::abs(eigenValues[i_dim - 1]) <= std::abs(eigenValues[i_dim]) );
108 }
109#endif
110
111 return eigenVectors.column( 0 ); // normal vector is associated to smallest eigenvalue.
112 }
static const Dimension dimension
static constants to store the dimension.
Definition SpaceND.h:132
RealVector eigenValues
A data member only used for temporary calculations.
Matrix eigenVectors
A data member only used for temporary calculations.
DGtal::uint32_t Dimension
Definition Common.h:136

References DGtal::SpaceND< dim, TInteger >::dimension, DGtal::functors::IINormalDirectionFunctor< TSpace, TMatrix >::eigenValues, and DGtal::functors::IINormalDirectionFunctor< TSpace, TMatrix >::eigenVectors.

◆ operator=()

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
Self & DGtal::functors::IINormalDirectionFunctor< TSpace, TMatrix >::operator= ( const Self & )
inline

Assignment. Nothing to do.

Returns
itself

Definition at line 89 of file IIGeometricFunctors.h.

89{ return *this; }

Field Documentation

◆ eigenValues

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

A data member only used for temporary calculations.

Definition at line 124 of file IIGeometricFunctors.h.

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

◆ eigenVectors

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

A data member only used for temporary calculations.

Definition at line 122 of file IIGeometricFunctors.h.

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


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