DGtal  0.9.3beta
Public Types | Public Member Functions | Private Attributes
DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder > Class Template Reference

#include <DGtal/geometry/surfaces/estimation/estimationFunctors/LinearLeastSquareFittingNormalVectorEstimator.h>

Collaboration diagram for DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >:
[legend]

Public Types

typedef TSurfel Surfel
 
typedef TEmbedder SCellEmbedder
 
typedef SCellEmbedder::RealPoint RealPoint
 
typedef RealPoint Quantity
 
typedef CGAL::Cartesian< double > CGALKernel
 
typedef CGALKernel::Point_3 CGALPoint
 
typedef CGALKernel::Plane_3 CGALPlane
 
typedef CGALKernel::Vector_3 CGALVector
 

Public Member Functions

 LinearLeastSquareFittingNormalVectorEstimator (ConstAlias< SCellEmbedder > anEmbedder, const double h)
 
void pushSurfel (const Surfel &aSurf, const double aDistance)
 
Quantity eval ()
 
void reset ()
 

Private Attributes

const SCellEmbeddermyEmbedder
 
std::vector< CGALPointmyPoints
 
double myH
 

Detailed Description

template<typename TSurfel, typename TEmbedder>
class DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >

Aim: Estimates normal vector using CGAL linear least squares plane fitting.

Description of template class 'LinearLeastSquareFittingNormalVectorEstimator'

model of concepts::CLocalEstimatorFromSurfelFunctor

Template Parameters
TSurfeltype of surfels
TEmbeddertype of functors which embed surfel to R^3

Definition at line 79 of file LinearLeastSquareFittingNormalVectorEstimator.h.

Member Typedef Documentation

template<typename TSurfel , typename TEmbedder >
typedef CGAL::Cartesian<double> DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::CGALKernel
template<typename TSurfel , typename TEmbedder >
typedef CGALKernel::Plane_3 DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::CGALPlane
template<typename TSurfel , typename TEmbedder >
typedef CGALKernel::Point_3 DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::CGALPoint
template<typename TSurfel , typename TEmbedder >
typedef CGALKernel::Vector_3 DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::CGALVector
template<typename TSurfel , typename TEmbedder >
typedef RealPoint DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::Quantity
template<typename TSurfel , typename TEmbedder >
typedef SCellEmbedder::RealPoint DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::RealPoint
template<typename TSurfel , typename TEmbedder >
typedef TEmbedder DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::SCellEmbedder
template<typename TSurfel , typename TEmbedder >
typedef TSurfel DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::Surfel

Constructor & Destructor Documentation

template<typename TSurfel , typename TEmbedder >
DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::LinearLeastSquareFittingNormalVectorEstimator ( ConstAlias< SCellEmbedder anEmbedder,
const double  h 
)
inline

Constructor.

Parameters
anEmbedderembedder to map surfel to R^n.
hgridstep.

Definition at line 99 of file LinearLeastSquareFittingNormalVectorEstimator.h.

Member Function Documentation

template<typename TSurfel , typename TEmbedder >
Quantity DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::eval ( )
inline

Evaluate the normal vector from linear least squares fitting.

Returns
the mean curvature

Definition at line 124 of file LinearLeastSquareFittingNormalVectorEstimator.h.

References DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::myPoints.

125  {
126  CGALPlane plane;
127  CGAL::linear_least_squares_fitting_3(myPoints.begin(),myPoints.end(), plane, CGAL::Dimension_tag<0>());
128  CGALVector v = plane.orthogonal_vector();
129  RealPoint vv(v.x(),v.y(),v.z());
130  return vv.getNormalized();
131  }
template<typename TSurfel , typename TEmbedder >
void DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::pushSurfel ( const Surfel aSurf,
const double  aDistance 
)
inline

Add the geometrical embedding of a surfel to the point list

Parameters
aSurfa surfel to add
aDistancedistance to the origin surfel

Definition at line 110 of file LinearLeastSquareFittingNormalVectorEstimator.h.

References DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::myEmbedder, and DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::myPoints.

112  {
113  BOOST_VERIFY(aDistance == aDistance);
114  RealPoint p = myEmbedder->operator()(aSurf);
115  CGALPoint pp(p[0],p[1],p[2]);
116  myPoints.push_back(pp);
117  }
template<typename TSurfel , typename TEmbedder >
void DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::reset ( )
inline

Field Documentation

template<typename TSurfel , typename TEmbedder >
const SCellEmbedder* DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::myEmbedder
private
template<typename TSurfel , typename TEmbedder >
double DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::myH
private

Grid Step.

Definition at line 152 of file LinearLeastSquareFittingNormalVectorEstimator.h.

template<typename TSurfel , typename TEmbedder >
std::vector<CGALPoint> DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::myPoints
private

The documentation for this class was generated from the following file: