43 #include "ConfigExamples.h"
44 #include "DGtal/helpers/StdDefs.h"
45 #include "DGtal/base/Common.h"
46 #include "DGtal/geometry/curves/AlphaThickSegmentComputer.h"
47 #include "DGtal/io/boards/Board2D.h"
48 #include "DGtal/geometry/curves/GreedySegmentation.h"
49 #include <DGtal/io/readers/GenericReader.h>
53 using namespace DGtal;
59 trace.
beginBlock (
"Example of greedy alpha thick segment decompotion" );
61 typedef std::vector<Z2i::RealPoint>::const_iterator
ConstIterator;
65 std::string file = examplesPath +
"samples/contourSnoisy.sdp";
71 aBoard <<
SetMode(aContour[0].className(),
"Grid");
72 std::vector<LibBoard::Point> poly;
73 for (
unsigned int i = 0; i< aContour.size(); i++) poly.push_back(
LibBoard::Point(aContour[i][0], aContour[i][1]));
79 aBoard <<
SetMode(
"AlphaThickSegment",
"BoundingBox");
83 DecompositionAT theDecomposition(aContour.begin(), aContour.end(), AlphaThickSegmentComputer2D(4));
87 for ( DecompositionAT::SegmentComputerIterator
88 it = theDecomposition.begin(),
89 itEnd = theDecomposition.end();
98 aBoard.
saveEPS(
"greedyAlphaThickDecomposition.eps");
Aim: This class is devoted to the recognition of alpha thick segments as described in ....
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....
void beginBlock(const std::string &keyword="")
Board & setPenColor(const DGtal::Color &color)
void fillPolyline(const std::vector< Point > &points, int depthValue=-1)
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
MyDigitalSurface::ConstIterator ConstIterator
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.
Aim: Implements method to read a set of points represented in each line of a file.
Modifier class in a Board2D stream. Useful to choose your own mode for a given class....
Struct representing a 2D point.