DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DGtal::LocalConvolutionNormalVectorEstimator< TDigitalSurface, TKernelFunctor > Class Template Reference

#include <LocalConvolutionNormalVectorEstimator.h>

Public Types

typedef TDigitalSurface DigitalSurface
typedef TKernelFunctor KernelFunctor
typedef DigitalSurface Surface
typedef Surface::ConstIterator ConstIterator
typedef
Surface::KSpace::Space::RealVector 
Quantity
typedef Surface::SCell SCell

Public Member Functions

 BOOST_CONCEPT_ASSERT ((CConvolutionWeights< TKernelFunctor >))
 LocalConvolutionNormalVectorEstimator (const DigitalSurface &aSurface, const KernelFunctor &aFunctor)
 ~LocalConvolutionNormalVectorEstimator ()
const Surfacesurface () const
void init (const double h, const unsigned int radius)
Quantity eval (const SCell &scell) const
Quantity eval (const ConstIterator &it) const
template<typename OutputIterator >
OutputIterator eval (const ConstIterator &itb, const ConstIterator &ite, OutputIterator result) const
template<typename OutputIterator >
OutputIterator evalAll (OutputIterator result) const
bool isValid () const

Protected Member Functions

 LocalConvolutionNormalVectorEstimator ()

Private Member Functions

 LocalConvolutionNormalVectorEstimator (const LocalConvolutionNormalVectorEstimator &other)
LocalConvolutionNormalVectorEstimatoroperator= (const LocalConvolutionNormalVectorEstimator &other)

Private Attributes

double myH
bool myFlagIsInit
unsigned int myRadius
const DigitalSurfacemySurface
const KernelFunctormyKernelFunctor

Detailed Description

template<typename TDigitalSurface, typename TKernelFunctor>
class DGtal::LocalConvolutionNormalVectorEstimator< TDigitalSurface, TKernelFunctor >

Aim: Computes the normal vector at a surface element by convolution of elementary normal vector to adjacent surfel.

Description of template class 'LocalConvolutionNormalVectorEstimator'

A model of CNormalVectorEstimator.

To each $n-1$ signed surfel, an elementary inward normal vector can be defined. At a given surfel, this estimator will compute the convolution of elementary normal vector of neighboring surfels using a breadth-first propagation around the given surfel.

The neighboring is parametrized by a given topological radius R. The weight kernel function maps displacment vectors to a continuous weights.

Template Parameters:
TDigitalSurfacetype of digital surface on which we would like to compute vector field..
TKernelFunctortype of Functor used to represent convolution kernel functor (see BasicConvolutionKernels.h).

Definition at line 78 of file LocalConvolutionNormalVectorEstimator.h.


Member Typedef Documentation

template<typename TDigitalSurface, typename TKernelFunctor>
typedef Surface::ConstIterator DGtal::LocalConvolutionNormalVectorEstimator< TDigitalSurface, TKernelFunctor >::ConstIterator

Definition at line 87 of file LocalConvolutionNormalVectorEstimator.h.

template<typename TDigitalSurface, typename TKernelFunctor>
typedef TDigitalSurface DGtal::LocalConvolutionNormalVectorEstimator< TDigitalSurface, TKernelFunctor >::DigitalSurface

Definition at line 84 of file LocalConvolutionNormalVectorEstimator.h.

template<typename TDigitalSurface, typename TKernelFunctor>
typedef TKernelFunctor DGtal::LocalConvolutionNormalVectorEstimator< TDigitalSurface, TKernelFunctor >::KernelFunctor

Definition at line 85 of file LocalConvolutionNormalVectorEstimator.h.

template<typename TDigitalSurface, typename TKernelFunctor>
typedef Surface::KSpace::Space::RealVector DGtal::LocalConvolutionNormalVectorEstimator< TDigitalSurface, TKernelFunctor >::Quantity

Definition at line 88 of file LocalConvolutionNormalVectorEstimator.h.

template<typename TDigitalSurface, typename TKernelFunctor>
typedef Surface::SCell DGtal::LocalConvolutionNormalVectorEstimator< TDigitalSurface, TKernelFunctor >::SCell

Definition at line 89 of file LocalConvolutionNormalVectorEstimator.h.

