41#include "DGtal/base/Common.h"
42#include "DGtal/helpers/StdDefs.h"
44#include "ConfigExamples.h"
45#include "DGtal/io/boards/Board2D.h"
46#include "DGtal/geometry/curves/FrechetShortcut.h"
47#include "DGtal/geometry/curves/GreedySegmentation.h"
59int main(
int argc,
char** argv )
63 for (
int i = 0; i < argc; ++i )
72 trace.
info() <<
"Use default file and error value\n";
73 filename = examplesPath +
"samples/plant-frechet.dat";
79 trace.
info() <<
"Please enter a filename and error value.\n";
85 error = atof(argv[2]);
88 instream.open (filename.c_str(), ifstream::in);
111 while ( ( s.end() != r.
end() )
112 &&( s.extendFront() ) ) {}
123 Segmentation::SegmentComputerIterator it = theSegmentation.begin();
124 Segmentation::SegmentComputerIterator itEnd = theSegmentation.end();
126 for ( ; it != itEnd; ++it) {
132 board.
saveEPS(
"FrechetShortcutExample.eps", Board2D::BoundingBox, 5000 );
135 #ifdef DGTAL_WITH_CAIRO
136 board.
saveCairo(
"FrechetShortcutExample.png");
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Aim: model of CConstBidirectionalRange that adapts any range of elements bounded by two iterators [it...
ConstIterator begin() const
ConstIterator end() const
Aim: On-line computation Computation of the longest shortcut according to the Fréchet distance for a ...
Aim: Computes the greedy segmentation of a range given by a pair of ConstIterators....
Aim: describes, in a cellular space of dimension n, a closed or open sequence of signed d-cells (or d...
bool initFromVectorStream(std::istream &in)
PointsRange getPointsRange() const
ArrowsRange getArrowsRange() const
void beginBlock(const std::string &keyword="")
void saveEPS(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.
SaturatedSegmentation< SegmentComputer > Segmentation