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 )
61 trace.beginBlock (
"Example FrechetShortcut" );
62 trace.info() <<
"Args:";
63 for (
int i = 0; i < argc; ++i )
64 trace.info() <<
" " << argv[ 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);
100 trace.beginBlock(
"Simple example");
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) {
128 trace.info() << s << std::endl;
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 <<)....
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....
bool initFromVectorStream(std::istream &in)
PointsRange getPointsRange() const
ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToPoint< KSpace >, Point > PointsRange
ArrowsRange getArrowsRange() const
SaturatedSegmentation::SegmentComputerIterator end() const
SaturatedSegmentation::SegmentComputerIterator begin() const
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
Z2i this namespace gathers the standard of types for 2D imagery.
DGtal is the top-level namespace which contains all DGtal functions and types.
SaturatedSegmentation< SegmentComputer > Segmentation