template<typename TDigitalSurface, typename TKernelFunctor>
typedef DigitalSurface DGtal::LocalConvolutionNormalVectorEstimator< TDigitalSurface, TKernelFunctor >::Surface

Definition at line 86 of file LocalConvolutionNormalVectorEstimator.h.


Constructor & Destructor Documentation

template<typename TDigitalSurface, typename TKernelFunctor>
DGtal::LocalConvolutionNormalVectorEstimator< TDigitalSurface, TKernelFunctor >::LocalConvolutionNormalVectorEstimator ( const DigitalSurface aSurface,
const KernelFunctor aFunctor 
)

Constructor.

Parameters:
aSurfacesurface for which the normal vector are estimated.
aFunctorconvolution kernel functor.
template<typename TDigitalSurface, typename TKernelFunctor>
DGtal::LocalConvolutionNormalVectorEstimator< TDigitalSurface, TKernelFunctor >::~LocalConvolutionNormalVectorEstimator ( )
inline

Destructor.

Definition at line 107 of file LocalConvolutionNormalVectorEstimator.h.

{};
template<typename TDigitalSurface, typename TKernelFunctor>
DGtal::LocalConvolutionNormalVectorEstimator< TDigitalSurface, TKernelFunctor >::LocalConvolutionNormalVectorEstimator ( )
inlineprotected
template<typename TDigitalSurface, typename TKernelFunctor>
DGtal::LocalConvolutionNormalVectorEstimator< TDigitalSurface, TKernelFunctor >::LocalConvolutionNormalVectorEstimator ( const LocalConvolutionNormalVectorEstimator< TDigitalSurface, TKernelFunctor > &  other)
private

Copy constructor.

Parameters:
otherthe object to clone. Forbidden by default.

Member Function Documentation

template<typename TDigitalSurface, typename TKernelFunctor>
DGtal::LocalConvolutionNormalVectorEstimator< TDigitalSurface, TKernelFunctor >::BOOST_CONCEPT_ASSERT ( (CConvolutionWeights< TKernelFunctor >)  )
template<typename DigitalSurf , typename KernelFunctor >
DGtal::LocalConvolutionNormalVectorEstimator< DigitalSurf, KernelFunctor >::Quantity DGtal::LocalConvolutionNormalVectorEstimator< DigitalSurf, KernelFunctor >::eval ( const SCell scell) const
inline
Parameters:
scellany signed cell.
Returns:
the estimated quantity at cell scell.

Definition at line 132 of file LocalConvolutionNormalVectorEstimator.ih.

{
typedef BreadthFirstVisitor<DigitalSurf> MyBreadthFirstVisitor;
typedef typename MyBreadthFirstVisitor::Node MyNode;
typedef typename MyBreadthFirstVisitor::Size MySize;
MyBreadthFirstVisitor visitor ( mySurface, scell );
MyNode node;
Quantity n, elementary;
typename DigitalSurf::Surfel s;
const typename DigitalSurf::KSpace & K = mySurface.container().space();
ASSERT ( myFlagIsInit );
while ( ! visitor.finished() )
{
node = visitor.current();
if ( node.second < myRadius )
{
s = node.first;
i = K.sOrthDir ( s );
elementary[ i ] = K.sDirect ( s, i ) ? 1 : -1;
elementary *= myKernelFunctor ( node.second );
n+= elementary;
elementary [ i ] = 0;
visitor.expand();
}
else
visitor.ignore();
}
return n.getNormalized();
}
template<typename DigitalSurf , typename KernelFunctor >
DGtal::LocalConvolutionNormalVectorEstimator< DigitalSurf, KernelFunctor >::Quantity DGtal::LocalConvolutionNormalVectorEstimator< DigitalSurf, KernelFunctor >::eval ( const ConstIterator it) const
inline
Returns:
the estimated quantity at *it

Definition at line 123 of file LocalConvolutionNormalVectorEstimator.ih.

{
return eval ( *it );
}
template<typename DigitalSurf , typename KernelFunctor >
template<typename OutputIterator >
OutputIterator DGtal::LocalConvolutionNormalVectorEstimator< DigitalSurf, KernelFunctor >::eval ( const ConstIterator itb,
const ConstIterator ite,
OutputIterator  result 
) const
inline
Returns:
the estimated quantity from itb till ite (exculded)
the estimated quantity at *it from itb till ite

