35 #include "DGtal/base/Common.h"
36 #include "DGtal/io/boards/Board2D.h"
37 #include "DGtal/io/Color.h"
38 #include "DGtal/io/colormaps/GradientColorMap.h"
39 #include "DGtal/shapes/Shapes.h"
40 #include "DGtal/helpers/StdDefs.h"
41 #include "DGtal/geometry/curves/ArithmeticalDSS.h"
42 #include "DGtal/geometry/curves/FreemanChain.h"
43 #include "DGtal/geometry/curves/GreedySegmentation.h"
47 using namespace DGtal;
61 std::stringstream ss(stringstream::in | stringstream::out);
62 ss <<
"31 16 11121212121212212121212212122122222322323233323333333323333323303330330030300000100010010010001000101010101111" << endl;
65 Contour4 theContour( ss );
68 Decomposition4 theDecomposition( theContour.begin(),theContour.end(),DSS4() );
73 aBoard <<
SetMode( domain.className(),
"Grid" )
75 <<
SetMode(
"PointVector",
"Grid" )
78 aBoard <<
SetMode(
"ArithmeticalDSS",
"BoundingBox" );
79 string className =
"ArithmeticalDSS/BoundingBox";
80 for ( Decomposition4::SegmentComputerIterator i = theDecomposition.begin();
81 i != theDecomposition.end(); ++i )
84 std::cout << segment << std::endl;
90 aBoard.
saveSVG(
"dgtalboard-5-greedy-dss.svg");
91 aBoard.
saveSVG(
"dgtalboard-5-greedy-dss.eps");