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.
- See also
- Digital straight lines and segments
#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 std;
{
using namespace Z2i;
typedef std::vector<Z2::Point> Container;
typedef StandardDSS4Computer<ConstIterator> DSSComputer;
DSSComputer theDSSComputer;
Container contour;
theDSSComputer.init( contour.begin() );
while ( ( theDSSComputer.end() != contour.end() ) &&
( theDSSComputer.extendFront() ) ) {}
cout << theDSSComputer << endl;
DSSComputer::Primitive theDSS = theDSSComputer.primitive();
cout << theDSS << endl;
return 1;
}
MyDigitalSurface::ConstIterator ConstIterator
DGtal is the top-level namespace which contains all DGtal functions and types.
int main(int argc, char **argv)