DGtal  0.9.3beta
Data Structures | Public Types | Public Member Functions | Private Attributes
DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate > Class Template Reference

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

Collaboration diagram for DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >:
[legend]

Data Structures

struct  CovarianceMatrix2NormalDirectionFunctor
 

Public Types

typedef IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate > Self
 
typedef TKSpace KSpace
 
typedef TPointPredicate PointPredicate
 
typedef KSpace::Space Space
 
typedef HyperRectDomain< SpaceDomain
 
typedef Space::Point Point
 
typedef Space::RealPoint RealPoint
 
typedef Space::RealVector RealVector
 
typedef DigitalSetSelector< Domain, BIG_DS+HIGH_VAR_DS >::Type DigitalSet
 
typedef KSpace::SCell Spel
 
typedef KSpace::Surfel Surfel
 
typedef KSpace::SurfelSet SurfelSet
 
typedef SurfelSet::const_iterator ConstIteratorKernel
 
typedef RealVector Quantity
 
typedef int Value
 
typedef PointFunctorFromPointPredicateAndDomain< PointPredicate, Domain, unsigned int > ShapePointFunctor
 
typedef FunctorOnCells< ShapePointFunctor, KSpaceShapeSpelFunctor
 
typedef functors::ConstValueCell< Value, SpelKernelSpelFunctor
 
typedef ImplicitBall< SpaceKernelSupport
 
typedef EuclideanShapesMinus< KernelSupport, KernelSupportEuclideanMinus
 
typedef GaussDigitizer< Space, KernelSupportDigitalShapeKernel
 
typedef GaussDigitizer< Space, EuclideanMinusDigitalShape
 
typedef DigitalSurfaceConvolver< ShapeSpelFunctor, KernelSpelFunctor, KSpace, DigitalShapeKernelConvolver
 
typedef Convolver::PairIterators PairIterators
 
typedef Convolver::CovarianceMatrix Matrix
 
typedef Matrix::Component Component
 
typedef double Scalar
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CCellularGridSpaceND< KSpace >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CPointPredicate< PointPredicate >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CCellFunctor< ShapeSpelFunctor >))
 
 IntegralInvariantNormalVectorEstimator ()
 
 IntegralInvariantNormalVectorEstimator (ConstAlias< KSpace > K, ConstAlias< PointPredicate > aPointPredicate)
 
 ~IntegralInvariantNormalVectorEstimator ()
 
 IntegralInvariantNormalVectorEstimator (const Self &other)
 
Selfoperator= (const Self &other)
 
void clear ()
 
Scalar h () const
 
void attach (ConstAlias< KSpace > K, ConstAlias< PointPredicate > aPointPredicate)
 
void setParams (const double dRadius)
 
template<typename SurfelConstIterator >
void init (const double _h, SurfelConstIterator itb, SurfelConstIterator ite)
 
template<typename SurfelConstIterator >
Quantity eval (SurfelConstIterator it) const
 
template<typename OutputIterator , typename SurfelConstIterator >
OutputIterator eval (SurfelConstIterator itb, SurfelConstIterator ite, OutputIterator result) const
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Private Attributes

const KernelSpelFunctor myKernelFunctor
 
std::vector< PairIteratorsmyKernels
 
std::vector< DigitalSet * > myKernelsSet
 
CountedPtr< KernelSupportmyKernel
 
CountedPtr< DigitalShapeKernelmyDigKernel
 
CountedConstPtrOrConstPtr< PointPredicatemyPointPredicate
 
CountedPtr< DomainmyShapeDomain
 
CountedPtr< ShapePointFunctormyShapePointFunctor
 
CountedPtr< ShapeSpelFunctormyShapeSpelFunctor
 
CountedPtr< ConvolvermyConvolver
 
Scalar myH
 
Scalar myRadius
 

Detailed Description

template<typename TKSpace, typename TPointPredicate>
class DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >

Aim: This class implement an Integral Invariant normal vector estimator.

Description of template class 'IntegralInvariantNormalVectorEstimator'

[19]

The algorithm we propose uses volume of a kernel (2D: Ball2D, 3D: Ball3D) to approximate the normal vector. To compute the volume, we convolve a kernel around the surface and then count the number of cells belonging the shape. Theorical multigrid convergence is proved, with a convergence speed of O(h^1/3) with hypothesis about the shape geometry and the convolution kernel radius. Experimental results showed a multigrid convergence.

Optimization is available when we give a range of 0-adjacent surfels to the estimator.

Template Parameters
TKSpacea model of CCellularGridSpaceND, the cellular space in which the shape is defined.
TPointPredicatea model of concepts::CPointPredicate, a predicate Point -> bool that defines a digital shape as a characteristic function.
Note
In opposition to IntegralInvariantMeanCurvatureEstimator and IntegralInvariantGaussianCurvatureEstimator, this class is parameterized by a point predicate instead of a functor spel -> {0,1}. The two latter classes should evolve as this one in a further release.
See also
testVoronoiCovarianceMeasureOnSurface.cpp

