DGtal
1.5.beta
|
Aim: Adapt a plane-probing estimator on a digital surface to estimate normal vectors. More...
#include <DGtal/geometry/surfaces/estimation/PlaneProbingDigitalSurfaceLocalEstimator.h>
Data Structures | |
struct | ProbingFrame |
Public Types | |
using | Surface = TSurface |
using | InternalProbingAlgorithm = TInternalProbingAlgorithm |
using | Point = typename InternalProbingAlgorithm::Point |
using | Scalar = double |
using | Predicate = DigitalSurfacePredicate< Surface > |
using | ProbingFactory = std::function< InternalProbingAlgorithm *(const ProbingFrame &, Predicate const &)> |
using | PreEstimation = MaximalSegmentSliceEstimation< Surface > |
using | PointOnProbingRay = typename InternalProbingAlgorithm::PointOnProbingRay |
using | Surfel = typename Surface::Surfel |
using | Quantity = typename InternalProbingAlgorithm::Quantity |
using | KSpace = typename Surface::KSpace |
using | SCell = typename KSpace::SCell |
using | Cell = typename KSpace::Cell |
using | Space = typename KSpace::Space |
using | RealPoint = typename Space::RealPoint |
Public Member Functions | |
PlaneProbingDigitalSurfaceLocalEstimator () | |
PlaneProbingDigitalSurfaceLocalEstimator (ConstAlias< Surface > aSurface) | |
PlaneProbingDigitalSurfaceLocalEstimator (ProbingFactory const &aProbingFactory, std::unordered_map< Surfel, RealPoint > const &aPreEstimations={}, bool aVerbose=false) | |
PlaneProbingDigitalSurfaceLocalEstimator (ConstAlias< Surface > aSurface, ProbingFactory const &aProbingFactory, std::unordered_map< Surfel, RealPoint > const &aPreEstimations={}, bool aVerbose=false) | |
~PlaneProbingDigitalSurfaceLocalEstimator () | |
PlaneProbingDigitalSurfaceLocalEstimator (const PlaneProbingDigitalSurfaceLocalEstimator &other) | |
PlaneProbingDigitalSurfaceLocalEstimator (PlaneProbingDigitalSurfaceLocalEstimator &&other)=delete | |
PlaneProbingDigitalSurfaceLocalEstimator & | operator= (const PlaneProbingDigitalSurfaceLocalEstimator &other) |
PlaneProbingDigitalSurfaceLocalEstimator & | operator= (PlaneProbingDigitalSurfaceLocalEstimator &&other)=delete |
template<typename SurfelConstIterator > | |
void | init (Scalar const &h, SurfelConstIterator itb, SurfelConstIterator ite) |
template<typename SurfelConstIterator > | |
Quantity | eval (SurfelConstIterator it) |
template<typename SurfelConstIterator , typename OutputIterator > | |
OutputIterator | eval (SurfelConstIterator itb, SurfelConstIterator ite, OutputIterator out) |
Scalar | h () const |
void | attach (ConstAlias< Surface > aSurface) |
void | setParams (ProbingFactory const &aProbingFactory, std::unordered_map< Surfel, RealPoint > const &aPreEstimations={}, bool aVerbose=false) |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
template<typename SurfelConstIterator > | |
RealPoint | getPreEstimation (SurfelConstIterator it) const |
Private Member Functions | |
BOOST_CONCEPT_ASSERT ((concepts::CDigitalSurfaceContainer< typename TSurface::DigitalSurfaceContainer >)) | |
ProbingFrame | probingFrameFromSurfel (Surfel const &aSurfel) const |
std::pair< bool, ProbingFrame > | probingFrameWithPreEstimation (ProbingFrame const &aInitialFrame, RealPoint const &aPreEstimation) const |
Point | getNormalOneFlatDirection (int aIndex) const |
Static Private Member Functions | |
static int | signComponent (double x) |
static std::vector< int > | findZeros (RealPoint const &p) |
static std::vector< PointOnProbingRay > | getProbingRaysOneFlatDirection (int aIndex) |
Private Attributes | |
InternalProbingAlgorithm * | myProbingAlgorithm = nullptr |
Scalar | myH |
CountedConstPtrOrConstPtr< Surface > | mySurface |
Predicate | myPredicate |
PreEstimation | myPreEstimationEstimator |
ProbingFactory | myProbingFactory |
std::unordered_map< Surfel, RealPoint > | myPreEstimations |
bool | myVerbose |
Aim: Adapt a plane-probing estimator on a digital surface to estimate normal vectors.
Description of template class 'PlaneProbingDigitalSurfaceLocalEstimator'
This class uses a plane-probing algorithm (whose type is given by the template parameter TProbingAlgorithm) to estimate normal vectors on a digital surface per surfel.
TSurface | the digital surface type. |
TInternalProbingAlgorithm | the probing algorithm (see PlaneProbingTetrahedronEstimator or PlaneProbingParallelepipedEstimator). |
Models: A PlaneProbingDigitalSurfaceLocalEstimator is a model of concepts::CSurfelLocalEstimator and concepts::CDigitalSurfaceLocalEstimator.
Definition at line 70 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
using DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::Cell = typename KSpace::Cell |
Definition at line 126 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
using DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::InternalProbingAlgorithm = TInternalProbingAlgorithm |
Definition at line 77 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
using DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::KSpace = typename Surface::KSpace |
Definition at line 124 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
using DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::Point = typename InternalProbingAlgorithm::Point |
Definition at line 78 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
using DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::PointOnProbingRay = typename InternalProbingAlgorithm::PointOnProbingRay |
Definition at line 117 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
using DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::Predicate = DigitalSurfacePredicate<Surface> |
Definition at line 114 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
using DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::PreEstimation = MaximalSegmentSliceEstimation<Surface> |
Definition at line 116 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
using DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::ProbingFactory = std::function<InternalProbingAlgorithm*(const ProbingFrame&, Predicate const&)> |
Definition at line 115 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
using DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::Quantity = typename InternalProbingAlgorithm::Quantity |
Definition at line 121 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
using DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::RealPoint = typename Space::RealPoint |
Definition at line 128 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
using DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::Scalar = double |
Definition at line 79 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
using DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::SCell = typename KSpace::SCell |
Definition at line 125 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
using DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::Space = typename KSpace::Space |
Definition at line 127 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
using DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::Surface = TSurface |
Definition at line 76 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
using DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::Surfel = typename Surface::Surfel |
Definition at line 120 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::PlaneProbingDigitalSurfaceLocalEstimator | ( | ) |
Default constructor.
DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::PlaneProbingDigitalSurfaceLocalEstimator | ( | ConstAlias< Surface > | aSurface | ) |
DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::PlaneProbingDigitalSurfaceLocalEstimator | ( | ProbingFactory const & | aProbingFactory, |
std::unordered_map< Surfel, RealPoint > const & | aPreEstimations = {} , |
||
bool | aVerbose = false |
||
) |
DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::PlaneProbingDigitalSurfaceLocalEstimator | ( | ConstAlias< Surface > | aSurface, |
ProbingFactory const & | aProbingFactory, | ||
std::unordered_map< Surfel, RealPoint > const & | aPreEstimations = {} , |
||
bool | aVerbose = false |
||
) |
DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::~PlaneProbingDigitalSurfaceLocalEstimator | ( | ) |
Destructor.
DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::PlaneProbingDigitalSurfaceLocalEstimator | ( | const PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm > & | other | ) |
Copy constructor.
other | the object to clone. |
|
delete |
Move constructor.
other | the object to move. |
void DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::attach | ( | ConstAlias< Surface > | aSurface | ) |
Attaches the digital surface passed as a parameter to the estimator.
aSurface | a digital surface. |
|
private |
Quantity DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::eval | ( | SurfelConstIterator | it | ) |
Estimates the quantity on a surfel.
it | an iterator whose value type is Surfel. |
OutputIterator DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::eval | ( | SurfelConstIterator | itb, |
SurfelConstIterator | ite, | ||
OutputIterator | out | ||
) |
Estimates the quantity on a range of surfels.
itb | an iterator on the start of the range of surfels. |
ite | a past-the-end iterator of the range of surfels. |
out | an output iterator to store the results. |
|
inlinestaticprivate |
p | a RealPoint. |
Definition at line 330 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
|
inlineprivate |
Computes the estimated normal when we detected that one direction of the space was flat.
aIndex | an integer between 0 and 2. |
Definition at line 374 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
References DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::myProbingAlgorithm.
RealPoint DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::getPreEstimation | ( | SurfelConstIterator | it | ) | const |
it | an iterator whose value type is a surfel. |
|
inlinestaticprivate |
Builds a set of candidates when we detected that one direction of the space was flat.
aIndex | an integer between 0 and 2. |
Definition at line 351 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
Scalar DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::h | ( | ) | const |
void DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::init | ( | Scalar const & | h, |
SurfelConstIterator | itb, | ||
SurfelConstIterator | ite | ||
) |
Initializes the estimator (in this case, do nothing apart from storing the gridstep).
h | the grdstep. |
itb | an iterator on the start of the range of surfels. |
ite | a past-the-end iterator of the range of surfels. |
bool DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
PlaneProbingDigitalSurfaceLocalEstimator& DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::operator= | ( | const PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm > & | other | ) |
Copy assignment operator.
other | the object to copy. |
|
delete |
Move assignment operator.
other | the object to move. |
|
private |
Builds a probing frame (a base point and three vectors, see ProbingFrame) over a surfel.
aSurfel | a surfel. |
|
private |
Tries to build a probing frame matching an initial pre-estimated normal vector: the octant of the frame should coincide with the pre-estimation.
aInitialFrame | an initial probing frame. |
aPreEstimation | a pre-estimation vector. |
void DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
void DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::setParams | ( | ProbingFactory const & | aProbingFactory, |
std::unordered_map< Surfel, RealPoint > const & | aPreEstimations = {} , |
||
bool | aVerbose = false |
||
) |
Sets some parameters of the estimator.
aProbingFactory | a function to build plane-probing estimators from a probing frame. |
aPreEstimations | an optional hashmap Surfel -> RealPoint of pre-estimation vectors. |
aVerbose | verbosity flag. |
|
inlinestaticprivate |
x | a scalar. |
Definition at line 321 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
|
private |
The gridstep.
Definition at line 285 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
|
private |
The InPlane predicate.
Definition at line 287 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
|
private |
An estimator to compute a pre-estimation if is not given.
Definition at line 288 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
|
mutableprivate |
A hashmap of pre-estimation vectors
Definition at line 290 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
|
private |
A pointer on the probing algorithm, instantiated in eval.
Definition at line 284 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
Referenced by DGtal::PlaneProbingDigitalSurfaceLocalEstimator< TSurface, TInternalProbingAlgorithm >::getNormalOneFlatDirection().
|
private |
A factory function to build plane-probing estimators from a frame, used in eval.
Definition at line 289 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
|
private |
A constant pointer on the digital surface.
Definition at line 286 of file PlaneProbingDigitalSurfaceLocalEstimator.h.
|
private |
Verbosity flag.
Definition at line 291 of file PlaneProbingDigitalSurfaceLocalEstimator.h.