DGtal 2.0.0
|
Aim: this class adapts any local functor on digital surface element to define a local estimator. This class is model of CDigitalSurfaceLocalEstimator. More...
#include <DGtal/geometry/surfaces/estimation/LocalEstimatorFromSurfelFunctorAdapter.h>
Public Types | |
typedef TDigitalSurfaceContainer | DigitalSurfaceContainer |
Digital surface container type. | |
typedef TMetric | Metric |
Metric type. | |
typedef Metric::Value | Value |
Metric value type. | |
typedef Metric::Point | Point |
Metric point type. | |
typedef TFunctorOnSurfel | FunctorOnSurfel |
Functor on surfels type. | |
typedef TConvolutionFunctor | ConvolutionFunctor |
Functor on double to compute convolution weights. | |
typedef TFunctorOnSurfel::Quantity | Quantity |
Quantity type. | |
typedef double | Scalar |
The "real number" type. | |
typedef DigitalSurface< DigitalSurfaceContainer > | Surface |
Digital surface type. | |
typedef DigitalSurfaceContainer::Surfel | Surfel |
Surfel type. |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((concepts::CMetricSpace< TMetric >)) | |
Concept Checks. | |
BOOST_CONCEPT_ASSERT ((concepts::CLocalEstimatorFromSurfelFunctor< TFunctorOnSurfel >)) | |
BOOST_CONCEPT_ASSERT ((concepts::CUnaryFunctor< TConvolutionFunctor, double, double >)) | |
BOOST_CONCEPT_ASSERT ((concepts::CDigitalSurfaceContainer< TDigitalSurfaceContainer >)) | |
BOOST_STATIC_ASSERT ((concepts::ConceptUtils::SameType< typename Point::Component, double >::value)) | |
The point must be a real point. | |
LocalEstimatorFromSurfelFunctorAdapter () | |
LocalEstimatorFromSurfelFunctorAdapter (ConstAlias< Surface > aSurface, ConstAlias< TMetric > aMetric, Alias< FunctorOnSurfel > aFunctor, ConstAlias< ConvolutionFunctor > aConvolutionFunctor) | |
LocalEstimatorFromSurfelFunctorAdapter (const LocalEstimatorFromSurfelFunctorAdapter &other) | |
LocalEstimatorFromSurfelFunctorAdapter & | operator= (const LocalEstimatorFromSurfelFunctorAdapter &other) |
~LocalEstimatorFromSurfelFunctorAdapter () | |
Scalar | h () const |
void | attach (ConstAlias< Surface > aSurface) |
void | setParams (ConstAlias< TMetric > aMetric, Alias< FunctorOnSurfel > aFunctor, ConstAlias< ConvolutionFunctor > aConvolutionFunctor, const Value radius) |
template<typename SurfelConstIterator> | |
void | init (const double _h, SurfelConstIterator itb, SurfelConstIterator ite) |
template<typename SurfelConstIterator> | |
Quantity | eval (const SurfelConstIterator &it) const |
Quantity | eval (const Surfel &scell) const |
template<typename SurfelConstIterator, typename OutputIterator> | |
OutputIterator | eval (const SurfelConstIterator &itb, const SurfelConstIterator &ite, OutputIterator result) const |
template<typename OutputIterator> | |
OutputIterator | evalAll (OutputIterator result) const |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Private Types | |
typedef FunctorOnSurfel::SCellEmbedder | Embedder |
Embedded and type definitions. | |
typedef Embedder::RealPoint | RealPoint |
Real point type. | |
typedef std::function< Value(Point) > | MetricToPoint |
typedef functors::Composer< Embedder, MetricToPoint, Value > | VertexFunctor |
typedef DistanceBreadthFirstVisitor< Surface, VertexFunctor > | Visitor |
Private Attributes | |
CountedConstPtrOrConstPtr< Surface > | mySurface |
Digital surface member. | |
FunctorOnSurfel * | myFunctor |
Functor member. | |
CountedConstPtrOrConstPtr< Metric > | myMetric |
Distance functor. | |
double | myH |
Grid step. | |
bool | myInit |
Has init been done before eval. | |
Embedder | myEmbedder |
Embedder object. | |
CountedConstPtrOrConstPtr< ConvolutionFunctor > | myConvFunctor |
Convolution functor. | |
Value | myRadius |
Ball radius. |
Aim: this class adapts any local functor on digital surface element to define a local estimator. This class is model of CDigitalSurfaceLocalEstimator.
Description of template class 'LocalEstimatorFromSurfelFunctorAdapter'
When we evaluate the adapted estimator at a surfel s, we first identify the set of neighboring around s using a DistanceBreadthFirstVisitor parametrized by a given metric. Then, the estimated quantity is computed applying a functor on the surfel set.
More precisely, this adapter needs a model of CMetricSpace to define the neighborhood and a model of CLocalEstimatorFromSurfelFunctor to perform the local estimator computation. When sent to the functor, the surfels are weighted using the distance from the kernel boundary: weights are defined in [0,1] interval, 1 for the center and decreasing to 0 with the distance to the specified kernel radius specified during the init(). The shape of the distance-to-weight function is defined by a functor of type TConvolutionFunctor.
During the init() method, we thus specify the gridstep h and the radius of the ball to consider to define the neighborhood. An instance of the convolution functor should be passed to the constructor.
Note that the visitor used in this class considers the distance function in the ambient space (not a geodesic one for instance) on canonical embedding of surfel elements (cf CanonicSCellEmbedder).
TDigitalSurfaceContainer | any model of digital surface container concept (CDigitalSurfaceContainer) |
TMetric | any model of CMetricSpace to be used in the neighborhood construction on RealPoint (e.g. LpMetric) |
TFunctorOnSurfel | an estimator on surfel set (model of CLocalEstimatorFromSurfelFunctor) |
TConvolutionFunctor | type of functor on double [0,1]->[0,1] to implement the response of a symmetric convolution kernel. |
Definition at line 103 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef TConvolutionFunctor DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::ConvolutionFunctor |
Functor on double to compute convolution weights.
Definition at line 132 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef TDigitalSurfaceContainer DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::DigitalSurfaceContainer |
Digital surface container type.
Definition at line 115 of file LocalEstimatorFromSurfelFunctorAdapter.h.
|
private |
Embedded and type definitions.
Definition at line 151 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef TFunctorOnSurfel DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::FunctorOnSurfel |
Functor on surfels type.
Definition at line 129 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef TMetric DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::Metric |
Metric type.
Definition at line 118 of file LocalEstimatorFromSurfelFunctorAdapter.h.
|
private |
Definition at line 154 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef Metric::Point DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::Point |
Metric point type.
Definition at line 124 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef TFunctorOnSurfel::Quantity DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::Quantity |
Quantity type.
Definition at line 135 of file LocalEstimatorFromSurfelFunctorAdapter.h.
|
private |
Real point type.
Definition at line 153 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef double DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::Scalar |
The "real number" type.
Definition at line 138 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef DigitalSurface< DigitalSurfaceContainer > DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::Surface |
Digital surface type.
Definition at line 141 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef DigitalSurfaceContainer::Surfel DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::Surfel |
Surfel type.
Definition at line 144 of file LocalEstimatorFromSurfelFunctorAdapter.h.
typedef Metric::Value DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::Value |
Metric value type.
Definition at line 121 of file LocalEstimatorFromSurfelFunctorAdapter.h.
|
private |
Definition at line 155 of file LocalEstimatorFromSurfelFunctorAdapter.h.
|
private |
Definition at line 157 of file LocalEstimatorFromSurfelFunctorAdapter.h.
DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::LocalEstimatorFromSurfelFunctorAdapter | ( | ) |
Default constructor.
Referenced by LocalEstimatorFromSurfelFunctorAdapter(), and operator=().
DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::LocalEstimatorFromSurfelFunctorAdapter | ( | ConstAlias< Surface > | aSurface, |
ConstAlias< TMetric > | aMetric, | ||
Alias< FunctorOnSurfel > | aFunctor, | ||
ConstAlias< ConvolutionFunctor > | aConvolutionFunctor ) |
Constructor.
aSurface | a digital surface |
aMetric | the metric |
aFunctor | a functor on digital surface elements (e.g. the normal or the curvature estimation) |
aConvolutionFunctor | a functor giving the weight as a function of the distance to the surfel. |
|
inline |
Copy constructor.
other | the object to clone. Forbidden by default. |
Definition at line 190 of file LocalEstimatorFromSurfelFunctorAdapter.h.
References LocalEstimatorFromSurfelFunctorAdapter(), myConvFunctor, myEmbedder, myFunctor, myMetric, and mySurface.
DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::~LocalEstimatorFromSurfelFunctorAdapter | ( | ) |
Destructor.
void DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::attach | ( | ConstAlias< Surface > | aSurface | ) |
Attach a digital surface. After this call, the object is then invalid and the user must called setParams.
aSurface | the digital surface that is aliased in this. The user can secure the aliasing by passing a CountedConstPtrOrConstPtr. |
DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::BOOST_CONCEPT_ASSERT | ( | (concepts::CDigitalSurfaceContainer< TDigitalSurfaceContainer >) | ) |
DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::BOOST_CONCEPT_ASSERT | ( | (concepts::CLocalEstimatorFromSurfelFunctor< TFunctorOnSurfel >) | ) |
DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::BOOST_CONCEPT_ASSERT | ( | (concepts::CMetricSpace< TMetric >) | ) |
Concept Checks.
DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::BOOST_CONCEPT_ASSERT | ( | (concepts::CUnaryFunctor< TConvolutionFunctor, double, double >) | ) |
DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::BOOST_STATIC_ASSERT | ( | (concepts::ConceptUtils::SameType< typename Point::Component, double >::value) | ) |
The point must be a real point.
References DGtal::concepts::ConceptUtils::SameType< T1, T2 >::value.
Quantity DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::eval | ( | const Surfel & | scell | ) | const |
[in] | scell | the surfel at which we evaluate the quantity. |
Quantity DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::eval | ( | const SurfelConstIterator & | it | ) | const |
[in] | it | the surfel iterator at which we evaluate the quantity. |
OutputIterator DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::eval | ( | const SurfelConstIterator & | itb, |
const SurfelConstIterator & | ite, | ||
OutputIterator | result ) const |
[in] | itb | starting surfel iterator. |
[in] | ite | end surfel iterator. |
[in,out] | result | resulting output iterator |
OutputIterator DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::evalAll | ( | OutputIterator | result | ) | const |
Writes on result the estimated quantity at all surfels of the digital surface.
result | any model of boost::OutputIterator on Quantity. |
Scalar DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::h | ( | ) | const |
void DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::init | ( | const double | _h, |
SurfelConstIterator | itb, | ||
SurfelConstIterator | ite ) |
Initialisation of estimator parameters.
[in] | _h | grid size (must be >0). |
[in] | itb | iterator after the last surfel of the surface. |
[in] | ite | iterator on the first surfel of the surface. |
bool DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
|
inline |
Assignment.
other | the object to copy. |
Definition at line 202 of file LocalEstimatorFromSurfelFunctorAdapter.h.
References LocalEstimatorFromSurfelFunctorAdapter(), myConvFunctor, myEmbedder, myFunctor, myMetric, and mySurface.
void DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
void DGtal::LocalEstimatorFromSurfelFunctorAdapter< TDigitalSurfaceContainer, TMetric, TFunctorOnSurfel, TConvolutionFunctor >::setParams | ( | ConstAlias< TMetric > | aMetric, |
Alias< FunctorOnSurfel > | aFunctor, | ||
ConstAlias< ConvolutionFunctor > | aConvolutionFunctor, | ||
const Value | radius ) |
Initialisation of estimator specific parameters.
aMetric | the metric |
aFunctor | a functor on digital surface elements (e.g. the normal or the curvature estimation) |
aConvolutionFunctor | a functor giving the weight as a function of the distance to the surfel. |
radius | a kernel radius. |
|
private |
Convolution functor.
Definition at line 339 of file LocalEstimatorFromSurfelFunctorAdapter.h.
Referenced by LocalEstimatorFromSurfelFunctorAdapter(), and operator=().
|
private |
Embedder object.
Definition at line 336 of file LocalEstimatorFromSurfelFunctorAdapter.h.
Referenced by LocalEstimatorFromSurfelFunctorAdapter(), and operator=().
|
private |
Functor member.
Definition at line 324 of file LocalEstimatorFromSurfelFunctorAdapter.h.
Referenced by LocalEstimatorFromSurfelFunctorAdapter(), and operator=().
|
private |
Grid step.
Definition at line 330 of file LocalEstimatorFromSurfelFunctorAdapter.h.
|
private |
Has init been done before eval.
Definition at line 333 of file LocalEstimatorFromSurfelFunctorAdapter.h.
|
private |
Distance functor.
Definition at line 327 of file LocalEstimatorFromSurfelFunctorAdapter.h.
Referenced by LocalEstimatorFromSurfelFunctorAdapter(), and operator=().
|
private |
Ball radius.
Definition at line 342 of file LocalEstimatorFromSurfelFunctorAdapter.h.
|
private |
Digital surface member.
Definition at line 321 of file LocalEstimatorFromSurfelFunctorAdapter.h.
Referenced by LocalEstimatorFromSurfelFunctorAdapter(), and operator=().