DGtal  1.1.0
IntegralInvariantNormalVectorEstimator.h
1 
17 #pragma once
18 
38 #if defined(IntegralInvariantNormalVectorEstimator_RECURSES)
39 #error Recursive header files inclusion detected in IntegralInvariantNormalVectorEstimator.h
40 #else // defined(IntegralInvariantNormalVectorEstimator_RECURSES)
41 
42 #define IntegralInvariantNormalVectorEstimator_RECURSES
43 
44 #if !defined IntegralInvariantNormalVectorEstimator_h
45 
46 #define IntegralInvariantNormalVectorEstimator_h
47 
49 // Inclusions
50 #include <iostream>
51 #include "DGtal/base/Common.h"
52 
53 #include "DGtal/kernel/CPointPredicate.h"
54 #include "DGtal/kernel/BasicPointFunctors.h"
55 #include "DGtal/topology/CCellFunctor.h"
56 #include "DGtal/topology/CCellularGridSpaceND.h"
57 #include "DGtal/geometry/surfaces/FunctorOnCells.h"
58 
59 #include "DGtal/shapes/GaussDigitizer.h"
60 #include "DGtal/shapes/Shapes.h"
61 
62 #include "DGtal/geometry/surfaces/DigitalSurfaceConvolver.h"
63 #include "DGtal/shapes/EuclideanShapesDecorator.h"
64 
65 #include "DGtal/shapes/implicit/ImplicitBall.h"
67 
68 
69 namespace DGtal
70 {
71 
72 namespace deprecated
73 {
74 
76 // template class IntegralInvariantNormalVectorEstimator
103 template <typename TKSpace, typename TPointPredicate>
105 {
106 public:
108  typedef TKSpace KSpace;
109  typedef TPointPredicate PointPredicate;
110 
113 
114  typedef typename KSpace::Space Space;
116  typedef typename Space::Point Point;
117  typedef typename Space::RealPoint RealPoint;
118  typedef typename Space::RealVector RealVector;
120  typedef typename KSpace::SCell Spel;
121  typedef typename KSpace::Surfel Surfel;
122  typedef typename KSpace::SurfelSet SurfelSet;
123  typedef typename SurfelSet::const_iterator ConstIteratorKernel;
124 
128  typedef int Value;
129 
132  typedef PointFunctorFromPointPredicateAndDomain< PointPredicate, Domain, unsigned int > ShapePointFunctor;
136 
137 
143 
148  typedef typename Matrix::Component Component;
149  typedef double Scalar;
151 
157  typedef Matrix Argument;
158  typedef Quantity Value;
162  Self& operator=( const Self& /* other */ ) { return *this; }
163  Value operator()( const Argument& arg ) const
164  {
167  return eigenVectors.column( 0 ); // normal vector is associated to smallest eigenvalue.
168  }
171  };
172 
173  // ----------------------- Standard services ------------------------------
174 public:
175 
181 
190  ConstAlias< PointPredicate > aPointPredicate );
191 
196 
202 
208  Self& operator= ( const Self& other );
209 
213  void clear();
214 
215  // ----------------------- Interface --------------------------------------
216 public:
217 
219  Scalar h() const;
220 
229  ConstAlias<PointPredicate> aPointPredicate );
230 
236  void setParams( const double dRadius );
237 
246  template <typename SurfelConstIterator>
247  void init( const double _h, SurfelConstIterator itb, SurfelConstIterator ite );
248 
263  template< typename SurfelConstIterator >
264  Quantity eval ( SurfelConstIterator it ) const;
265 
266 
284  template <typename OutputIterator, typename SurfelConstIterator>
285  OutputIterator eval( SurfelConstIterator itb,
286  SurfelConstIterator ite,
287  OutputIterator result ) const;
288 
293  void selfDisplay ( std::ostream & out ) const;
294 
299  bool isValid() const;
300 
301  // ------------------------- Private Datas --------------------------------
302 private:
303 
305  std::vector< PairIterators > myKernels;
306  std::vector< DigitalSet * > myKernelsSet;
316 
317 private:
318 
319 
320 }; // end of class IntegralInvariantNormalVectorEstimator
321 
322 } // namespace deprecated
323 
330  template <typename TKSpace, typename TPointPredicate>
331  std::ostream&
332  operator<< ( std::ostream & out,
334 
335 } // namespace DGtal
336 
337 
339 // Includes inline functions.
340 #include "DGtal/geometry/surfaces/estimation/IntegralInvariantNormalVectorEstimator.ih"
341 
342 // //
344 
345 #endif // !defined IntegralInvariantNormalVectorEstimator_h
346 
347 #undef IntegralInvariantNormalVectorEstimator_RECURSES
348 #endif // else defined(IntegralInvariantNormalVectorEstimator_RECURSES)
DGtal::GaussDigitizer
Aim: A class for computing the Gauss digitization of some Euclidean shape, i.e. its intersection with...
Definition: GaussDigitizer.h:80
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::myDigKernel
CountedPtr< DigitalShapeKernel > myDigKernel
Digital kernel.
Definition: IntegralInvariantNormalVectorEstimator.h:308
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::isValid
bool isValid() const
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::CovarianceMatrix2NormalDirectionFunctor::Argument
Matrix Argument
Definition: IntegralInvariantNormalVectorEstimator.h:157
DGtal::ConstAlias
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:187
DGtal::HyperRectDomain< Space >
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::CovarianceMatrix2NormalDirectionFunctor::Value
Quantity Value
Definition: IntegralInvariantNormalVectorEstimator.h:158
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::Point
Space::Point Point
Definition: IntegralInvariantNormalVectorEstimator.h:116
DGtal::KhalimskySpaceND::SurfelSet
std::set< SCell > SurfelSet
Preferred type for defining a set of surfels (always signed cells).
Definition: KhalimskySpaceND.h:450
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CPointPredicate< PointPredicate >))
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::DigitalSet
DigitalSetSelector< Domain, BIG_DS+HIGH_VAR_DS >::Type DigitalSet
Definition: IntegralInvariantNormalVectorEstimator.h:119
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::CovarianceMatrix2NormalDirectionFunctor
Definition: IntegralInvariantNormalVectorEstimator.h:156
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::Spel
KSpace::SCell Spel
Definition: IntegralInvariantNormalVectorEstimator.h:120
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::Domain
HyperRectDomain< Space > Domain
Definition: IntegralInvariantNormalVectorEstimator.h:115
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::myKernelFunctor
const KernelSpelFunctor myKernelFunctor
Kernel functor (on Spel)
Definition: IntegralInvariantNormalVectorEstimator.h:304
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::myShapePointFunctor
CountedPtr< ShapePointFunctor > myShapePointFunctor
Smart pointer on functor point -> {0,1}.
Definition: IntegralInvariantNormalVectorEstimator.h:311
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::init
void init(const double _h, SurfelConstIterator itb, SurfelConstIterator ite)
DGtal::EigenDecomposition::getEigenDecomposition
static void getEigenDecomposition(const Matrix &matrix, Matrix &eigenVectors, Vector &eigenValues)
Compute both eigen vectors and eigen values from an input matrix.
DGtal::concepts::CCellFunctor
Aim: Defines a functor on cells.
Definition: CCellFunctor.h:90
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::Self
IntegralInvariantNormalVectorEstimator< TKSpace, TPointPredicate > Self
Definition: IntegralInvariantNormalVectorEstimator.h:107
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::PointPredicate
TPointPredicate PointPredicate
Definition: IntegralInvariantNormalVectorEstimator.h:109
DGtal::concepts::CCellularGridSpaceND
Aim: This concept describes a cellular grid space in nD. In these spaces obtained by cartesian produc...
Definition: CCellularGridSpaceND.h:164
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::eval
Quantity eval(SurfelConstIterator it) const
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::CovarianceMatrix2NormalDirectionFunctor::CovarianceMatrix2NormalDirectionFunctor
CovarianceMatrix2NormalDirectionFunctor()
Definition: IntegralInvariantNormalVectorEstimator.h:160
K
KSpace K
Definition: testCubicalComplex.cpp:62
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::Convolver
DigitalSurfaceConvolver< ShapeSpelFunctor, KernelSpelFunctor, KSpace, DigitalShapeKernel > Convolver
Definition: IntegralInvariantNormalVectorEstimator.h:145
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::DigitalShape
GaussDigitizer< Space, EuclideanMinus > DigitalShape
Definition: IntegralInvariantNormalVectorEstimator.h:142
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::operator=
Self & operator=(const Self &other)
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::myKernel
CountedPtr< KernelSupport > myKernel
Euclidean kernel.
Definition: IntegralInvariantNormalVectorEstimator.h:307
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::CovarianceMatrix2NormalDirectionFunctor::CovarianceMatrix2NormalDirectionFunctor
CovarianceMatrix2NormalDirectionFunctor(const Self &)
Definition: IntegralInvariantNormalVectorEstimator.h:161
DGtal::SignedKhalimskyCell
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
Definition: KhalimskySpaceND.h:209
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::SurfelSet
KSpace::SurfelSet SurfelSet
Definition: IntegralInvariantNormalVectorEstimator.h:122
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::myShapeSpelFunctor
CountedPtr< ShapeSpelFunctor > myShapeSpelFunctor
Smart pointer on functor spel -> {0,1}.
Definition: IntegralInvariantNormalVectorEstimator.h:312
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::PairIterators
Convolver::PairIterators PairIterators
Definition: IntegralInvariantNormalVectorEstimator.h:146
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CCellularGridSpaceND< KSpace >))
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::myConvolver
CountedPtr< Convolver > myConvolver
Convolver.
Definition: IntegralInvariantNormalVectorEstimator.h:313
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::clear
void clear()
DGtal::SpaceND
Definition: SpaceND.h:96
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::myShapeDomain
CountedPtr< Domain > myShapeDomain
Smart pointer on domain
Definition: IntegralInvariantNormalVectorEstimator.h:310
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::RealVector
Space::RealVector RealVector
Definition: IntegralInvariantNormalVectorEstimator.h:118
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::CovarianceMatrix2NormalDirectionFunctor::operator()
Value operator()(const Argument &arg) const
Definition: IntegralInvariantNormalVectorEstimator.h:163
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::eval
OutputIterator eval(SurfelConstIterator itb, SurfelConstIterator ite, OutputIterator result) const
DGtal::SimpleMatrix::column
ColumnVector column(const DGtal::Dimension j) const
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::KSpace
TKSpace KSpace
Definition: IntegralInvariantNormalVectorEstimator.h:108
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::EuclideanMinus
EuclideanShapesMinus< KernelSupport, KernelSupport > EuclideanMinus
Definition: IntegralInvariantNormalVectorEstimator.h:140
DGtal::CountedConstPtrOrConstPtr< PointPredicate >
DGtal::SimpleMatrix
Aim: implements basic MxN Matrix services (M,N>=1).
Definition: SimpleMatrix.h:76
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::Value
int Value
The type used for convolutions.
Definition: IntegralInvariantNormalVectorEstimator.h:128
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::Space
KSpace::Space Space
Definition: IntegralInvariantNormalVectorEstimator.h:114
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::ShapeSpelFunctor
FunctorOnCells< ShapePointFunctor, KSpace > ShapeSpelFunctor
Definition: IntegralInvariantNormalVectorEstimator.h:135
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::DigitalShapeKernel
GaussDigitizer< Space, KernelSupport > DigitalShapeKernel
Definition: IntegralInvariantNormalVectorEstimator.h:141
DGtal::FunctorOnCells
Aim: Convert a functor on Digital Point to a Functor on Khalimsky Cell.
Definition: FunctorOnCells.h:71
DGtal::ImplicitBall
Aim: model of CEuclideanOrientedShape and CEuclideanBoundedShape concepts to create a ball in nD....
Definition: ImplicitBall.h:65
DGtal::functors::ConstValueCell
Aim: Define a simple functor that returns a constant quantity (0 by default).
Definition: BasicFunctors.h:354
DGtal::deprecated::EuclideanShapesMinus
Aim: Minus between two models of CEuclideanBoundedShape and CEuclideanOrientedShape.
Definition: EuclideanShapesDecorator.h:634
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::ShapePointFunctor
PointFunctorFromPointPredicateAndDomain< PointPredicate, Domain, unsigned int > ShapePointFunctor
Definition: IntegralInvariantNormalVectorEstimator.h:132
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::CovarianceMatrix2NormalDirectionFunctor::eigenVectors
Matrix eigenVectors
Definition: IntegralInvariantNormalVectorEstimator.h:169
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::myKernels
std::vector< PairIterators > myKernels
array of begin/end iterator of shifting masks.
Definition: IntegralInvariantNormalVectorEstimator.h:305
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::IntegralInvariantNormalVectorEstimator
IntegralInvariantNormalVectorEstimator(const Self &other)
DGtal::CountedPtr
Aim: Smart pointer based on reference counts.
Definition: CountedPtr.h:80
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::myKernelsSet
std::vector< DigitalSet * > myKernelsSet
Array of shifting masks. Size = 9 for each shifting (0-adjacent and full kernel included)
Definition: IntegralInvariantNormalVectorEstimator.h:306
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::h
Scalar h() const
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::KernelSpelFunctor
functors::ConstValueCell< Value, Spel > KernelSpelFunctor
Definition: IntegralInvariantNormalVectorEstimator.h:138
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CCellFunctor< ShapeSpelFunctor >))
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::Component
Matrix::Component Component
Definition: IntegralInvariantNormalVectorEstimator.h:148
DGtal::SimpleMatrix::Component
TComponent Component
Definition: SimpleMatrix.h:79
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::~IntegralInvariantNormalVectorEstimator
~IntegralInvariantNormalVectorEstimator()
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::KernelSupport
ImplicitBall< Space > KernelSupport
Definition: IntegralInvariantNormalVectorEstimator.h:139
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::IntegralInvariantNormalVectorEstimator
IntegralInvariantNormalVectorEstimator()
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::CovarianceMatrix2NormalDirectionFunctor::Self
CovarianceMatrix2NormalDirectionFunctor Self
Definition: IntegralInvariantNormalVectorEstimator.h:159
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::CovarianceMatrix2NormalDirectionFunctor::eigenValues
RealVector eigenValues
Definition: IntegralInvariantNormalVectorEstimator.h:170
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::CovarianceMatrix2NormalDirectionFunctor::operator=
Self & operator=(const Self &)
Definition: IntegralInvariantNormalVectorEstimator.h:162
DGtal::PointVector< dim, Integer >
DGtal::DigitalSurfaceConvolver::PairIterators
std::pair< KernelConstIterator, KernelConstIterator > PairIterators
Definition: DigitalSurfaceConvolver.h:97
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::myPointPredicate
CountedConstPtrOrConstPtr< PointPredicate > myPointPredicate
Smart pointer (if required) on a point predicate.
Definition: IntegralInvariantNormalVectorEstimator.h:309
DGtal::DigitalSurfaceConvolver
Definition: DigitalSurfaceConvolver.h:77
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::myRadius
Scalar myRadius
"digital" radius of the kernel (buy may be non integer).
Definition: IntegralInvariantNormalVectorEstimator.h:315
DGtal::concepts::CPointPredicate
Aim: Defines a predicate on a point.
Definition: CPointPredicate.h:81
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::IntegralInvariantNormalVectorEstimator
IntegralInvariantNormalVectorEstimator(ConstAlias< KSpace > K, ConstAlias< PointPredicate > aPointPredicate)
DGtal::deprecated::IntegralInvariantNormalVectorEstimator
Aim: This class implement an Integral Invariant normal vector estimator.
Definition: IntegralInvariantNormalVectorEstimator.h:105
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::setParams
void setParams(const double dRadius)
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::Scalar
double Scalar
Definition: IntegralInvariantNormalVectorEstimator.h:149
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::Matrix
Convolver::CovarianceMatrix Matrix
Definition: IntegralInvariantNormalVectorEstimator.h:147
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::myH
Scalar myH
precision of the grid
Definition: IntegralInvariantNormalVectorEstimator.h:314
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::Surfel
KSpace::Surfel Surfel
Definition: IntegralInvariantNormalVectorEstimator.h:121
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::attach
void attach(ConstAlias< KSpace > K, ConstAlias< PointPredicate > aPointPredicate)
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::ConstIteratorKernel
SurfelSet::const_iterator ConstIteratorKernel
Definition: IntegralInvariantNormalVectorEstimator.h:123
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::Quantity
RealVector Quantity
The returned type of the estimator : a real-value vector.
Definition: IntegralInvariantNormalVectorEstimator.h:126
DGtal::DigitalSetByAssociativeContainer
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
Definition: DigitalSetByAssociativeContainer.h:90
DGtal::deprecated::IntegralInvariantNormalVectorEstimator::RealPoint
Space::RealPoint RealPoint
Definition: IntegralInvariantNormalVectorEstimator.h:117