Definition at line 76 of file LocalConvolutionNormalVectorEstimator.ih.

{
for ( ConstIterator it = itb; it != ite; ++it )
{
Quantity q = eval( *it );
*result++ = q;
}
return result;
}
template<typename DigitalSurf , typename KernelFunctor >
template<typename OutputIterator >
OutputIterator DGtal::LocalConvolutionNormalVectorEstimator< DigitalSurf, KernelFunctor >::evalAll ( OutputIterator  result) const
inline

Writes on result the estimated quantity at all surfels of the digital surface.

Parameters:
resultany model of boost::OutputIterator on Quantity.
Returns:
the output iterator after the last write.

Definition at line 105 of file LocalConvolutionNormalVectorEstimator.ih.

{
for ( ConstIterator it = surface().begin(), it_end = surface().end();
it != it_end; ++it )
{
*result++ = eval ( *it );
}
return result;
}
template<typename DigitalSurf , typename KernelFunctor >
void DGtal::LocalConvolutionNormalVectorEstimator< DigitalSurf, KernelFunctor >::init ( const double  h,
const unsigned int  radius 
)
inline

Initialisation.

Parameters:
hgrid size (must be >0).
radiustopological radius used to specify the size of the convolution.

Init.

Definition at line 59 of file LocalConvolutionNormalVectorEstimator.ih.

{
myFlagIsInit = true;
myH = h;
myRadius = radius;
}
template<typename DigitalSurf , typename KernelFunctor >
bool DGtal::LocalConvolutionNormalVectorEstimator< DigitalSurf, KernelFunctor >::isValid ( ) const
inline

Checks the validity/consistency of the object.

Returns:
'true' if the object is valid, 'false' otherwise.

Definition at line 177 of file LocalConvolutionNormalVectorEstimator.ih.

{
return true;
}
template<typename TDigitalSurface, typename TKernelFunctor>
LocalConvolutionNormalVectorEstimator& DGtal::LocalConvolutionNormalVectorEstimator< TDigitalSurface, TKernelFunctor >::operator= ( const LocalConvolutionNormalVectorEstimator< TDigitalSurface, TKernelFunctor > &  other)
private

Assignment.

Parameters:
otherthe object to copy.
Returns:
a reference on 'this'. Forbidden by default.
template<typename DigitalSurf , typename KernelFunctor >
const DGtal::LocalConvolutionNormalVectorEstimator< DigitalSurf, KernelFunctor >::Surface & DGtal::LocalConvolutionNormalVectorEstimator< DigitalSurf, KernelFunctor >::surface ( ) const
inline
Returns:
a reference to the associated digital surface.

Definition at line 94 of file LocalConvolutionNormalVectorEstimator.ih.

{
return mySurface;
}

Field Documentation

template<typename TDigitalSurface, typename TKernelFunctor>
bool DGtal::LocalConvolutionNormalVectorEstimator< TDigitalSurface, TKernelFunctor >::myFlagIsInit
private
template<typename TDigitalSurface, typename TKernelFunctor>
double DGtal::LocalConvolutionNormalVectorEstimator< TDigitalSurface, TKernelFunctor >::myH
private

Grid size.

Definition at line 174 of file LocalConvolutionNormalVectorEstimator.h.

template<typename TDigitalSurface, typename TKernelFunctor>
const KernelFunctor& DGtal::LocalConvolutionNormalVectorEstimator< TDigitalSurface, TKernelFunctor >::myKernelFunctor
private

Reference of the kernel convolution functor.

Definition at line 186 of file LocalConvolutionNormalVectorEstimator.h.

template<typename TDigitalSurface, typename TKernelFunctor>
unsigned int DGtal::LocalConvolutionNormalVectorEstimator< TDigitalSurface, TKernelFunctor >::myRadius
private

Radius of the convolution.

Definition at line 180 of file LocalConvolutionNormalVectorEstimator.h.

template<typename TDigitalSurface, typename TKernelFunctor>
const DigitalSurface& DGtal::LocalConvolutionNormalVectorEstimator< TDigitalSurface, TKernelFunctor >::mySurface
private

Reference to the digital surface.

Definition at line 183 of file LocalConvolutionNormalVectorEstimator.h.


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