DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
exampleLMST3DBy2D.cpp
1
16
29
30
39
40
42
#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
;
66
LambdaMST3DBy2D < ConstIterator > lmst;
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
// //
DGtal::ConstIterator
DGtal::LambdaMST3DBy2DEstimator::init
void init(Iterator3D itB, Iterator3D itE, MAIN_AXIS axis)
DGtal::LambdaMST3DBy2DEstimator::eval
RealVector3D eval(const Point3D &point)
DGtal::Point
DGtal::Trace::info
std::ostream & info()
DGtal::Z3i
Z3i this namespace gathers the standard of types for 3D imagery.
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::trace
Trace trace
std
STL namespace.
main
int main(int, char **)
Definition
testIntegerComputer.cpp:331
examples
geometry
curves
estimation
exampleLMST3DBy2D.cpp
Generated on
for DGtal by
1.18.0