DGtal  1.5.beta
exampleLMST2D.cpp File Reference
#include <iostream>
#include <iterator>
#include <vector>
#include "DGtal/base/Common.h"
#include "DGtal/base/BasicTypes.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/geometry/curves/ArithmeticalDSSComputer.h"
#include "DGtal/geometry/curves/SaturatedSegmentation.h"
#include "DGtal/geometry/curves/estimation/LambdaMST2D.h"
Include dependency graph for exampleLMST2D.cpp:

Go to the source code of this file.

Functions

int main ()
 

Detailed Description

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Author
Kacper Pluta (kacpe.nosp@m.r.pl.nosp@m.uta@e.nosp@m.siee.nosp@m..fr ) Laboratoire d'Informatique Gaspard-Monge - LIGM, France
Date
2015/09/27

An example file named LambdaMST2D.

This file is part of the DGtal library.

Definition in file exampleLMST2D.cpp.

Function Documentation

◆ main()

int main ( void  )

[LambdaMST2DStandardCtor]

[LambdaMST2DStandardCtor]

[LambdaMST2DTangential]

[LambdaMST2DTangential]

[LambdaMST2DPoint]

[LambdaMST2DPoint]

[LambdaMST2DFast]

[LambdaMST2DFast]

Definition at line 62 of file exampleLMST2D.cpp.

63 {
65  typedef vector < Point > Container;
66  typedef Container::const_iterator ConstIterator;
71 
72  // Input points
73  Container contour;
74  contour.push_back(Point(18,18));
75  contour.push_back(Point(17,19));
76  contour.push_back(Point(16,20));
77  contour.push_back(Point(15,21));
78  contour.push_back(Point(14,22));
79  contour.push_back(Point(13,23));
80  contour.push_back(Point(12,24));
81  contour.push_back(Point(11,25));
82  contour.push_back(Point(10,26));
83  contour.push_back(Point(9,27));
84  contour.push_back(Point(8,28));
85 
87  // Initialization of tangential cover
88  Segmentation segmenter ( contour.begin(), contour.end(), SegmentComputer() );
89  lmst.attach ( segmenter );
91 
93  for ( ConstIterator it = contour.begin(); it != contour.end(); ++it )
94  lmst.eval ( *it );
96 
98  lmst.init ( contour.begin(), contour.end() );
99  std::vector < RealVector > tangent;
100  lmst.eval < back_insert_iterator< vector < RealVector > > > ( contour.begin(), contour.end(), back_inserter ( tangent ) );
102 
103  return 0;
104 }
Aim: This class is a wrapper around ArithmeticalDSS that is devoted to the dynamic recognition of dig...
RealVector eval(const Point &p)
void init(ConstIterator itb, ConstIterator ite)
void attach(Alias< TSegmentation > SegmentComputer)
Aim: Simplify creation of Lambda MST tangent estimator.
Definition: LambdaMST2D.h:170
Aim: Computes the saturated segmentation, that is the whole set of maximal segments within a range gi...
MyDigitalSurface::ConstIterator ConstIterator
ArithmeticalDSSComputer< std::vector< Z2i::Point >::const_iterator, int, 4 > SegmentComputer
SaturatedSegmentation< SegmentComputer > Segmentation
MyPointD Point
Definition: testClone2.cpp:383

References DGtal::LambdaMST2DEstimator< TSpace, TSegmentation, Functor >::attach(), DGtal::LambdaMST2DEstimator< TSpace, TSegmentation, Functor >::eval(), and DGtal::LambdaMST2DEstimator< TSpace, TSegmentation, Functor >::init().