DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder > Class Template Reference

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

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

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
 Alias of the geometrical embedder.
 
std::vector< CGALPointmyPoints
 Array of CGAL points.
 
double myH
 Grid Step.
 

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

◆ CGALKernel

template<typename TSurfel , typename TEmbedder >
typedef CGAL::Cartesian<double> DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::CGALKernel

◆ CGALPlane

template<typename TSurfel , typename TEmbedder >
typedef CGALKernel::Plane_3 DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::CGALPlane

◆ CGALPoint

template<typename TSurfel , typename TEmbedder >
typedef CGALKernel::Point_3 DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::CGALPoint

◆ CGALVector

template<typename TSurfel , typename TEmbedder >
typedef CGALKernel::Vector_3 DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::CGALVector

◆ Quantity

template<typename TSurfel , typename TEmbedder >
typedef RealPoint DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::Quantity

◆ RealPoint

template<typename TSurfel , typename TEmbedder >
typedef SCellEmbedder::RealPoint DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::RealPoint

◆ SCellEmbedder

template<typename TSurfel , typename TEmbedder >
typedef TEmbedder DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::SCellEmbedder

◆ Surfel

template<typename TSurfel , typename TEmbedder >
typedef TSurfel DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::Surfel

Constructor & Destructor Documentation

◆ LinearLeastSquareFittingNormalVectorEstimator()

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

◆ eval()

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.

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 }
PointVector< 3, double > RealPoint

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

◆ pushSurfel()

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.

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 }

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

◆ reset()

template<typename TSurfel , typename TEmbedder >
void DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::reset ( )
inline

Field Documentation

◆ myEmbedder

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

◆ myH

template<typename TSurfel , typename TEmbedder >
double DGtal::functors::LinearLeastSquareFittingNormalVectorEstimator< TSurfel, TEmbedder >::myH
private

Grid Step.

Definition at line 152 of file LinearLeastSquareFittingNormalVectorEstimator.h.

◆ myPoints


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