This example shows the basic usage of a naive 3D DSS recognition.
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/base/BasicTypes.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/geometry/curves/Naive3DDSSComputer.h"
{
using namespace Z3i;
typedef std::vector<Z3::Point> Container;
DSSComputer theDSSComputer;
Container contour;
contour.push_back(Z3::Point(18,25,18));
contour.push_back(Z3::Point(17,25,19));
contour.push_back(Z3::Point(16,25,20));
contour.push_back(Z3::Point(15,25,21));
contour.push_back(Z3::Point(14,25,22));
contour.push_back(Z3::Point(13,25,23));
contour.push_back(Z3::Point(12,25,24));
contour.push_back(Z3::Point(11,25,25));
contour.push_back(Z3::Point(10,25,26));
contour.push_back(Z3::Point(9,25,27));
contour.push_back(Z3::Point(8,25,28));
theDSSComputer.
init( contour.begin() );
while ( ( theDSSComputer.end() != contour.end() ) &&
( theDSSComputer.extendFront() ) ) {}
theDSSComputer.selfDisplay( cout );
theDSSComputer.validArithmeticalDSS2d( 0 );
DSSComputer::ArithmeticalDSSComputer2d theDSS = theDSSComputer.arithmeticalDSS2d( 0 );
DSSComputer::Point3d directionZ3;
DSSComputer::PointR3d intercept;
DSSComputer::PointR3d thikness;
theDSSComputer.getParameters ( directionZ3, intercept, thikness );
return 1;
}
Aim: Dynamic recognition of a 3d-digital straight segment (DSS)
void init(const ConstIterator &it)
MyDigitalSurface::ConstIterator ConstIterator
DGtal is the top-level namespace which contains all DGtal functions and types.