34#if defined(SphereFittingEstimator_RECURSES)
35#error Recursive header files inclusion detected in SphereFittingEstimator.h
38#define SphereFittingEstimator_RECURSES
40#if !defined SphereFittingEstimator_h
42#define SphereFittingEstimator_h
47#include <DGtal/base/Common.h>
48#include <DGtal/topology/SCellsFunctors.h>
50#ifndef DGTAL_WITH_PONCA
51#error You need to have activated Ponca (DGTAL_WITH_PONCA) to include this file.
55#include <Ponca/Fitting>
85 template <
typename TSurfel,
87 typename TNormalVectorEstimatorCache>
102 const VectorType& _normal = VectorType::Zero())
125 typedef Ponca::DistWeightFunc<PoncaPoint, Ponca::SmoothWeightKernel<Scalar>>
WeightFunc;
126 typedef Ponca::Basket<PoncaPoint, WeightFunc, Ponca::OrientedSphereFit, Ponca::GLSParam>
Fit;
188 const double aDistance)
190 BOOST_VERIFY(aDistance==aDistance);
209 myFit->addNeighbor(point);
226 trace.info() <<std::endl;
229 if(
myFit->isStable())
231 std::cout <<
"Center: [" <<
myFit->center().transpose() <<
"] ; radius: " <<
myFit->radius() << std::endl;
233 std::cout <<
"Pratt normalization"
234 << (
myFit->applyPrattNorm() ?
" is now done." :
" has already been applied.") << std::endl;
237 std::cout <<
"Fitted Sphere: " << std::endl
238 <<
"\t Tau : " <<
myFit->tau() << std::endl
239 <<
"\t Eta : " <<
myFit->eta().transpose() << std::endl
240 <<
"\t Kappa: " <<
myFit->kappa() << std::endl;
245 std::cout <<
"Ooops... not stable result"<<std::endl;
250 (
myFit->center())(1),
251 (
myFit->center())(2));
305#undef SphereFittingEstimator_RECURSES
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
PONCA_MULTIARCH const VectorType & normal() const
PONCA_MULTIARCH VectorType & normal()
PONCA_MULTIARCH VectorType & pos()
PONCA_MULTIARCH const VectorType & pos() const
Eigen::Matrix< Scalar, Dim, 1 > VectorType
PONCA_MULTIARCH PoncaPoint(const VectorType &_pos=VectorType::Zero(), const VectorType &_normal=VectorType::Zero())
Eigen::Matrix< Scalar, Dim, Dim > MatrixType
Ponca::DistWeightFunc< PoncaPoint, Ponca::SmoothWeightKernel< Scalar > > WeightFunc
const NormalVectorEstimatorCache * myNormalEsitmatorCache
NormalVectorCache.
Ponca::Basket< PoncaPoint, WeightFunc, Ponca::OrientedSphereFit, Ponca::GLSParam > Fit
bool myFirstPoint
Boolean for initial point.
Fit * myFit
Fitting object.
const SCellEmbedder * myEmbedder
Alias of the geometrical embedder.
const WeightFunc * myWeightFunction
const WeightFunction
PoncaPoint::Scalar Scalar
SCellEmbedder::RealPoint RealPoint
SphereFittingEstimator(ConstAlias< SCellEmbedder > anEmbedder, const double h, const double radius, ConstAlias< NormalVectorEstimatorCache > anEstimator)
TNormalVectorEstimatorCache NormalVectorEstimatorCache
~SphereFittingEstimator()
void pushSurfel(const Surfel &aSurf, const double aDistance)
PoncaPoint::VectorType VectorType
functors namespace gathers all DGtal functors.
DGtal is the top-level namespace which contains all DGtal functions and types.
Quantity type: a 3-sphere (model of CQuantity)
bool operator<(Quantity aq)
bool operator!=(Quantity aq)
Quantity(RealPoint p, double rad, double _tau, double _kappa, RealPoint _eta)
bool operator==(Quantity aq)