This example shows the basic usage of a 4-connected standard segment computer, an object devoted to the on-line recognition of 4-connected standard DSSs.
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/base/BasicTypes.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/geometry/curves/ArithmeticalDSSComputer.h"
{
using namespace Z2i;
typedef std::vector<Z2::Point> Container;
DSSComputer theDSSComputer;
Container contour;
contour.push_back(Z2::Point(0,0));
contour.push_back(Z2::Point(1,0));
contour.push_back(Z2::Point(1,1));
contour.push_back(Z2::Point(2,1));
contour.push_back(Z2::Point(3,1));
contour.push_back(Z2::Point(3,2));
contour.push_back(Z2::Point(4,2));
contour.push_back(Z2::Point(5,2));
contour.push_back(Z2::Point(6,2));
contour.push_back(Z2::Point(6,3));
contour.push_back(Z2::Point(6,4));
theDSSComputer.
init( contour.begin() );
while ( ( theDSSComputer.end() != contour.end() ) &&
( theDSSComputer.extendFront() ) ) {}
cout << theDSSComputer << endl;
DSSComputer::Primitive theDSS = theDSSComputer.primitive();
cout << theDSS << endl;
return 1;
}
Aim: This class is a wrapper around ArithmeticalDSS that is devoted to the dynamic recognition of dig...
void init(const ConstIterator &it)
MyDigitalSurface::ConstIterator ConstIterator
DGtal is the top-level namespace which contains all DGtal functions and types.