DGtal  1.1.0
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 using namespace DGtal::functors;
61 
63 
64 int main()
65 {
67  typedef vector < Point > Container;
68  typedef Container::const_iterator ConstIterator;
69  typedef Naive3DDSSComputer < ConstIterator, int, 8 > SegmentComputer;
70  typedef SaturatedSegmentation < SegmentComputer > Segmentation;
73 
74  // Input points
75  Container contour;
76  contour.push_back(Point(18,25,18));
77  contour.push_back(Point(17,25,19));
78  contour.push_back(Point(16,25,20));
79  contour.push_back(Point(15,25,21));
80  contour.push_back(Point(14,25,22));
81  contour.push_back(Point(13,25,23));
82  contour.push_back(Point(12,25,24));
83  contour.push_back(Point(11,25,25));
84  contour.push_back(Point(10,25,26));
85  contour.push_back(Point(9,25,27));
86  contour.push_back(Point(8,25,28));
87 
89  // Initialization of tangential cover
90  Segmentation segmenter ( contour.begin(), contour.end(), SegmentComputer() );
91  lmst.attach ( segmenter );
93 
95  lmst.getDSSFilter ( ).init ( 7 );
97 
99  for ( ConstIterator it = contour.begin(); it != contour.end(); ++it )
100  lmst.eval ( *it );
102 
104  lmst.init ( contour.begin(), contour.end() );
105  std::vector < RealVector > tangent;
106  lmst.eval < std::back_insert_iterator< std::vector < RealVector > > > ( contour.begin(), contour.end(), std::back_insert_iterator< vector < RealVector > > ( tangent ) );
108 
109  return 0;
110 }
111 // //
ConstIterator
MyDigitalSurface::ConstIterator ConstIterator
Definition: greedy-plane-segmentation-ex2.cpp:93
DGtal::LambdaMST3DEstimator< Z3i::Space, DSSSegmentationComputer, TangentFromDSS3DFunctor< DSSSegmentationComputer::SegmentComputer, functors::Lambda64Function >, DSSMuteFilter< typename DSSSegmentationComputer::SegmentComputer > >::getDSSFilter
DSSMuteFilter< typename DSSSegmentationComputer::SegmentComputer > & getDSSFilter()
DGtal::functors
functors namespace gathers all DGtal functors.
Definition: BasicBoolFunctors.h:49
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
DGtal::LambdaMST3DEstimator< Z3i::Space, DSSSegmentationComputer, TangentFromDSS3DFunctor< DSSSegmentationComputer::SegmentComputer, functors::Lambda64Function >, DSSMuteFilter< typename DSSSegmentationComputer::SegmentComputer > >::attach
void attach(Alias< DSSSegmentationComputer > segmentComputer)
DGtal::LambdaMST3DEstimator< Z3i::Space, DSSSegmentationComputer, TangentFromDSS3DFunctor< DSSSegmentationComputer::SegmentComputer, functors::Lambda64Function >, DSSMuteFilter< typename DSSSegmentationComputer::SegmentComputer > >::eval
RealVector eval(const Point &p)
DGtal::LambdaMST3D
Aim: Simplify creation of Lambda MST tangent estimator.
Definition: LambdaMST3D.h:212
DGtal::LambdaMST3DEstimator< Z3i::Space, DSSSegmentationComputer, TangentFromDSS3DFunctor< DSSSegmentationComputer::SegmentComputer, functors::Lambda64Function >, DSSMuteFilter< typename DSSSegmentationComputer::SegmentComputer > >::init
void init(ConstIterator itb, ConstIterator ite)
main
int main()
Definition: exampleLMST3D.cpp:64
DGtal::Naive3DDSSComputer
Aim: Dynamic recognition of a 3d-digital straight segment (DSS)
Definition: Naive3DDSSComputer.h:98
DGtal::SaturatedSegmentation
Aim: Computes the saturated segmentation, that is the whole set of maximal segments within a range gi...
Definition: SaturatedSegmentation.h:154
Point
MyPointD Point
Definition: testClone2.cpp:383