DGtal 1.4.0
Loading...
Searching...
No Matches
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)
33#define LAMBDAMST3DBy2D_RECURSES
34
35#if !defined LAMBDAMST3DBy2D_h
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
52namespace DGtal {
61 template < typename Iterator3D, typename Functor, typename LambdaFunctor, int CONNECTIVITY = 8 >
63 {
64 public:
65 // ----------------------- Types ------------------------------
66 public:
67 typedef PointVector < 3, double > RealVector3D;
68 typedef PointVector < 3, int > Point3D;
69 typedef PointVector < 2, int > Point2D;
70 typedef PointVector < 2, double > RealVector2D;
71 typedef std::vector < Point2D > TCurve2D;
72 typedef ArithmeticalDSSComputer < typename TCurve2D::const_iterator, int, CONNECTIVITY > SegmentComputer2D;
73 typedef SaturatedSegmentation < SegmentComputer2D > Segmentation2D;
74 typedef typename Functor::MAIN_AXIS MAIN_AXIS;
75
76 // ----------------------- Private types ------------------------------
77 private:
78 typedef LambdaMST2D < Segmentation2D, LambdaFunctor > TEstimator;
79 typedef functors::Projector < SpaceND < 2, int > > Projector2d;
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;
128 Functor myFunctor;
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)
OutputIterator eval(Iterator3D itb, Iterator3D ite, OutputIterator result)
OutputIterator Estimate2DTangent(TCurve2D::const_iterator itb, TCurve2D::const_iterator ite, OutputIterator result)
PointVector< 2, double > RealVector2D
PointVector< 2, int > Point2D
SaturatedSegmentation< SegmentComputer2D > Segmentation2D
PointVector< 3, int > Point3D
void init(Iterator3D itB, Iterator3D itE, MAIN_AXIS axis)
PointVector< 3, double > RealVector3D
RealVector3D eval(const Point3D &point)
LambdaMST2D< Segmentation2D, LambdaFunctor > TEstimator
std::vector< Point2D > TCurve2D
RealVector2D Estimate2DTangent(TCurve2D::const_iterator itb, TCurve2D::const_iterator ite, const Point2D &point)
ArithmeticalDSSComputer< typename TCurve2D::const_iterator, int, CONNECTIVITY > SegmentComputer2D
functors::Projector< SpaceND< 2, int > > Projector2d
Aim: Simplify creation of Lambda MST tangent estimator.
LambdaMST3DBy2DEstimator< Iterator3D, TangentFromDSS3DBy2DFunctor, LambdaFunctor, CONNECTIVITY > Super
PointVector< 2, double > Vector2D
PointVector< 3, double > Vector3D
Vector3D operator()(MAIN_AXIS mainAxis, const Vector2D &v0, const Vector2D &v1) const
DGtal is the top-level namespace which contains all DGtal functions and types.