DGtal 1.3.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes
DGtal::functors::MongeJetFittingNormalVectorEstimator< TSurfel, TEmbedder > Class Template Reference

Aim: Estimates normal vector using CGAL Jet Fitting and Monge Form. More...

#include <DGtal/geometry/surfaces/estimation/estimationFunctors/MongeJetFittingNormalVectorEstimator.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::Vector_3 CGALVector
 
typedef CGAL::Monge_via_jet_fitting< CGALKernelCGALMongeViaJet
 
typedef CGALMongeViaJet::Monge_form CGALMongeForm
 

Public Member Functions

 MongeJetFittingNormalVectorEstimator (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
 Alias of the geometrical embedder. More...
 
std::vector< CGALPointmyPoints
 Array of CGAL points. More...
 
double myH
 
unsigned int myD
 Degree of the polynomial surface to fit. More...
 

Detailed Description

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

Aim: Estimates normal vector using CGAL Jet Fitting and Monge Form.

Description of template class 'MongeJetFittingNormalVectorEstimator'

As discussed in MongeJetFittingMeanCurvatureEstimator, only the estimated normal vector is given up to a sign. Hence, depending on the local orientation of the surface, you would problably have to reverse the estimated vector \( \vec{n} \) to \( -\vec{n}\).

model of concepts::CLocalEstimatorFromSurfelFunctor

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

Definition at line 81 of file MongeJetFittingNormalVectorEstimator.h.

Member Typedef Documentation

◆ CGALKernel

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

Definition at line 90 of file MongeJetFittingNormalVectorEstimator.h.

◆ CGALMongeForm

template<typename TSurfel , typename TEmbedder >
typedef CGALMongeViaJet::Monge_form DGtal::functors::MongeJetFittingNormalVectorEstimator< TSurfel, TEmbedder >::CGALMongeForm

Definition at line 94 of file MongeJetFittingNormalVectorEstimator.h.

◆ CGALMongeViaJet

template<typename TSurfel , typename TEmbedder >
typedef CGAL::Monge_via_jet_fitting<CGALKernel> DGtal::functors::MongeJetFittingNormalVectorEstimator< TSurfel, TEmbedder >::CGALMongeViaJet

Definition at line 93 of file MongeJetFittingNormalVectorEstimator.h.

◆ CGALPoint

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

Definition at line 91 of file MongeJetFittingNormalVectorEstimator.h.

◆ CGALVector

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

Definition at line 92 of file MongeJetFittingNormalVectorEstimator.h.

◆ Quantity

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

Definition at line 88 of file MongeJetFittingNormalVectorEstimator.h.

◆ RealPoint

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

Definition at line 87 of file MongeJetFittingNormalVectorEstimator.h.

◆ SCellEmbedder

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

Definition at line 86 of file MongeJetFittingNormalVectorEstimator.h.

◆ Surfel

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

Definition at line 85 of file MongeJetFittingNormalVectorEstimator.h.

Constructor & Destructor Documentation

◆ MongeJetFittingNormalVectorEstimator()

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

Constructor.

Parameters
anEmbedderembedder to map surfel to R^n.
hgrid step
ddegree of the polynomial surface to fit (default d=4).

Definition at line 103 of file MongeJetFittingNormalVectorEstimator.h.

104 :
105 myEmbedder(&anEmbedder), myH(h), myD(d)
106 {
107 FATAL_ERROR_MSG(d>=2, "Polynomial surface degree must be greater than 2");
108 }
const SCellEmbedder * myEmbedder
Alias of the geometrical embedder.
unsigned int myD
Degree of the polynomial surface to fit.

Member Function Documentation

◆ eval()

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

Evaluate the normal vector from Monge form.

Returns
the mean curvature

Definition at line 131 of file MongeJetFittingNormalVectorEstimator.h.

132 {
133 CGALMongeForm monge_form;
134 CGALMongeViaJet monge_fit;
135
136 monge_form = monge_fit(myPoints.begin() , myPoints.end(), myD, (2<myD)? myD : 2);
137
138 CGALVector v= monge_form.normal_direction ( );
139
140 return RealPoint(v.x(),v.y(),v.z());
141 }

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

◆ pushSurfel()

template<typename TSurfel , typename TEmbedder >
void DGtal::functors::MongeJetFittingNormalVectorEstimator< 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 116 of file MongeJetFittingNormalVectorEstimator.h.

118 {
119 BOOST_VERIFY(aDistance == aDistance);
120
121 RealPoint p = myEmbedder->operator()(aSurf);
122 CGALPoint pp(p[0]*myH,p[1]*myH,p[2]*myH);
123 myPoints.push_back(pp);
124 }
Z2i::RealPoint RealPoint

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

◆ reset()

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

Reset the point list.

Definition at line 147 of file MongeJetFittingNormalVectorEstimator.h.

148 {
149 myPoints.clear();
150 }

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

Field Documentation

◆ myD

template<typename TSurfel , typename TEmbedder >
unsigned int DGtal::functors::MongeJetFittingNormalVectorEstimator< TSurfel, TEmbedder >::myD
private

Degree of the polynomial surface to fit.

Definition at line 165 of file MongeJetFittingNormalVectorEstimator.h.

Referenced by DGtal::functors::MongeJetFittingNormalVectorEstimator< TSurfel, TEmbedder >::eval().

◆ myEmbedder

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

◆ myH

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

◆ myPoints

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

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