DGtal  1.2.0
DGtal::functors::IISecondPrincipalDirectionFunctor< TSpace, TMatrix > Class Template Reference

Aim: A functor Matrix -> RealVector that returns the second principal curvature direction by diagonalizing the given covariance matrix. This functor is valid starting from 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 IISecondPrincipalDirectionFunctor< 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 >))

BOOST_STATIC_ASSERT ((Space::dimension >=3))

IISecondPrincipalDirectionFunctor ()
Default constructor. More...

IISecondPrincipalDirectionFunctor (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::IISecondPrincipalDirectionFunctor< TSpace, TMatrix >

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

Description of template class 'IISecondPrincipalDirectionFunctor'

Template Parameters
 TSpace a model of CSpace, for instance SpaceND. TMatrix a model of CMatrix, for instance SimpleMatrix.
IntegralInvariantCovarianceEstimator

Definition at line 298 of file IIGeometricFunctors.h.

## ◆ Argument

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

Definition at line 307 of file IIGeometricFunctors.h.

## ◆ Component

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

Definition at line 305 of file IIGeometricFunctors.h.

## ◆ Matrix

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

Definition at line 306 of file IIGeometricFunctors.h.

## ◆ Quantity

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

Definition at line 308 of file IIGeometricFunctors.h.

## ◆ RealVector

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

Definition at line 304 of file IIGeometricFunctors.h.

## ◆ Self

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

Definition at line 302 of file IIGeometricFunctors.h.

## ◆ Space

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

Definition at line 303 of file IIGeometricFunctors.h.

## ◆ Value

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

Definition at line 309 of file IIGeometricFunctors.h.

## ◆ IISecondPrincipalDirectionFunctor() [1/2]

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

Default constructor.

Definition at line 316 of file IIGeometricFunctors.h.

316 {}

## ◆ IISecondPrincipalDirectionFunctor() [2/2]

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

Copy constructor. Nothing to do.

Definition at line 318 of file IIGeometricFunctors.h.

318 {}

## ◆ BOOST_CONCEPT_ASSERT() [1/2]

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

350 {}

## ◆ operator()()

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

Apply operator.

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

Definition at line 330 of file IIGeometricFunctors.h.

331  {
334
335  ASSERT ( !std::isnan(eigenValues) ); // NaN
336 #ifdef DEBUG
337  for( Dimension i_dim = 1; i_dim < Space::dimension; ++i_dim )
338  {
339  ASSERT ( std::abs(eigenValues[i_dim - 1]) <= std::abs(eigenValues[i_dim]) );
340  }
341 #endif
342
343  return eigenVectors.column( Space::dimension - 2 ); // second principal curvature direction is associated to greatest eigenvalue.
344  }
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.
DGtal::uint32_t Dimension
Definition: Common.h:137

## ◆ operator=()

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

Assignment. Nothing to do.

Returns
itself

Definition at line 321 of file IIGeometricFunctors.h.

321 { return *this; }

## ◆ eigenValues

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

A data member only used for temporary calculations.

Definition at line 356 of file IIGeometricFunctors.h.

## ◆ eigenVectors

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

A data member only used for temporary calculations.

Definition at line 354 of file IIGeometricFunctors.h.

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