DGtal  1.0.0
LambdaMST3DBy2D.h
1 
17 #pragma once
18 
29 #if defined(LAMBDAMST3DBy2D_RECURSES)
30 #error Recursive header files inclusion detected in LambdaMST3DBy2D.h
31 #else // defined(LAMBDAMST3DBy2D_RECURSES)
32 
33 #define LAMBDAMST3DBy2D_RECURSES
34 
35 #if !defined LAMBDAMST3DBy2D_h
36 
37 #define LAMBDAMST3DBy2D_h
38 
39 #include <algorithm>
40 #include <cmath>
41 #include <list>
42 #include <iterator>
43 #include <DGtal/base/Common.h>
44 #include <DGtal/helpers/StdDefs.h>
45 #include "DGtal/kernel/CSpace.h"
46 #include "DGtal/kernel/PointVector.h"
47 #include "DGtal/kernel/BasicPointFunctors.h"
48 #include "DGtal/geometry/curves/estimation/LambdaMST2D.h"
49 #include "DGtal/geometry/curves/ArithmeticalDSSComputer.h"
50 #include "DGtal/geometry/curves/SaturatedSegmentation.h"
51 
52 namespace DGtal {
61  template < typename Iterator3D, typename Functor, typename LambdaFunctor, int CONNECTIVITY = 8 >
63  {
64  public:
65  // ----------------------- Types ------------------------------
66  public:
71  typedef std::vector < Point2D > TCurve2D;
74  typedef typename Functor::MAIN_AXIS MAIN_AXIS;
75 
76  // ----------------------- Private types ------------------------------
77  private:
80 
81  // ----------------------- Standard services ------------------------------
82  public:
84 
91  void init ( Iterator3D itB, Iterator3D itE, MAIN_AXIS axis );
92 
97  bool isValid ( ) const;
98 
103  RealVector3D eval ( const Point3D & point );
104 
114  template <typename OutputIterator>
115  OutputIterator eval ( Iterator3D itb, Iterator3D ite, OutputIterator result );
116 
117  // ------------------------- Internals ------------------------------------
118  protected:
119 
120  RealVector2D Estimate2DTangent ( TCurve2D::const_iterator itb, TCurve2D::const_iterator ite, const Point2D & point );
121  template < typename OutputIterator >
122  OutputIterator Estimate2DTangent ( TCurve2D::const_iterator itb, TCurve2D::const_iterator ite, OutputIterator result );
123 
124  // ------------------------- Private Datas --------------------------------
125  private:
126  Iterator3D myBegin;
127  Iterator3D myEnd;
133  }; // end of class LambdaMST3DBy2DEstimator
134 
135 
137  {
138  public:
139  // ----------------------- Types ------------------------------
142  enum MAIN_AXIS {X = 0, Y = 1, Z = 2};
143 
144  // ----------------------- Interface --------------------------------------
145  Vector3D operator() ( MAIN_AXIS mainAxis, const Vector2D & v0, const Vector2D & v1 ) const;
146  };
147 
148  //-------------------------------------------------------------------------------------------
149 
150  // Template class LambdaMST3D
155  template <
156  typename Iterator3D, typename LambdaFunctor = functors::Lambda64Function, int CONNECTIVITY = 8 >
158  public LambdaMST3DBy2DEstimator < Iterator3D, TangentFromDSS3DBy2DFunctor, LambdaFunctor, CONNECTIVITY >
159  {
161 
162  public:
167  };
168 }// namespace DGtal
169 
171 // Includes inline functions
172 #include "DGtal/geometry/curves/estimation/LambdaMST3DBy2D.ih"
173 
174 // //
176 
177 #endif // !defined LAMBDAMST3DBy2D_h
178 
179 #undef LAMBDAMST3DBy2D_RECURSES
180 #endif // else defined(LAMBDAMST3DBy2D_RECURSES)
InHalfPlaneBySimple3x3Matrix< Point, double > Functor
RealVector2D Estimate2DTangent(TCurve2D::const_iterator itb, TCurve2D::const_iterator ite, const Point2D &point)
SaturatedSegmentation< SegmentComputer2D > Segmentation2D
Aim: Functor that maps a point P of dimension i to a point Q of dimension j. The member myDims is an ...
ArithmeticalDSSComputer< typename TCurve2D::const_iterator, int, CONNECTIVITY > SegmentComputer2D
PointVector< 3, double > Vector3D
LambdaMST2D< Segmentation2D, LambdaFunctor > TEstimator
Aim: This class is a wrapper around ArithmeticalDSS that is devoted to the dynamic recognition of dig...
PointVector< 3, double > RealVector3D
RealVector3D eval(const Point3D &point)
functors::Projector< SpaceND< 2, int > > Projector2d
PointVector< 2, double > Vector2D
Aim: Simplify creation of Lambda MST tangent estimator.
Projector2d myProjXY
projectors
Aim: Simplify creation of Lambda MST tangent estimator.
Definition: LambdaMST2D.h:167
DGtal is the top-level namespace which contains all DGtal functions and types.
Vector3D operator()(MAIN_AXIS mainAxis, const Vector2D &v0, const Vector2D &v1) const
void init(Iterator3D itB, Iterator3D itE, MAIN_AXIS axis)
LambdaMST3DBy2DEstimator< Iterator3D, TangentFromDSS3DBy2DFunctor, LambdaFunctor, CONNECTIVITY > Super
Aim: Computes the saturated segmentation, that is the whole set of maximal segments within a range gi...
PointVector< 2, int > Point2D
std::vector< Point2D > TCurve2D
PointVector< 3, int > Point3D
PointVector< 2, double > RealVector2D