DGtal  1.0.0
Public Types | Public Member Functions | Private Attributes
DGtal::functors::IITangentDirectionFunctor< TSpace, TMatrix > Class Template Reference

Aim: A functor Matrix -> RealVector that returns the tangent direction by diagonalizing the given covariance matrix. This functor is valid only in 2D space. More...

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

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

Public Types

typedef IITangentDirectionFunctor< 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))
 
 IITangentDirectionFunctor ()
 Default constructor. More...
 
 IITangentDirectionFunctor (const Self &)
 Copy constructor. Nothing to do. More...
 
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. 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::IITangentDirectionFunctor< TSpace, TMatrix >

Aim: A functor Matrix -> RealVector that returns the tangent direction by diagonalizing the given covariance matrix. This functor is valid only in 2D space.

Description of template class 'IITangentDirectionFunctor'

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

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

Definition at line 148 of file IIGeometricFunctors.h.

◆ Component

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

Definition at line 146 of file IIGeometricFunctors.h.

◆ Matrix

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

Definition at line 147 of file IIGeometricFunctors.h.

◆ Quantity

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

Definition at line 149 of file IIGeometricFunctors.h.

◆ RealVector

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

Definition at line 145 of file IIGeometricFunctors.h.

◆ Self

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

Definition at line 143 of file IIGeometricFunctors.h.

◆ Space

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

Definition at line 144 of file IIGeometricFunctors.h.

◆ Value

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

Definition at line 150 of file IIGeometricFunctors.h.

Constructor & Destructor Documentation

◆ IITangentDirectionFunctor() [1/2]

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

Default constructor.

Definition at line 157 of file IIGeometricFunctors.h.

157 {}

◆ IITangentDirectionFunctor() [2/2]

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

Copy constructor. Nothing to do.

Definition at line 159 of file IIGeometricFunctors.h.

159 {}

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
DGtal::functors::IITangentDirectionFunctor< 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::IITangentDirectionFunctor< TSpace, TMatrix >::BOOST_STATIC_ASSERT ( (Space::dimension==2)  )

◆ init()

template<typename TSpace , typename TMatrix = SimpleMatrix< typename TSpace::RealVector::Component, TSpace::dimension, TSpace::dimension>>
void DGtal::functors::IITangentDirectionFunctor< 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 190 of file IIGeometricFunctors.h.

190 {}

◆ operator()()

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

Apply operator.

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

Definition at line 171 of file IIGeometricFunctors.h.

172  {
175 
176  ASSERT ( !std::isnan(eigenValues[0]) ); // NaN
177 #ifdef DEBUG
178  for( Dimension i_dim = 1; i_dim < Space::dimension; ++i_dim )
179  {
180  ASSERT ( std::abs(eigenValues[i_dim - 1]) <= std::abs(eigenValues[i_dim]) );
181  }
182 #endif
183  return eigenVectors.column( 1 ); // tangent vector is associated to greatest eigenvalue.
184  }
static const Dimension dimension
static constants to store the dimension.
Definition: SpaceND.h:132
Matrix eigenVectors
A data member only used for temporary calculations.
DGtal::uint32_t Dimension
Definition: Common.h:127
RealVector eigenValues
A data member only used for temporary calculations.
static void getEigenDecomposition(const Matrix &matrix, Matrix &eigenVectors, Vector &eigenValues)
Compute both eigen vectors and eigen values from an input matrix.

References DGtal::SpaceND< dim, TInteger >::dimension, DGtal::functors::IITangentDirectionFunctor< TSpace, TMatrix >::eigenValues, DGtal::functors::IITangentDirectionFunctor< TSpace, TMatrix >::eigenVectors, and DGtal::EigenDecomposition< TN, TComponent, TMatrix >::getEigenDecomposition().

◆ operator=()

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

Assignment. Nothing to do.

Returns
itself

Definition at line 162 of file IIGeometricFunctors.h.

162 { return *this; }

Field Documentation

◆ eigenValues

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

A data member only used for temporary calculations.

Definition at line 196 of file IIGeometricFunctors.h.

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

◆ eigenVectors

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

A data member only used for temporary calculations.

Definition at line 194 of file IIGeometricFunctors.h.

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


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