This example shows the basic usage of the Lambda maximal segment tangent estimation in 3D.
#include <iostream>
#include <iterator>
#include <vector>
#include "DGtal/base/Common.h"
#include "DGtal/base/BasicTypes.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/geometry/curves/Naive3DDSSComputer.h"
#include "DGtal/geometry/curves/SaturatedSegmentation.h"
#include "DGtal/geometry/curves/estimation/LambdaMST3D.h"
using namespace Z3i;
{
typedef vector < Point > Container;
typedef SaturatedSegmentation < SegmentComputer >
Segmentation;
LambdaMST3D < Segmentation, Lambda64Function, DSSLengthLessEqualFilter < SegmentComputer > > lmst;
Container contour;
contour.push_back(
Point(18,25,18));
contour.push_back(
Point(17,25,19));
contour.push_back(
Point(16,25,20));
contour.push_back(
Point(15,25,21));
contour.push_back(
Point(14,25,22));
contour.push_back(
Point(13,25,23));
contour.push_back(
Point(12,25,24));
contour.push_back(
Point(11,25,25));
contour.push_back(
Point(10,25,26));
contour.push_back(
Point(9,25,27));
contour.push_back(
Point(8,25,28));
for (
ConstIterator it = contour.begin(); it != contour.end(); ++it )
lmst.
init ( contour.begin(), contour.end() );
std::vector < RealVector > tangent;
lmst.
eval < std::back_insert_iterator< std::vector < RealVector > > > ( contour.begin(), contour.end(), std::back_insert_iterator< vector < RealVector > > ( tangent ) );
return 0;
}
void attach(Alias< TSegmentation > segmentComputer)
RealVector eval(const Point &p)
void init(ConstIterator itb, ConstIterator ite)
DSSFilter & getDSSFilter()
MyDigitalSurface::ConstIterator ConstIterator
functors namespace gathers all DGtal functors.
DGtal is the top-level namespace which contains all DGtal functions and types.
ArithmeticalDSSComputer< std::vector< Z2i::Point >::const_iterator, int, 4 > SegmentComputer
SaturatedSegmentation< SegmentComputer > Segmentation