DGtal  1.0.0
exampleLMST3DBy2D.cpp
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/estimation/LambdaMST3DBy2D.h"
53 
54 
55 using namespace std;
56 using namespace DGtal;
57 using namespace Z3i;
58 
60 
61 int main()
62 {
64  typedef vector < Point > Container;
65  typedef Container::const_iterator ConstIterator;
68 
69  // Input points
70  Container contour;
71  contour.push_back ( Point ( 18, 25, 18 ) );
72  contour.push_back ( Point ( 17, 25, 19 ) );
73  contour.push_back ( Point ( 16, 25, 20 ) );
74  contour.push_back ( Point ( 15, 25, 21 ) );
75  contour.push_back ( Point ( 14, 25, 22 ) );
76  contour.push_back ( Point ( 13, 25, 23 ) );
77  contour.push_back ( Point ( 12, 25, 24 ) );
78  contour.push_back ( Point ( 11, 25, 25 ) );
79  contour.push_back ( Point ( 10, 25, 26 ) );
80  contour.push_back ( Point ( 9, 25, 27 ) );
81  contour.push_back ( Point ( 8, 25, 28 ) );
82 
83  lmst.init ( contour.cbegin ( ), contour.cend ( ), LambdaMST3DBy2D < ConstIterator >::MAIN_AXIS::X ) ;
85  for ( const auto & p : contour )
86  trace.info ( ) << lmst.eval ( p ) << std::endl;
88 
90  lmst.init ( contour.cbegin ( ), contour.cend ( ), LambdaMST3DBy2D < ConstIterator >::MAIN_AXIS::X );
91  vector < RealVector > tangent;
92  lmst.eval ( contour.cbegin ( ), contour.cend ( ), back_insert_iterator < vector < RealVector > > ( tangent ) );
94  for ( const auto & t : tangent )
95  trace.info ( ) << t << std::endl;
96  return 0;
97 }
98 // //
MyDigitalSurface::ConstIterator ConstIterator
Trace trace
Definition: Common.h:144
Aim: Simplify creation of Lambda MST tangent estimator.
int main(int argc, char **argv)
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & info()