DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::functors::VCMAbsoluteCurvatureFunctor< TVCMOnDigitalSurface > Struct Template Reference

Aim: A functor Surfel -> Quantity that returns the absolute curvature at given surfel. This class has meaning only in 2D. More...

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

Public Types

typedef TVCMOnDigitalSurface VCMOnDigitalSurface
 
typedef VCMOnDigitalSurface::KSpace KSpace
 
typedef VCMOnDigitalSurface::Surfel Surfel
 
typedef VCMOnDigitalSurface::VectorN RealVector
 
typedef RealVector::Component Scalar
 
typedef Surfel Argument
 
typedef Scalar Quantity
 

Public Member Functions

 VCMAbsoluteCurvatureFunctor (ConstAlias< VCMOnDigitalSurface > aVCMOnDigitalSurface=0)
 
void attach (ConstAlias< VCMOnDigitalSurface > aVCMOnDigitalSurface)
 
Quantity operator() (const Surfel &s) const
 

Private Attributes

CountedConstPtrOrConstPtr< VCMOnDigitalSurfacemyVCMOnDigitalSurface
 The shape of interest.
 

Detailed Description

template<typename TVCMOnDigitalSurface>
struct DGtal::functors::VCMAbsoluteCurvatureFunctor< TVCMOnDigitalSurface >

Aim: A functor Surfel -> Quantity that returns the absolute curvature at given surfel. This class has meaning only in 2D.

Description of template class 'VCMAbsoluteCurvatureFunctor'

Template Parameters
TVCMOnDigitalSurfaceany concrete type of VoronoiCovarianceMeasureOnDigitalSurface
Examples
geometry/surfaces/dvcm-2d-curvature.cpp.

Definition at line 120 of file VCMGeometricFunctors.h.

Member Typedef Documentation

◆ Argument

template<typename TVCMOnDigitalSurface >
typedef Surfel DGtal::functors::VCMAbsoluteCurvatureFunctor< TVCMOnDigitalSurface >::Argument

Definition at line 126 of file VCMGeometricFunctors.h.

◆ KSpace

template<typename TVCMOnDigitalSurface >
typedef VCMOnDigitalSurface::KSpace DGtal::functors::VCMAbsoluteCurvatureFunctor< TVCMOnDigitalSurface >::KSpace

Definition at line 122 of file VCMGeometricFunctors.h.

◆ Quantity

template<typename TVCMOnDigitalSurface >
typedef Scalar DGtal::functors::VCMAbsoluteCurvatureFunctor< TVCMOnDigitalSurface >::Quantity

Definition at line 127 of file VCMGeometricFunctors.h.

◆ RealVector

template<typename TVCMOnDigitalSurface >
typedef VCMOnDigitalSurface::VectorN DGtal::functors::VCMAbsoluteCurvatureFunctor< TVCMOnDigitalSurface >::RealVector

Definition at line 124 of file VCMGeometricFunctors.h.

◆ Scalar

template<typename TVCMOnDigitalSurface >
typedef RealVector::Component DGtal::functors::VCMAbsoluteCurvatureFunctor< TVCMOnDigitalSurface >::Scalar

Definition at line 125 of file VCMGeometricFunctors.h.

◆ Surfel

template<typename TVCMOnDigitalSurface >
typedef VCMOnDigitalSurface::Surfel DGtal::functors::VCMAbsoluteCurvatureFunctor< TVCMOnDigitalSurface >::Surfel

Definition at line 123 of file VCMGeometricFunctors.h.

◆ VCMOnDigitalSurface

template<typename TVCMOnDigitalSurface >
typedef TVCMOnDigitalSurface DGtal::functors::VCMAbsoluteCurvatureFunctor< TVCMOnDigitalSurface >::VCMOnDigitalSurface

Definition at line 121 of file VCMGeometricFunctors.h.

Constructor & Destructor Documentation

◆ VCMAbsoluteCurvatureFunctor()

template<typename TVCMOnDigitalSurface >
DGtal::functors::VCMAbsoluteCurvatureFunctor< TVCMOnDigitalSurface >::VCMAbsoluteCurvatureFunctor ( ConstAlias< VCMOnDigitalSurface > aVCMOnDigitalSurface = 0)
inline

Constructor. A VCM may also be attached at construction.

Parameters
aVCMOnDigitalSurfacethe VCM on surface that stores all the information. The alias can be secured if some counted pointer is handed.

Definition at line 136 of file VCMGeometricFunctors.h.

137 : myVCMOnDigitalSurface( aVCMOnDigitalSurface )
138 {
139 BOOST_STATIC_ASSERT(( KSpace::dimension == 2 ));
140 }
static const constexpr Dimension dimension
CountedConstPtrOrConstPtr< VCMOnDigitalSurface > myVCMOnDigitalSurface
The shape of interest.

References DGtal::KhalimskySpaceND< dim, TInteger >::dimension.

Member Function Documentation

◆ attach()

template<typename TVCMOnDigitalSurface >
void DGtal::functors::VCMAbsoluteCurvatureFunctor< TVCMOnDigitalSurface >::attach ( ConstAlias< VCMOnDigitalSurface > aVCMOnDigitalSurface)
inline

Attach a VCM on a digital surface.

Parameters
aVCMOnDigitalSurfaceon surface that stores all the information. The alias can be secured if some counted pointer is handed.

Definition at line 149 of file VCMGeometricFunctors.h.

150 {
151 myVCMOnDigitalSurface = aVCMOnDigitalSurface;
152 }

References DGtal::functors::VCMAbsoluteCurvatureFunctor< TVCMOnDigitalSurface >::myVCMOnDigitalSurface.

◆ operator()()

template<typename TVCMOnDigitalSurface >
Quantity DGtal::functors::VCMAbsoluteCurvatureFunctor< TVCMOnDigitalSurface >::operator() ( const Surfel & s) const
inline

Map operator Surfel -> Scalar giving the absolute curvature estimated by the VCM object. Complexity is \( O(log n) \), if n is the number of surfels of the surface.

Parameters
sany surfel of the shape.
Returns
the normal at point p (as the normalized gradient).

Definition at line 161 of file VCMGeometricFunctors.h.

162 {
163 ASSERT( myVCMOnDigitalSurface != 0 );
164 RealVector lambda;
165 bool ok = myVCMOnDigitalSurface->getChiVCMEigenvalues( lambda, s );
166 ASSERT( ok ); boost::ignore_unused_variable_warning( ok );
167
168 // The last eigenvalue l1 is approximately the mixed "area" 8pi R^3 r / 3
169 // The curvature is related to the first eigenvalue l0.
170 // k1^2 = 3*l0 / (l1*r^2)
171 return sqrt( 3.0 * lambda[0] / lambda[1] ) / myVCMOnDigitalSurface->r();
172 }

References DGtal::functors::VCMAbsoluteCurvatureFunctor< TVCMOnDigitalSurface >::myVCMOnDigitalSurface.

Field Documentation

◆ myVCMOnDigitalSurface


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