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

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

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

Public Types

typedef TSurfel Surfel
 
typedef TEmbedder SCellEmbedder
 
typedef std::pair< double, double > Quantity
 
typedef SCellEmbedder::RealPoint RealPoint
 
typedef CGAL::Cartesian< double > CGALKernel
 
typedef CGALKernel::Point_3 CGALPoint
 
typedef CGAL::Monge_via_jet_fitting< CGALKernelCGALMongeViaJet
 
typedef CGALMongeViaJet::Monge_form CGALMongeForm
 

Public Member Functions

 MongeJetFittingPrincipalCurvaturesEstimator (ConstAlias< SCellEmbedder > anEmbedder, const double h, unsigned int d=4)
 
void pushSurfel (const Surfel &aSurf, const double aDistance)
 
Quantity eval ()
 
void reset ()
 

Private Attributes

const SCellEmbeddermyEmbedder
 
std::vector< CGALPointmyPoints
 
double myH
 
unsigned int myD
 

Detailed Description

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

Aim: Estimates Gaussian curvature using CGAL Jet Fitting and Monge Form.

Description of template class 'MongeJetFittingPrincipalCurvaturesEstimator'

model of concepts::CLocalEstimatorFromSurfelFunctor.

Template Parameters
TSurfeltype of surfels
TEmbeddertype of functors which embed surfel to \( \mathbb{R}^3\)

Definition at line 77 of file MongeJetFittingPrincipalCurvaturesEstimator.h.

Member Typedef Documentation

template<typename TSurfel , typename TEmbedder >
typedef CGAL::Cartesian<double> DGtal::functors::MongeJetFittingPrincipalCurvaturesEstimator< TSurfel, TEmbedder >::CGALKernel
template<typename TSurfel , typename TEmbedder >
typedef CGALMongeViaJet::Monge_form DGtal::functors::MongeJetFittingPrincipalCurvaturesEstimator< TSurfel, TEmbedder >::CGALMongeForm
template<typename TSurfel , typename TEmbedder >
typedef CGAL::Monge_via_jet_fitting<CGALKernel> DGtal::functors::MongeJetFittingPrincipalCurvaturesEstimator< TSurfel, TEmbedder >::CGALMongeViaJet
template<typename TSurfel , typename TEmbedder >
typedef CGALKernel::Point_3 DGtal::functors::MongeJetFittingPrincipalCurvaturesEstimator< TSurfel, TEmbedder >::CGALPoint
template<typename TSurfel , typename TEmbedder >
typedef std::pair<double, double> DGtal::functors::MongeJetFittingPrincipalCurvaturesEstimator< TSurfel, TEmbedder >::Quantity
template<typename TSurfel , typename TEmbedder >
typedef SCellEmbedder::RealPoint DGtal::functors::MongeJetFittingPrincipalCurvaturesEstimator< TSurfel, TEmbedder >::RealPoint
template<typename TSurfel , typename TEmbedder >
typedef TEmbedder DGtal::functors::MongeJetFittingPrincipalCurvaturesEstimator< TSurfel, TEmbedder >::SCellEmbedder
template<typename TSurfel , typename TEmbedder >
typedef TSurfel DGtal::functors::MongeJetFittingPrincipalCurvaturesEstimator< TSurfel, TEmbedder >::Surfel

Constructor & Destructor Documentation

template<typename TSurfel , typename TEmbedder >
DGtal::functors::MongeJetFittingPrincipalCurvaturesEstimator< TSurfel, TEmbedder >::MongeJetFittingPrincipalCurvaturesEstimator ( ConstAlias< SCellEmbedder anEmbedder,
const double  h,
unsigned int  d = 4 
)
inline

Constructor.

Parameters
anEmbedderembedder to map surfel to R^n.
hgridstep
ddegree of the polynomial surface to fit.

Definition at line 99 of file MongeJetFittingPrincipalCurvaturesEstimator.h.

99  :
100  myEmbedder(&anEmbedder), myH(h), myD(d)
101  {
102  FATAL_ERROR_MSG(d>=2, "Polynomial surface degree must be greater than 2");
103  }

Member Function Documentation

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

Evaluate the curvature from Monge form.

Returns
the mean curvature

Definition at line 126 of file MongeJetFittingPrincipalCurvaturesEstimator.h.

References DGtal::functors::MongeJetFittingPrincipalCurvaturesEstimator< TSurfel, TEmbedder >::myD, and DGtal::functors::MongeJetFittingPrincipalCurvaturesEstimator< TSurfel, TEmbedder >::myPoints.

127  {
128  CGALMongeForm monge_form;
129  CGALMongeViaJet monge_fit;
130 
131  monge_form = monge_fit(myPoints.begin() , myPoints.end(), myD, (2<myD)? myD : 2);
132 
133  double k1 = monge_form.principal_curvatures ( 0 );
134  double k2 = monge_form.principal_curvatures ( 1 );
135  Quantity result;
136  result.first = k1;
137  result.second = k2;
138  return result;
139  }
template<typename TSurfel , typename TEmbedder >
void DGtal::functors::MongeJetFittingPrincipalCurvaturesEstimator< 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 of aSurf to the neighborhood boundary

Definition at line 111 of file MongeJetFittingPrincipalCurvaturesEstimator.h.

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

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

Field Documentation

template<typename TSurfel , typename TEmbedder >
unsigned int DGtal::functors::MongeJetFittingPrincipalCurvaturesEstimator< TSurfel, TEmbedder >::myD
private
template<typename TSurfel , typename TEmbedder >
const SCellEmbedder* DGtal::functors::MongeJetFittingPrincipalCurvaturesEstimator< TSurfel, TEmbedder >::myEmbedder
private
template<typename TSurfel , typename TEmbedder >
double DGtal::functors::MongeJetFittingPrincipalCurvaturesEstimator< TSurfel, TEmbedder >::myH
private
template<typename TSurfel , typename TEmbedder >
std::vector<CGALPoint> DGtal::functors::MongeJetFittingPrincipalCurvaturesEstimator< TSurfel, TEmbedder >::myPoints
private

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