31#if defined(PlaneProbingDigitalSurfaceLocalEstimator_RECURSES)
32#error Recursive header files inclusion detected in PlaneProbingDigitalSurfaceLocalEstimator.h
35#define PlaneProbingDigitalSurfaceLocalEstimator_RECURSES
37#if !defined PlaneProbingDigitalSurfaceLocalEstimator_h
39#define PlaneProbingDigitalSurfaceLocalEstimator_h
44#include <unordered_map>
45#include "DGtal/base/Common.h"
46#include "DGtal/geometry/surfaces/DigitalSurfacePredicate.h"
47#include "DGtal/geometry/surfaces/estimation/MaximalSegmentSliceEstimation.h"
48#include "DGtal/topology/KhalimskyCellHashFunctions.h"
49#include "DGtal/topology/CDigitalSurfaceContainer.h"
69 template <
typename TSurface,
typename TInternalProbingAlgorithm>
78 using Point =
typename InternalProbingAlgorithm::Point;
100 newNormal = newB1.crossProduct(newB2);
102 return { newP, newB1, newB2, newNormal };
121 using Quantity =
typename InternalProbingAlgorithm::Quantity;
152 std::unordered_map<Surfel, RealPoint>
const& aPreEstimations = {},
153 bool aVerbose =
false);
165 std::unordered_map<Surfel, RealPoint>
const& aPreEstimations = {},
166 bool aVerbose =
false);
208 template <
typename SurfelConstIterator >
209 void init (
Scalar const& h, SurfelConstIterator itb, SurfelConstIterator ite);
219 template <
typename SurfelConstIterator >
230 template <
typename SurfelConstIterator,
typename OutputIterator >
231 OutputIterator
eval (SurfelConstIterator itb, SurfelConstIterator ite, OutputIterator out);
254 std::unordered_map<Surfel, RealPoint>
const& aPreEstimations = {},
255 bool aVerbose =
false);
276 template <
typename SurfelConstIterator >
323 return (x >= 0) ? 1 : -1;
332 std::vector<int> zeros;
334 for (
int i = 0; i < 3; ++i)
357 else if (aIndex == 1)
376 int im1 = (aIndex - 1 + 3) % 3,
377 im2 = (aIndex - 2 + 3) % 3;
391 template <
typename TSurface,
typename TInternalProbingAlgorithm >
400#include "DGtal/geometry/surfaces/estimation/PlaneProbingDigitalSurfaceLocalEstimator.ih"
407#undef PlaneProbingDigitalSurfaceLocalEstimator_RECURSES
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Aim: Smart or simple const pointer on T. It can be a smart pointer based on reference counts or a sim...
DigitalSurfaceContainer::Surfel Surfel
DigitalSurfaceContainer::KSpace KSpace
SignedKhalimskyCell< dim, Integer > SCell
SpaceND< dim, Integer > Space
KhalimskyCell< dim, Integer > Cell
Aim: Adapt a plane-probing estimator on a digital surface to estimate normal vectors.
TInternalProbingAlgorithm InternalProbingAlgorithm
BOOST_CONCEPT_ASSERT((concepts::CDigitalSurfaceContainer< typename TSurface::DigitalSurfaceContainer >))
std::pair< bool, ProbingFrame > probingFrameWithPreEstimation(ProbingFrame const &aInitialFrame, RealPoint const &aPreEstimation) const
PlaneProbingDigitalSurfaceLocalEstimator()
void init(Scalar const &h, SurfelConstIterator itb, SurfelConstIterator ite)
std::function< InternalProbingAlgorithm *(const ProbingFrame &, Predicate const &)> ProbingFactory
PlaneProbingDigitalSurfaceLocalEstimator(const PlaneProbingDigitalSurfaceLocalEstimator &other)
PlaneProbingDigitalSurfaceLocalEstimator & operator=(const PlaneProbingDigitalSurfaceLocalEstimator &other)
PlaneProbingDigitalSurfaceLocalEstimator(ConstAlias< Surface > aSurface, ProbingFactory const &aProbingFactory, std::unordered_map< Surfel, RealPoint > const &aPreEstimations={}, bool aVerbose=false)
typename Space::RealPoint RealPoint
typename KSpace::Cell Cell
typename Surface::KSpace KSpace
void selfDisplay(std::ostream &out) const
PreEstimation myPreEstimationEstimator
PlaneProbingDigitalSurfaceLocalEstimator(PlaneProbingDigitalSurfaceLocalEstimator &&other)=delete
void setParams(ProbingFactory const &aProbingFactory, std::unordered_map< Surfel, RealPoint > const &aPreEstimations={}, bool aVerbose=false)
~PlaneProbingDigitalSurfaceLocalEstimator()
ProbingFrame probingFrameFromSurfel(Surfel const &aSurfel) const
ProbingFactory myProbingFactory
static int signComponent(double x)
typename KSpace::Space Space
typename KSpace::SCell SCell
void attach(ConstAlias< Surface > aSurface)
Point getNormalOneFlatDirection(int aIndex) const
CountedConstPtrOrConstPtr< Surface > mySurface
typename Surface::Surfel Surfel
typename InternalProbingAlgorithm::Point Point
Quantity eval(SurfelConstIterator it)
OutputIterator eval(SurfelConstIterator itb, SurfelConstIterator ite, OutputIterator out)
PlaneProbingDigitalSurfaceLocalEstimator(ProbingFactory const &aProbingFactory, std::unordered_map< Surfel, RealPoint > const &aPreEstimations={}, bool aVerbose=false)
InternalProbingAlgorithm * myProbingAlgorithm
typename InternalProbingAlgorithm::Quantity Quantity
std::unordered_map< Surfel, RealPoint > myPreEstimations
static std::vector< int > findZeros(RealPoint const &p)
RealPoint getPreEstimation(SurfelConstIterator it) const
static std::vector< PointOnProbingRay > getProbingRaysOneFlatDirection(int aIndex)
PlaneProbingDigitalSurfaceLocalEstimator(ConstAlias< Surface > aSurface)
typename InternalProbingAlgorithm::PointOnProbingRay PointOnProbingRay
PointVector< dim, double > RealPoint
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
ProbingFrame rotatedCopy() const
Aim: The digital surface container concept describes a minimal set of inner types and methods so as t...