DGtal  1.3.beta
IntegralInvariantCovarianceEstimator.h
1 
17 #pragma once
18 
34 #if defined(IntegralInvariantCovarianceEstimator_RECURSES)
35 #error Recursive header files inclusion detected in IntegralInvariantCovarianceEstimator.h
36 #else // defined(IntegralInvariantCovarianceEstimator_RECURSES)
37 
38 #define IntegralInvariantCovarianceEstimator_RECURSES
39 
40 #if !defined IntegralInvariantCovarianceEstimator_h
41 
42 #define IntegralInvariantCovarianceEstimator_h
43 
45 // Inclusions
46 #include <iostream>
47 #include "DGtal/base/Common.h"
48 
49 #include "DGtal/kernel/CPointPredicate.h"
50 #include "DGtal/kernel/BasicPointFunctors.h"
51 #include "DGtal/topology/CCellFunctor.h"
52 #include "DGtal/topology/CCellularGridSpaceND.h"
53 #include "DGtal/geometry/surfaces/FunctorOnCells.h"
54 
55 #include "DGtal/shapes/GaussDigitizer.h"
56 #include "DGtal/shapes/Shapes.h"
57 
58 #include "DGtal/geometry/surfaces/DigitalSurfaceConvolver.h"
59 #include "DGtal/geometry/surfaces/estimation/IIGeometricFunctors.h"
60 #include "DGtal/shapes/EuclideanShapesDecorator.h"
61 
62 #include "DGtal/shapes/implicit/ImplicitBall.h"
64 
65 
66 namespace DGtal
67 {
68 
70 // template class IntegralInvariantCovarianceEstimator
114 template <typename TKSpace, typename TPointPredicate, typename TCovarianceMatrixFunctor>
116 {
117 public:
119  typedef TKSpace KSpace;
120  typedef TPointPredicate PointPredicate;
121  typedef TCovarianceMatrixFunctor CovarianceMatrixFunctor;
122 
125 
126  typedef typename KSpace::Space Space;
128  typedef typename Space::Point Point;
129  typedef typename Space::RealPoint RealPoint;
130  typedef typename Space::RealVector RealVector;
132  typedef typename KSpace::SCell Spel;
133  typedef typename KSpace::Surfel Surfel;
134  typedef typename KSpace::SurfelSet SurfelSet;
135  typedef typename SurfelSet::const_iterator ConstIteratorKernel;
136 
138  typedef typename CovarianceMatrixFunctor::Quantity Quantity;
140  typedef int Value;
141 
148 
149 
155 
160  typedef typename Matrix::Component Component;
161  typedef double Scalar;
165  typename CovarianceMatrixFunctor::Argument >::value ));
166 
167 
168  // ----------------------- Standard services ------------------------------
169 public:
170 
179 
190  ConstAlias< PointPredicate > aPointPredicate,
192 
197 
203 
209  Self& operator= ( const Self& other );
210 
214  void clear();
215 
216  // ----------------------- Interface --------------------------------------
217 public:
218 
220  Scalar h() const;
221 
230  ConstAlias<PointPredicate> aPointPredicate );
231 
237  void setParams( const double dRadius );
238 
247  template <typename SurfelConstIterator>
248  void init( const double _h, SurfelConstIterator itb, SurfelConstIterator ite );
249 
264  template< typename SurfelConstIterator >
265  Quantity eval ( SurfelConstIterator it ) const;
266 
267 
288  template <typename OutputIterator, typename SurfelConstIterator>
289  OutputIterator eval( SurfelConstIterator itb,
290  SurfelConstIterator ite,
291  OutputIterator result ) const;
292 
297  void selfDisplay ( std::ostream & out ) const;
298 
303  bool isValid() const;
304 
305  // ------------------------- Private Datas --------------------------------
306 private:
307 
310  std::vector< PairIterators > myKernels;
311  std::vector< DigitalSet * > myKernelsSet;
321 
322 private:
323 
324 
325 }; // end of class IntegralInvariantCovarianceEstimator
326 
333  template <typename TKSpace, typename TPointPredicate, typename TCovarianceMatrixFunctor>
334  std::ostream&
335  operator<< ( std::ostream & out,
337 
338 } // namespace DGtal
339 
340 
342 // Includes inline functions.
343 #include "DGtal/geometry/surfaces/estimation/IntegralInvariantCovarianceEstimator.ih"
344 
345 // //
347 
348 #endif // !defined IntegralInvariantCovarianceEstimator_h
349 
350 #undef IntegralInvariantCovarianceEstimator_RECURSES
351 #endif // else defined(IntegralInvariantCovarianceEstimator_RECURSES)
DGtal::IntegralInvariantCovarianceEstimator::Value
int Value
The type used for convolutions.
Definition: IntegralInvariantCovarianceEstimator.h:140
DGtal::GaussDigitizer
Aim: A class for computing the Gauss digitization of some Euclidean shape, i.e. its intersection with...
Definition: GaussDigitizer.h:79
DGtal::IntegralInvariantCovarianceEstimator::~IntegralInvariantCovarianceEstimator
~IntegralInvariantCovarianceEstimator()
DGtal::IntegralInvariantCovarianceEstimator::myShapeDomain
CountedPtr< Domain > myShapeDomain
Smart pointer on domain
Definition: IntegralInvariantCovarianceEstimator.h:315
DGtal::IntegralInvariantCovarianceEstimator::myRadius
Scalar myRadius
"digital" radius of the kernel (but may be non integer).
Definition: IntegralInvariantCovarianceEstimator.h:320
DGtal::IntegralInvariantCovarianceEstimator::myH
Scalar myH
precision of the grid
Definition: IntegralInvariantCovarianceEstimator.h:319
DGtal::IntegralInvariantCovarianceEstimator::Matrix
Convolver::CovarianceMatrix Matrix
Definition: IntegralInvariantCovarianceEstimator.h:159
DGtal::ConstAlias
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:186
DGtal::HyperRectDomain< Space >
DGtal::IntegralInvariantCovarianceEstimator::myFct
CovarianceMatrixFunctor myFct
The covariance matrix functor that transforms the II covariance matrix into a quantity.
Definition: IntegralInvariantCovarianceEstimator.h:308
DGtal::KhalimskySpaceND::SurfelSet
std::set< SCell > SurfelSet
Preferred type for defining a set of surfels (always signed cells).
Definition: KhalimskySpaceND.h:450
DGtal::IntegralInvariantCovarianceEstimator::CovarianceMatrixFunctor
TCovarianceMatrixFunctor CovarianceMatrixFunctor
Definition: IntegralInvariantCovarianceEstimator.h:121
DGtal::IntegralInvariantCovarianceEstimator::myPointPredicate
CountedConstPtrOrConstPtr< PointPredicate > myPointPredicate
Smart pointer (if required) on a point predicate.
Definition: IntegralInvariantCovarianceEstimator.h:314
DGtal::IntegralInvariantCovarianceEstimator::myShapePointFunctor
CountedPtr< ShapePointFunctor > myShapePointFunctor
Smart pointer on functor point -> {0,1}.
Definition: IntegralInvariantCovarianceEstimator.h:316
DGtal::functors::PointFunctorFromPointPredicateAndDomain
Create a point functor from a point predicate and a domain.
Definition: BasicPointFunctors.h:570
DGtal::IntegralInvariantCovarianceEstimator::ConstIteratorKernel
SurfelSet::const_iterator ConstIteratorKernel
Definition: IntegralInvariantCovarianceEstimator.h:135
DGtal::concepts::CCellFunctor
Aim: Defines a functor on cells.
Definition: CCellFunctor.h:89
DGtal::IntegralInvariantCovarianceEstimator::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CCellularGridSpaceND< KSpace >))
DGtal::concepts::CCellularGridSpaceND
Aim: This concept describes a cellular grid space in nD. In these spaces obtained by cartesian produc...
Definition: CCellularGridSpaceND.h:162
K
KSpace K
Definition: testCubicalComplex.cpp:62
DGtal::IntegralInvariantCovarianceEstimator::Quantity
CovarianceMatrixFunctor::Quantity Quantity
The returned type of the estimator, depends on the functor.
Definition: IntegralInvariantCovarianceEstimator.h:138
DGtal::IntegralInvariantCovarianceEstimator::ShapeSpelFunctor
FunctorOnCells< ShapePointFunctor, KSpace > ShapeSpelFunctor
Definition: IntegralInvariantCovarianceEstimator.h:147
DGtal::IntegralInvariantCovarianceEstimator
Aim: This class implement an Integral Invariant estimator which computes for each surfel the covarian...
Definition: IntegralInvariantCovarianceEstimator.h:115
DGtal::IntegralInvariantCovarianceEstimator::IntegralInvariantCovarianceEstimator
IntegralInvariantCovarianceEstimator(CovarianceMatrixFunctor fct=CovarianceMatrixFunctor())
DGtal::IntegralInvariantCovarianceEstimator::RealPoint
Space::RealPoint RealPoint
Definition: IntegralInvariantCovarianceEstimator.h:129
DGtal::IntegralInvariantCovarianceEstimator::myKernel
CountedPtr< KernelSupport > myKernel
Euclidean kernel.
Definition: IntegralInvariantCovarianceEstimator.h:312
DGtal::SignedKhalimskyCell
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
Definition: KhalimskySpaceND.h:208
DGtal::IntegralInvariantCovarianceEstimator::PairIterators
Convolver::PairIterators PairIterators
Definition: IntegralInvariantCovarianceEstimator.h:158
DGtal::IntegralInvariantCovarianceEstimator::eval
Quantity eval(SurfelConstIterator it) const
DGtal::IntegralInvariantCovarianceEstimator::h
Scalar h() const
DGtal::IntegralInvariantCovarianceEstimator::operator=
Self & operator=(const Self &other)
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::SpaceND
Definition: SpaceND.h:95
DGtal::IntegralInvariantCovarianceEstimator::ShapePointFunctor
functors::PointFunctorFromPointPredicateAndDomain< PointPredicate, Domain, unsigned int > ShapePointFunctor
Definition: IntegralInvariantCovarianceEstimator.h:144
DGtal::IntegralInvariantCovarianceEstimator::Point
Space::Point Point
Definition: IntegralInvariantCovarianceEstimator.h:128
DGtal::CountedConstPtrOrConstPtr< PointPredicate >
DGtal::SimpleMatrix
Aim: implements basic MxN Matrix services (M,N>=1).
Definition: SimpleMatrix.h:75
DGtal::IntegralInvariantCovarianceEstimator::setParams
void setParams(const double dRadius)
DGtal::IntegralInvariantCovarianceEstimator::Scalar
double Scalar
Definition: IntegralInvariantCovarianceEstimator.h:161
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::IntegralInvariantCovarianceEstimator::Self
IntegralInvariantCovarianceEstimator< TKSpace, TPointPredicate, TCovarianceMatrixFunctor > Self
Definition: IntegralInvariantCovarianceEstimator.h:118
DGtal::EuclideanShapesCSG
Aim: Constructive Solid Geometry (CSG) between models of CEuclideanBoundedShape and CEuclideanOriente...
Definition: EuclideanShapesDecorator.h:67
DGtal::FunctorOnCells
Aim: Convert a functor on Digital Point to a Functor on Khalimsky Cell.
Definition: FunctorOnCells.h:70
DGtal::ImplicitBall
Aim: model of CEuclideanOrientedShape and CEuclideanBoundedShape concepts to create a ball in nD....
Definition: ImplicitBall.h:64
DGtal::IntegralInvariantCovarianceEstimator::DigitalSet
DigitalSetSelector< Domain, BIG_DS+HIGH_VAR_DS >::Type DigitalSet
Definition: IntegralInvariantCovarianceEstimator.h:131
DGtal::IntegralInvariantCovarianceEstimator::RealVector
Space::RealVector RealVector
Definition: IntegralInvariantCovarianceEstimator.h:130
DGtal::functors::ConstValueCell
Aim: Define a simple functor that returns a constant quantity (0 by default).
Definition: BasicFunctors.h:353
DGtal::IntegralInvariantCovarianceEstimator::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((concepts::ConceptUtils::SameType< typename Convolver::CovarianceMatrix, typename CovarianceMatrixFunctor::Argument >::value))
DGtal::IntegralInvariantCovarianceEstimator::Spel
KSpace::SCell Spel
Definition: IntegralInvariantCovarianceEstimator.h:132
DGtal::IntegralInvariantCovarianceEstimator::KSpace
TKSpace KSpace
Definition: IntegralInvariantCovarianceEstimator.h:119
DGtal::IntegralInvariantCovarianceEstimator::myKernelFunctor
const KernelSpelFunctor myKernelFunctor
Kernel functor (on Spel)
Definition: IntegralInvariantCovarianceEstimator.h:309
DGtal::IntegralInvariantCovarianceEstimator::KernelSupport
ImplicitBall< Space > KernelSupport
Definition: IntegralInvariantCovarianceEstimator.h:151
DGtal::CountedPtr
Aim: Smart pointer based on reference counts.
Definition: CountedPtr.h:79
DGtal::IntegralInvariantCovarianceEstimator::myKernels
std::vector< PairIterators > myKernels
array of begin/end iterator of shifting masks.
Definition: IntegralInvariantCovarianceEstimator.h:310
DGtal::concepts::ConceptUtils::SameType
Definition: ConceptUtils.h:106
DGtal::IntegralInvariantCovarianceEstimator::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::SimpleMatrix::Component
TComponent Component
Definition: SimpleMatrix.h:79
DGtal::IntegralInvariantCovarianceEstimator::DigitalShape
GaussDigitizer< Space, EuclideanMinus > DigitalShape
Definition: IntegralInvariantCovarianceEstimator.h:154
DGtal::IntegralInvariantCovarianceEstimator::Domain
HyperRectDomain< Space > Domain
Definition: IntegralInvariantCovarianceEstimator.h:127
DGtal::IntegralInvariantCovarianceEstimator::EuclideanMinus
EuclideanShapesCSG< KernelSupport, KernelSupport > EuclideanMinus
Definition: IntegralInvariantCovarianceEstimator.h:152
DGtal::IntegralInvariantCovarianceEstimator::Convolver
DigitalSurfaceConvolver< ShapeSpelFunctor, KernelSpelFunctor, KSpace, DigitalShapeKernel > Convolver
Definition: IntegralInvariantCovarianceEstimator.h:157
DGtal::IntegralInvariantCovarianceEstimator::isValid
bool isValid() const
DGtal::PointVector< dim, Integer >
DGtal::DigitalSurfaceConvolver::PairIterators
std::pair< KernelConstIterator, KernelConstIterator > PairIterators
Definition: DigitalSurfaceConvolver.h:97
DGtal::DigitalSurfaceConvolver
Definition: DigitalSurfaceConvolver.h:76
DGtal::IntegralInvariantCovarianceEstimator::Component
Matrix::Component Component
Definition: IntegralInvariantCovarianceEstimator.h:160
DGtal::concepts::CPointPredicate
Aim: Defines a predicate on a point.
Definition: CPointPredicate.h:80
DGtal::IntegralInvariantCovarianceEstimator::myKernelsSet
std::vector< DigitalSet * > myKernelsSet
Array of shifting masks. Size = 9 for each shifting (0-adjacent and full kernel included)
Definition: IntegralInvariantCovarianceEstimator.h:311
DGtal::IntegralInvariantCovarianceEstimator::myShapeSpelFunctor
CountedPtr< ShapeSpelFunctor > myShapeSpelFunctor
Smart pointer on functor spel -> {0,1}.
Definition: IntegralInvariantCovarianceEstimator.h:317
DGtal::IntegralInvariantCovarianceEstimator::attach
void attach(ConstAlias< KSpace > K, ConstAlias< PointPredicate > aPointPredicate)
DGtal::IntegralInvariantCovarianceEstimator::Space
KSpace::Space Space
Definition: IntegralInvariantCovarianceEstimator.h:126
DGtal::IntegralInvariantCovarianceEstimator::DigitalShapeKernel
GaussDigitizer< Space, KernelSupport > DigitalShapeKernel
Definition: IntegralInvariantCovarianceEstimator.h:153
DGtal::IntegralInvariantCovarianceEstimator::myConvolver
CountedPtr< Convolver > myConvolver
Convolver.
Definition: IntegralInvariantCovarianceEstimator.h:318
DGtal::IntegralInvariantCovarianceEstimator::KernelSpelFunctor
functors::ConstValueCell< Value, Spel > KernelSpelFunctor
Definition: IntegralInvariantCovarianceEstimator.h:150
DGtal::IntegralInvariantCovarianceEstimator::SurfelSet
KSpace::SurfelSet SurfelSet
Definition: IntegralInvariantCovarianceEstimator.h:134
DGtal::concepts::CUnaryFunctor
Aim: Defines a unary functor, which associates arguments to results.
Definition: CUnaryFunctor.h:89
DGtal::IntegralInvariantCovarianceEstimator::myDigKernel
CountedPtr< DigitalShapeKernel > myDigKernel
Digital kernel.
Definition: IntegralInvariantCovarianceEstimator.h:313
DGtal::IntegralInvariantCovarianceEstimator::Surfel
KSpace::Surfel Surfel
Definition: IntegralInvariantCovarianceEstimator.h:133
DGtal::IntegralInvariantCovarianceEstimator::init
void init(const double _h, SurfelConstIterator itb, SurfelConstIterator ite)
DGtal::DigitalSetByAssociativeContainer
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
Definition: DigitalSetByAssociativeContainer.h:89
DGtal::IntegralInvariantCovarianceEstimator::PointPredicate
TPointPredicate PointPredicate
Definition: IntegralInvariantCovarianceEstimator.h:120
DGtal::IntegralInvariantCovarianceEstimator::clear
void clear()