DGtal  0.9.3
exampleLMST3D.cpp
Go to the documentation of this file.
1 
41 #include <iostream>
43 #include <iterator>
44 #include <vector>
45 #include "DGtal/base/Common.h"
46 #include "DGtal/base/BasicTypes.h"
47 #include "DGtal/helpers/StdDefs.h"
48 
50 #include "DGtal/geometry/curves/Naive3DDSSComputer.h"
51 #include "DGtal/geometry/curves/SaturatedSegmentation.h"
52 #include "DGtal/geometry/curves/estimation/LambdaMST3D.h"
55 
56 
57 using namespace std;
58 using namespace DGtal;
59 using namespace Z3i;
60 
62 
63 int main()
64 {
66  typedef vector < Point > Container;
67  typedef Container::const_iterator ConstIterator;
68  typedef Naive3DDSSComputer < ConstIterator, int, 8 > SegmentComputer;
69  typedef SaturatedSegmentation < SegmentComputer > Segmentation;
72 
73  // Input points
74  Container contour;
75  contour.push_back(Point(18,25,18));
76  contour.push_back(Point(17,25,19));
77  contour.push_back(Point(16,25,20));
78  contour.push_back(Point(15,25,21));
79  contour.push_back(Point(14,25,22));
80  contour.push_back(Point(13,25,23));
81  contour.push_back(Point(12,25,24));
82  contour.push_back(Point(11,25,25));
83  contour.push_back(Point(10,25,26));
84  contour.push_back(Point(9,25,27));
85  contour.push_back(Point(8,25,28));
86 
88  // Initialization of tangential cover
89  Segmentation segmenter ( contour.begin(), contour.end(), SegmentComputer() );
90  lmst.attach ( segmenter );
92 
94  for ( ConstIterator it = contour.begin(); it != contour.end(); ++it )
95  lmst.eval ( it );
97 
99  lmst.init ( contour.begin(), contour.end() );
100  std::vector < RealVector > tangent;
101  lmst.eval < std::back_insert_iterator< std::vector < RealVector > > > ( contour.begin(), contour.end(), std::back_insert_iterator< vector < RealVector > > ( tangent ) );
103 
104  return 1;
105 }
106 // //
int main()
MyDigitalSurface::ConstIterator ConstIterator
Aim: Simplify creation of Lambda MST tangent estimator.
Definition: LambdaMST3D.h:173
STL namespace.
DGtal is the top-level namespace which contains all DGtal functions and types.
MyPointD Point
Definition: testClone2.cpp:383
Aim: Dynamic recognition of a 3d-digital straight segment (DSS)
Aim: Computes the saturated segmentation, that is the whole set of maximal segments within a range gi...