DGtal  0.9.4beta
Public Types | Public Member Functions | Private Attributes
DGtal::functors::IIFirstPrincipalDirectionFunctor< TSpace, TMatrix > Class Template Reference

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

Collaboration diagram for DGtal::functors::IIFirstPrincipalDirectionFunctor< TSpace, TMatrix >:
[legend]

Public Types

typedef IIFirstPrincipalDirectionFunctor< 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::CSpace< TSpace >))
 
 BOOST_STATIC_ASSERT ((Space::dimension >=2))
 
 IIFirstPrincipalDirectionFunctor ()
 
 IIFirstPrincipalDirectionFunctor (const Self &)
 
Selfoperator= (const Self &)
 
Value operator() (const Argument &arg) const
 
void init (Component, Component)
 

Private Attributes

Matrix eigenVectors
 
RealVector eigenValues
 

Detailed Description

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

Aim: A functor Matrix -> RealVector that returns the first principal curvature direction by diagonalizing the given covariance matrix. This functor is valid starting from 2D space and is equivalent to IITangentDirectionFunctor in 2D. Note that by first we mean the direction with greatest curvature in absolute value.

Description of template class 'IIFirstPrincipalDirectionFunctor'

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

Definition at line 212 of file IIGeometricFunctors.h.

Member Typedef Documentation

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

Definition at line 221 of file IIGeometricFunctors.h.

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

Definition at line 219 of file IIGeometricFunctors.h.

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

Definition at line 220 of file IIGeometricFunctors.h.

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

Definition at line 222 of file IIGeometricFunctors.h.

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

Definition at line 218 of file IIGeometricFunctors.h.

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

Definition at line 216 of file IIGeometricFunctors.h.

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

Definition at line 217 of file IIGeometricFunctors.h.

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

Definition at line 223 of file IIGeometricFunctors.h.

Constructor & Destructor Documentation

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

Default constructor.

Definition at line 230 of file IIGeometricFunctors.h.

230 {}
template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
DGtal::functors::IIFirstPrincipalDirectionFunctor< TSpace, TMatrix >::IIFirstPrincipalDirectionFunctor ( const Self )
inline

Copy constructor. Nothing to do.

Definition at line 232 of file IIGeometricFunctors.h.

232 {}

Member Function Documentation

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
DGtal::functors::IIFirstPrincipalDirectionFunctor< TSpace, TMatrix >::BOOST_CONCEPT_ASSERT ( (concepts::CSpace< TSpace >)  )
template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
DGtal::functors::IIFirstPrincipalDirectionFunctor< TSpace, TMatrix >::BOOST_STATIC_ASSERT ( (Space::dimension >=2)  )
template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
void DGtal::functors::IIFirstPrincipalDirectionFunctor< 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 264 of file IIGeometricFunctors.h.

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

Apply operator.

Parameters
argany symmetric positive matrix (covariance matrix
Returns
the first principal curvature direction for the II covariance matrix, which is the eigenvector associated with the highest eigenvalue.

Definition at line 244 of file IIGeometricFunctors.h.

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

245  {
246  EigenDecomposition<Space::dimension, Component, Matrix>
247  ::getEigenDecomposition( arg, eigenVectors, eigenValues );
248 
249  ASSERT ( !std::isnan(eigenValues[0]) ); // NaN
250 #ifdef DEBUG
251  for( Dimension i_dim = 1; i_dim < Space::dimension; ++i_dim )
252  {
253  ASSERT ( std::abs(eigenValues[i_dim - 1]) <= std::abs(eigenValues[i_dim]) );
254  }
255 #endif
256 
257  return eigenVectors.column( Space::dimension - 1 ); // first principal curvature direction is associated to greatest eigenvalue.
258  }
static const Dimension dimension
static constants to store the dimension.
Definition: SpaceND.h:132
DGtal::uint32_t Dimension
Definition: Common.h:120
Matrix eigenVectors
A data member only used for temporary calculations.
RealVector eigenValues
A data member only used for temporary calculations.
template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
Self& DGtal::functors::IIFirstPrincipalDirectionFunctor< TSpace, TMatrix >::operator= ( const Self )
inline

Assignment. Nothing to do.

Returns
itself

Definition at line 235 of file IIGeometricFunctors.h.

235 { return *this; }

Field Documentation

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

A data member only used for temporary calculations.

Definition at line 270 of file IIGeometricFunctors.h.

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

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

A data member only used for temporary calculations.

Definition at line 268 of file IIGeometricFunctors.h.

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


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