53 #include "DGtal/base/Common.h"
54 #include "DGtal/io/boards/Board2D.h"
55 #include "DGtal/io/Color.h"
56 #include "DGtal/io/colormaps/GradientColorMap.h"
57 #include "DGtal/shapes/Shapes.h"
58 #include "DGtal/helpers/StdDefs.h"
59 #include "DGtal/geometry/curves/ArithmeticalDSSComputer.h"
60 #include "DGtal/geometry/curves/FreemanChain.h"
61 #include "DGtal/geometry/curves/GreedySegmentation.h"
65 using namespace DGtal;
79 std::stringstream ss(stringstream::in | stringstream::out);
80 ss <<
"31 16 11121212121212212121212212122122222322323233323333333323333323303330330030300000100010010010001000101010101111" << endl;
83 Contour4 theContour( ss );
86 Decomposition4 theDecomposition( theContour.begin(),theContour.end(),DSS4() );
95 <<
SetMode(
"PointVector",
"Grid" );
98 string styleName =
"";
99 for ( Decomposition4::SegmentComputerIterator
100 it = theDecomposition.begin(),
101 itEnd = theDecomposition.end();
104 aBoard <<
SetMode(
"ArithmeticalDSS",
"Points" )
106 aBoard <<
SetMode(
"ArithmeticalDSS",
"BoundingBox" )
113 aBoard.
saveSVG(
"greedy-dss-decomposition.svg");
114 aBoard.
saveEPS(
"greedy-dss-decomposition.eps");
116 aBoard.
saveCairo(
"greedy-dss-decomposition.png");
Aim: This class is a wrapper around ArithmeticalDSS that is devoted to the dynamic recognition of dig...
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Aim: Computes the greedy segmentation of a range given by a pair of ConstIterators....
std::string className() const
void beginBlock(const std::string &keyword="")
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
void saveSVG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
void saveCairo(const char *filename, CairoType type=CairoPNG, PageSize size=Board::BoundingBox, double margin=10.0) const
DGtal is the top-level namespace which contains all DGtal functions and types.
Custom style class redefining the pen color. You may use Board2D::Color::None for transparent color.
Modifier class in a Board2D stream. Useful to choose your own mode for a given class....