Definition at line 104 of file IntegralInvariantNormalVectorEstimator.h.

Member Typedef Documentation

template<typename TKSpace, typename TPointPredicate>
typedef Matrix::Component DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::Component

Definition at line 148 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef SurfelSet::const_iterator DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::ConstIteratorKernel

Definition at line 123 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef DigitalSurfaceConvolver<ShapeSpelFunctor, KernelSpelFunctor, KSpace, DigitalShapeKernel> DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::Convolver

Definition at line 145 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef DigitalSetSelector<Domain, BIG_DS + HIGH_VAR_DS>::Type DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::DigitalSet

Definition at line 119 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef GaussDigitizer< Space, EuclideanMinus > DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::DigitalShape

Definition at line 142 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef GaussDigitizer< Space, KernelSupport > DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::DigitalShapeKernel

Definition at line 141 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef HyperRectDomain<Space> DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::Domain

Definition at line 115 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef EuclideanShapesMinus< KernelSupport, KernelSupport > DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::EuclideanMinus

Definition at line 140 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef functors::ConstValueCell<Value, Spel> DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::KernelSpelFunctor

Definition at line 138 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef ImplicitBall<Space> DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::KernelSupport

Definition at line 139 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef TKSpace DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::KSpace

Definition at line 108 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef Convolver::CovarianceMatrix DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::Matrix

Definition at line 147 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef Convolver::PairIterators DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::PairIterators

Definition at line 146 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef Space::Point DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::Point

Definition at line 116 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef TPointPredicate DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::PointPredicate

Definition at line 109 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef RealVector DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::Quantity

The returned type of the estimator : a real-value vector.

Definition at line 126 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef Space::RealPoint DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::RealPoint

Definition at line 117 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef Space::RealVector DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::RealVector

Definition at line 118 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef double DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::Scalar

Definition at line 149 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate> DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::Self

Definition at line 107 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef PointFunctorFromPointPredicateAndDomain< PointPredicate, Domain, unsigned int > DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::ShapePointFunctor

A wrapper around point predicate (functor Point -> bool) that transforms it into a functor Point -> unsigned int (0 or 1).

Definition at line 132 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef FunctorOnCells< ShapePointFunctor, KSpace > DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::ShapeSpelFunctor

Adapts the a functor Point -> unsigned int (0 or 1) to a functor Cell -> unsigned int (0 ot 1), where Cell is a spel. Needed by DigitalSurfaceConvolver.

Definition at line 135 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef KSpace::Space DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::Space

Definition at line 114 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef KSpace::SCell DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::Spel

Definition at line 120 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef KSpace::Surfel DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::Surfel

Definition at line 121 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef KSpace::SurfelSet DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::SurfelSet

Definition at line 122 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
typedef int DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::Value

The type used for convolutions.

Definition at line 128 of file IntegralInvariantNormalVectorEstimator.h.

Constructor & Destructor Documentation

template<typename TKSpace, typename TPointPredicate>
DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::IntegralInvariantNormalVectorEstimator ( )

Default constructor. The object is invalid. The user needs to call setParams and attach.

template<typename TKSpace, typename TPointPredicate>
DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::IntegralInvariantNormalVectorEstimator ( ConstAlias< KSpace K,
ConstAlias< PointPredicate aPointPredicate 
)

Constructor.

Parameters
[in]Kthe cellular grid space in which the shape is defined.
[in]aPointPredicatethe shape of interest. The alias can be secured if a some counted pointer is handed.
template<typename TKSpace, typename TPointPredicate>
DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::~IntegralInvariantNormalVectorEstimator ( )

Destructor.

template<typename TKSpace, typename TPointPredicate>
DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::IntegralInvariantNormalVectorEstimator ( const Self other)

Copy constructor.

Parameters
otherthe object to clone.

Member Function Documentation

template<typename TKSpace, typename TPointPredicate>
void DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::attach ( ConstAlias< KSpace K,
ConstAlias< PointPredicate aPointPredicate 
)

Attach a shape, defined as a functor spel -> boolean

Parameters
[in]Kthe cellular grid space in which the shape is defined.
aPointPredicatethe shape of interest. The alias can be secured if a some counted pointer is handed.
template<typename TKSpace, typename TPointPredicate>
DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::BOOST_CONCEPT_ASSERT ( (concepts::CCellularGridSpaceND< KSpace >)  )
template<typename TKSpace, typename TPointPredicate>
DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::BOOST_CONCEPT_ASSERT ( (concepts::CPointPredicate< PointPredicate >)  )
template<typename TKSpace, typename TPointPredicate>
DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::BOOST_CONCEPT_ASSERT ( (concepts::CCellFunctor< ShapeSpelFunctor >)  )
template<typename TKSpace, typename TPointPredicate>
void DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::clear ( )

