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);
98 board << c.getArrowsRange();
111 while ( ( s.end() != r.end() )
112 &&( s.extendFront() ) ) {}
120 Segmentation theSegmentation( r.begin(), r.end(), Shortcut(error) );
126 for ( ; it != itEnd; ++it) {
132 board.
saveEPS(
"FrechetShortcutExample.eps", Board2D::BoundingBox, 5000 );
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...
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)
Aim: Specific iterator to visit all the maximal segments of a saturated segmentation.
Aim: Computes the saturated segmentation, that is the whole set of maximal segments within a range gi...
SaturatedSegmentation::SegmentComputerIterator end() const
SaturatedSegmentation::SegmentComputerIterator begin() 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