DGtal  1.4.beta
geometry/curves/estimation/exampleLMST3D.cpp

This example shows the basic usage of the Lambda maximal segment tangent estimation in 3D.

See also
Digital straight lines and segments
#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 std;
using namespace DGtal;
using namespace Z3i;
using namespace DGtal::functors;
int main()
{
typedef vector < Point > Container;
typedef Container::const_iterator ConstIterator;
// Input points
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));
// Initialization of tangential cover
Segmentation segmenter ( contour.begin(), contour.end(), SegmentComputer() );
lmst.attach ( segmenter );
lmst.getDSSFilter ( ).init ( 7 );
for ( ConstIterator it = contour.begin(); it != contour.end(); ++it )
lmst.eval ( *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;
}
// //
ConstIterator
MyDigitalSurface::ConstIterator ConstIterator
Definition: greedy-plane-segmentation-ex2.cpp:93
DGtal::LambdaMST3DEstimator< Z3i::Space, DSSSegmentationComputer, TangentFromDSS3DFunctor< DSSSegmentationComputer::SegmentComputer, functors::Lambda64Function >, DSSMuteFilter< typename DSSSegmentationComputer::SegmentComputer > >::getDSSFilter
DSSMuteFilter< typename DSSSegmentationComputer::SegmentComputer > & getDSSFilter()
DGtal::ArithmeticalDSSComputer< std::vector< Z2i::Point >::const_iterator, int, 4 >
DGtal::functors
functors namespace gathers all DGtal functors.
Definition: BasicBoolFunctors.h:49
SegmentComputer
ArithmeticalDSSComputer< std::vector< Z2i::Point >::const_iterator, int, 4 > SegmentComputer
Definition: testArithmeticalDSSComputerOnSurfels.cpp:55
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::LambdaMST3DEstimator< Z3i::Space, DSSSegmentationComputer, TangentFromDSS3DFunctor< DSSSegmentationComputer::SegmentComputer, functors::Lambda64Function >, DSSMuteFilter< typename DSSSegmentationComputer::SegmentComputer > >::attach
void attach(Alias< DSSSegmentationComputer > segmentComputer)
DGtal::LambdaMST3DEstimator< Z3i::Space, DSSSegmentationComputer, TangentFromDSS3DFunctor< DSSSegmentationComputer::SegmentComputer, functors::Lambda64Function >, DSSMuteFilter< typename DSSSegmentationComputer::SegmentComputer > >::eval
RealVector eval(const Point &p)
DGtal::LambdaMST3D
Aim: Simplify creation of Lambda MST tangent estimator.
Definition: LambdaMST3D.h:209
DGtal::LambdaMST3DEstimator< Z3i::Space, DSSSegmentationComputer, TangentFromDSS3DFunctor< DSSSegmentationComputer::SegmentComputer, functors::Lambda64Function >, DSSMuteFilter< typename DSSSegmentationComputer::SegmentComputer > >::init
void init(ConstIterator itb, ConstIterator ite)
Segmentation
SaturatedSegmentation< SegmentComputer > Segmentation
Definition: testArithmeticalDSSComputerOnSurfels.cpp:56
main
int main(int argc, char **argv)
Definition: testArithmeticDSS-benchmark.cpp:147
DGtal::Naive3DDSSComputer
Aim: Dynamic recognition of a 3d-digital straight segment (DSS)
Definition: Naive3DDSSComputer.h:97
DGtal::SaturatedSegmentation
Aim: Computes the saturated segmentation, that is the whole set of maximal segments within a range gi...
Definition: SaturatedSegmentation.h:153
Point
MyPointD Point
Definition: testClone2.cpp:383