Clears the object. It is now invalid.

template<typename TKSpace, typename TPointPredicate>
template<typename SurfelConstIterator >
Quantity DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::eval ( SurfelConstIterator  it) const

– Normal vector –

Compute the integral invariant normal vector at surfel *it of a shape. Not so easy, since II is a symmetric matrix, only directions of eigenvectors are pertinent. Another computation is necessary to obtain the orientation.

Template Parameters
SurfelConstIteratortype of Iterator on a Surfel
Parameters
[in]ititerator pointing on the surfel of the shape where we wish to evaluate the normal vector.
Returns
quantity (normal vector) at surfel *it
template<typename TKSpace, typename TPointPredicate>
template<typename OutputIterator , typename SurfelConstIterator >
OutputIterator DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::eval ( SurfelConstIterator  itb,
SurfelConstIterator  ite,
OutputIterator  result 
) const

– Normal vector –

Compute the integral invariant normal vector from a range of surfels [itb,ite) of a shape. Not so easy, since II is a symmetric matrix, only directions of eigenvectors are pertinent. Another computation is necessary to obtain the orientation. Return the result on an OutputIterator (param).

Template Parameters
OutputIteratortype of Iterator of an array of Quantity
SurfelConstIteratortype of Iterator on a Surfel
Parameters
[in]itbiterator defining the start of the range of surfels where the normal vector is computed.
[in]iteiterator defining the end of the range of surfels where the normal vector is computed.
[in]resultoutput iterator of results of the computation.
Returns
the updated output iterator after all outputs.
template<typename TKSpace, typename TPointPredicate>
Scalar DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::h ( ) const
Returns
the grid step.
template<typename TKSpace, typename TPointPredicate>
template<typename SurfelConstIterator >
void DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::init ( const double  _h,
SurfelConstIterator  itb,
SurfelConstIterator  ite 
)

Model of CDigitalSurfaceLocalEstimator. Initialisation.

Template Parameters
SurfelConstIteratorany model of forward readable iterator on Surfel.
Parameters
[in]_hgrid size (must be >0).
[in]iteiterator on the first surfel of the surface.
[in]itbiterator after the last surfel of the surface.
template<typename TKSpace, typename TPointPredicate>
bool DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.
template<typename TKSpace, typename TPointPredicate>
Self& DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::operator= ( const Self other)

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'.
template<typename TKSpace, typename TPointPredicate>
void DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.
template<typename TKSpace, typename TPointPredicate>
void DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::setParams ( const double  dRadius)

Set specific parameters: the radius of the ball.

Parameters
[in]dRadiusthe "digital" radius of the kernel (buy may be non integer).

Field Documentation

template<typename TKSpace, typename TPointPredicate>
CountedPtr<Convolver> DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::myConvolver
private

Convolver.

Definition at line 313 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
CountedPtr<DigitalShapeKernel> DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::myDigKernel
private

Digital kernel.

Definition at line 308 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
Scalar DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::myH
private

precision of the grid

Definition at line 314 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
CountedPtr<KernelSupport> DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::myKernel
private

Euclidean kernel.

Definition at line 307 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
const KernelSpelFunctor DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::myKernelFunctor
private

Kernel functor (on Spel)

Definition at line 304 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
std::vector< PairIterators > DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::myKernels
private

array of begin/end iterator of shifting masks.

Definition at line 305 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
std::vector< DigitalSet * > DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::myKernelsSet
private

Array of shifting masks. Size = 9 for each shifting (0-adjacent and full kernel included)

Definition at line 306 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
CountedConstPtrOrConstPtr<PointPredicate> DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::myPointPredicate
private

Smart pointer (if required) on a point predicate.

Definition at line 309 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
Scalar DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::myRadius
private

"digital" radius of the kernel (buy may be non integer).

Definition at line 315 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
CountedPtr<Domain> DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::myShapeDomain
private

Smart pointer on domain.

Definition at line 310 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
CountedPtr<ShapePointFunctor> DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::myShapePointFunctor
private

Smart pointer on functor point -> {0,1}.

Definition at line 311 of file IntegralInvariantNormalVectorEstimator.h.

template<typename TKSpace, typename TPointPredicate>
CountedPtr<ShapeSpelFunctor> DGtal::deprecated::IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate >::myShapeSpelFunctor
private

Smart pointer on functor spel -> {0,1}.

Definition at line 312 of file IntegralInvariantNormalVectorEstimator.h.


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