This example outputs a greedy segmentation of an open and 6-connected 3d digital curve into DSSs.
#include <iostream>
#include "DGtal/io/viewers/PolyscopeViewer.h"
#include "DGtal/io/readers/PointListReader.h"
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "ConfigExamples.h"
#include "DGtal/geometry/curves/StandardDSS6Computer.h"
#include "DGtal/geometry/curves/GreedySegmentation.h"
int main(
int argc,
char** argv )
{
typedef std::vector<Point>::iterator
Iterator;
string inputFilename = examplesPath + "samples/sinus.dat";
Decomposition theDecomposition(sequence.begin(), sequence.end(), algo);
#ifdef DGTAL_WITH_POLYSCOPE
PolyscopeViewer viewer;
#endif
unsigned int c = 0;
Decomposition::SegmentComputerIterator i = theDecomposition.begin();
for ( ; i != theDecomposition.end(); ++i) {
#ifdef DGTAL_WITH_POLYSCOPE
viewer << currentSegmentComputer;
viewer << currentSegmentComputer;
#endif
c++;
}
#ifdef DGTAL_WITH_POLYSCOPE
#endif
}
void drawAsGrid(bool toggle=true)
Aim: Computes the greedy segmentation of a range given by a pair of ConstIterators....
Aim: Implements basic operations that will be used in Point and Vector classes.
void show() override
Starts the event loop and display of elements.
Aim: Dynamic recognition of a 3d-digital straight segment (DSS)
Z3i this namespace gathers the standard of types for 3D imagery.
DGtal is the top-level namespace which contains all DGtal functions and types.
static std::vector< TPoint > getPointsFromFile(const std::string &filename, std::vector< unsigned int > aVectPosition=std::vector< unsigned int >())
ArithmeticalDSSComputer< std::vector< Z2i::Point >::const_iterator, int, 4 > SegmentComputer