DGtal  0.9.2
exampleLMST3D.cpp
1 
30 #include <iostream>
32 #include <iterator>
33 #include <vector>
34 #include "DGtal/base/Common.h"
35 #include "DGtal/base/BasicTypes.h"
36 #include "DGtal/helpers/StdDefs.h"
37 
39 #include "DGtal/geometry/curves/Naive3DDSSComputer.h"
40 #include "DGtal/geometry/curves/SaturatedSegmentation.h"
41 #include "DGtal/geometry/curves/estimation/LambdaMST3D.h"
44 
45 
46 using namespace std;
47 using namespace DGtal;
48 using namespace Z3i;
49 
51 
52 int main()
53 {
55  typedef vector < Point > Container;
56  typedef Container::const_iterator ConstIterator;
57  typedef Naive3DDSSComputer < ConstIterator, int, 8 > SegmentComputer;
58  typedef SaturatedSegmentation < SegmentComputer > Segmentation;
61 
62  // Input points
63  Container contour;
64  contour.push_back(Point(18,25,18));
65  contour.push_back(Point(17,25,19));
66  contour.push_back(Point(16,25,20));
67  contour.push_back(Point(15,25,21));
68  contour.push_back(Point(14,25,22));
69  contour.push_back(Point(13,25,23));
70  contour.push_back(Point(12,25,24));
71  contour.push_back(Point(11,25,25));
72  contour.push_back(Point(10,25,26));
73  contour.push_back(Point(9,25,27));
74  contour.push_back(Point(8,25,28));
75 
77  // Initialization of tangential cover
78  Segmentation segmenter ( contour.begin(), contour.end(), SegmentComputer() );
79  lmst.attach ( segmenter );
81 
83  for ( ConstIterator it = contour.begin(); it != contour.end(); ++it )
84  lmst.eval ( it );
86 
88  lmst.init ( contour.begin(), contour.end() );
89  std::vector < RealVector > tangent;
90  lmst.eval < std::back_insert_iterator< std::vector < RealVector > > > ( contour.begin(), contour.end(), std::back_insert_iterator< vector < RealVector > > ( tangent ) );
92 
93  return 1;
94 }
95 // //
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.
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...