38 #include "DGtal/base/Common.h"
39 #include "DGtal/helpers/StdDefs.h"
40 #include "ConfigExamples.h"
44 #include "DGtal/base/BasicFunctors.h"
45 #include "DGtal/kernel/BasicPointPredicates.h"
46 #include "DGtal/io/readers/PNMReader.h"
47 #include "DGtal/images/ImageContainerBySTLVector.h"
51 #include "DGtal/topology/helpers/Surfaces.h"
55 #include "DGtal/geometry/curves/estimation/DSSLengthEstimator.h"
59 #include "DGtal/io/boards/Board2D.h"
62 #include "DGtal/geometry/curves/GreedySegmentation.h"
70 std::string filename = examplesPath +
"samples/contourS.pgm";
88 std::vector< std::vector< Z2i::SCell > > contours;
93 if (contours.size() > 0)
112 double length = DSSlength.
eval();
113 trace.
info() <<
"Length: " << length << endl;
117 typedef Z2i::Curve::PointsRange::ConstCirculator ConstCirculator;
121 Segmentation theSegmentation( r.c(), r.c(), SegmentComputer() );
122 Segmentation::SegmentComputerIterator i = theSegmentation.
begin();
123 Segmentation::SegmentComputerIterator end = theSegmentation.
end();
126 aBoard <<
SetMode(
"PointVector",
"Grid");
127 for ( ; i != end; ++i) {
128 aBoard <<
SetMode(i->className(),
"Points") << *i;
129 aBoard <<
SetMode(i->className(),
"BoundingBox") << *i;
131 aBoard.
saveEPS(
"DisplayDSSSegmentationTuto3.eps");
133 }
else trace.
info() <<
"no contour" << endl;