Ponca  6f9f1b59d7c8c4654a710cfcef7342f4f5c79ba1
Point Cloud Analysis library
Loading...
Searching...
No Matches
Ponca::DistWeightFilter< _DataPoint, WeightKernel > Class Template Reference

Weight neighbors according to the Euclidean distance between a query and a reference position. More...

#include <weightFilter.h>

+ Inheritance diagram for Ponca::DistWeightFilter< _DataPoint, WeightKernel >:
+ Collaboration diagram for Ponca::DistWeightFilter< _DataPoint, WeightKernel >:

Public Types

using DataPoint = _DataPoint
 Alias to _DataPoint template parameter.
 
using Scalar = typename DataPoint::Scalar
 Scalar type from DataPoint.
 
using VectorType = typename DataPoint::VectorType
 Vector type from DataPoint.
 
using MatrixType = typename DataPoint::MatrixType
 Matrix type from DataPoint.
 
using WeightReturnType = std::pair< Scalar, VectorType >
 Return type of the method #w()
 
using NeighborhoodFrame = CenteredNeighborhoodFrame< DataPoint >
 Frame used to express the neighbors locally.
 
- Public Types inherited from Ponca::CenteredNeighborhoodFrame< _DataPoint >
using Scalar = typename DataPoint::Scalar
 Scalar type from DataPoint.
 
using VectorType = typename DataPoint::VectorType
 Vector type from DataPoint.
 

Public Member Functions

 DistWeightFilter (const VectorType &_evalPos=VectorType::Zero(), const Scalar &_t=Scalar(1.))
 Constructor that defines the current evaluation scale.
 
 DistWeightFilter (const DataPoint &_evalPoint, const Scalar &_t=Scalar(1.))
 !
 
WeightReturnType operator() (const DataPoint &q) const
 Compute the weight of the given query with respect to its coordinates.
 
VectorType spacedw (const VectorType &_q, const DataPoint &) const
 First order derivative in space (for each spatial dimension \(\mathsf{x})\).
 
MatrixType spaced2w (const VectorType &_q, const DataPoint &) const
 Second order derivative in space (for each spatial dimension \(\mathsf{x})\).
 
Scalar scaledw (const VectorType &_q, const DataPoint &) const
 First order derivative in scale \(t\).
 
Scalar scaled2w (const VectorType &_q, const DataPoint &) const
 Second order derivative in scale \(t\).
 
VectorType scaleSpaced2w (const VectorType &_q, const DataPoint &) const
 Cross derivative in scale \(t\) and in space (for each spatial dimension \(\mathsf{x})\).
 
Scalar evalScale () const
 Access to the evaluation scale set during the initialization.
 
NeighborhoodFrameframe ()
 
const NeighborhoodFrameframe () const
 
- Public Member Functions inherited from Ponca::CenteredNeighborhoodFrame< _DataPoint >
 CenteredNeighborhoodFrame (const VectorType &_evalPos=VectorType::Zero())
 
 CenteredNeighborhoodFrame (const _DataPoint &_evalPoint)
 
VectorType center ()
 
VectorType center () const
 
void changeNeighborhoodFrame (const VectorType &_newEvalPos)
 Change neighborhood frame (move basis center)
 
VectorType convertToGlobalBasis (const VectorType &_q, bool _isPositionVector=true) const
 Convert query from local to global coordinate system, such as \(\mathbf{x}=\mathbf{x}'+\mathbf{p}\).
 
VectorType convertToLocalBasis (const VectorType &_q, bool _isPositionVector=true) const
 Convert query from global to local coordinate system, such as \(\mathbf{x}'=\mathbf{x}-\mathbf{p}\).
 

Static Public Attributes

static constexpr bool isCompact = WeightKernel::isCompact
 Flag indicating if the weighting kernel is compact of not.
 
- Static Public Attributes inherited from Ponca::CenteredNeighborhoodFrame< _DataPoint >
static constexpr bool hasLocalFrame
 Flag indicating that this class modifies the coordinates when passing from global to local.
 

Protected Attributes

Scalar m_t
 Evaluation scale.
 
WeightKernel m_wk
 1D function applied to weight queries
 

Detailed Description

template<class _DataPoint, class WeightKernel>
class Ponca::DistWeightFilter< _DataPoint, WeightKernel >

Weight neighbors according to the Euclidean distance between a query and a reference position.

The evaluation position is set in the constructor. All the queries are expressed in global system, and converted internally to relatively to the evaluation position using CenteredNeighborhoodFrame.

Template Parameters
DataPointType of input points.
WeightKernel1d function used to compute the weight depending on the distance between query point and the basis center. If WeightKernel::isCompact == true, the distance to the basis center is checked against the scale parameter, and any point whose distance is larger than the scale will be assigned with a weight of \(0\). For non-compact (ie. global) kernels, the weights are computed for all points.
See also
operator()
Warning
DistWeightFunc assumes that the evaluation scale t is strictly positive, but the valus is not checked

Definition at line 33 of file weightFilter.h.

Member Typedef Documentation

◆ DataPoint

Alias to _DataPoint template parameter.

Definition at line 37 of file weightFilter.h.

◆ MatrixType

using Ponca::DistWeightFilter< _DataPoint, WeightKernel >::MatrixType = typename DataPoint::MatrixType

Matrix type from DataPoint.

Definition at line 43 of file weightFilter.h.

◆ NeighborhoodFrame

Frame used to express the neighbors locally.

Definition at line 47 of file weightFilter.h.

◆ Scalar

Scalar type from DataPoint.

Definition at line 39 of file weightFilter.h.

◆ VectorType

using Ponca::DistWeightFilter< _DataPoint, WeightKernel >::VectorType = typename DataPoint::VectorType

Vector type from DataPoint.

Definition at line 41 of file weightFilter.h.

◆ WeightReturnType

Return type of the method #w()

Definition at line 45 of file weightFilter.h.

Constructor & Destructor Documentation

◆ DistWeightFilter() [1/2]

Ponca::DistWeightFilter< _DataPoint, WeightKernel >::DistWeightFilter ( const VectorType _evalPos = VectorType::Zero(),
const Scalar _t = Scalar(1.) 
)
inline

Constructor that defines the current evaluation scale.

Warning
t > 0

Definition at line 55 of file weightFilter.h.

◆ DistWeightFilter() [2/2]

Ponca::DistWeightFilter< _DataPoint, WeightKernel >::DistWeightFilter ( const DataPoint _evalPoint,
const Scalar _t = Scalar(1.) 
)
inline

!

Definition at line 63 of file weightFilter.h.

Member Function Documentation

◆ evalScale()

Access to the evaluation scale set during the initialization.

Definition at line 188 of file weightFilter.h.

◆ frame() [1/2]

Definition at line 190 of file weightFilter.h.

◆ frame() [2/2]

Definition at line 191 of file weightFilter.h.

◆ operator()()

DistWeightFilter< DataPoint, WeightKernel >::WeightReturnType DistWeightFilter::operator() ( const DataPoint q) const
inline

Compute the weight of the given query with respect to its coordinates.

Parameters
_qQuery in global coordinate system

As the query \(\mathbf{q}\) is expressed in global coordinate, it is first converted to the centered basis. Then, the WeightKernel is directly applied to the norm of its coordinates with respect to the current scale \( t \) :

\( w(\frac{\left|\mathbf{q}_\mathsf{x}\right|}{t}) \)

See also
convertToLocalBasis
Returns
The computed weight + the point expressed in local basis

Definition at line 11 of file weightFilter.hpp.

◆ scaled2w()

DistWeightFilter< DataPoint, WeightKernel >::Scalar DistWeightFilter::scaled2w ( const VectorType _q,
const DataPoint  
) const
inline

Second order derivative in scale \(t\).

Parameters
_qQuery in global coordinate system

\( \frac{\delta^2 \frac{\left|\mathbf{q}\right|}{t}}{\delta t^2} \nabla w(\frac{\left|\mathbf{q}\right|}{t}) + \left(\frac{\delta \frac{\left|\mathbf{q}\right|}{t}}{\delta t}\right)^2 \nabla^2 w(\frac{\left|\mathbf{q}\right|}{t}) = \frac{2\left|\mathbf{q}\right|}{t^3} \nabla{w(\frac{\left|\mathbf{q}\right|}{t})} + \frac{\left|\mathbf{q}\right|^2}{t^4} \nabla^2{w(\frac{\left|\mathbf{q}\right|}{t})} \)

where \( \left|\mathbf{q}\right| \) represents the norm of the query coordinates expressed in centered basis.

Warning
Requires \(\nabla^2 w(x)\) to be valid

Definition at line 63 of file weightFilter.hpp.

◆ scaledw()

DistWeightFilter< DataPoint, WeightKernel >::Scalar DistWeightFilter::scaledw ( const VectorType _q,
const DataPoint  
) const
inline

First order derivative in scale \(t\).

Parameters
_qQuery in global coordinate system

\( \frac{\delta \frac{\left|\mathbf{q}\right|}{t}}{\delta t} \nabla w(\frac{\left|\mathbf{q}\right|}{t}) = - \frac{\left|\mathbf{q}\right|}{t^2} \nabla{w(\frac{\left|\mathbf{q}\right|}{t})} \)

where \( \left|\mathbf{q}\right| \) represents the norm of the query coordinates expressed in centered basis.

Warning
Requires \(\nabla w(x)\) to be valid

Definition at line 54 of file weightFilter.hpp.

◆ scaleSpaced2w()

DistWeightFilter< DataPoint, WeightKernel >::VectorType DistWeightFilter::scaleSpaced2w ( const VectorType _q,
const DataPoint  
) const
inline

Cross derivative in scale \(t\) and in space (for each spatial dimension \(\mathsf{x})\).

Parameters
_qQuery in global coordinate system

\( \frac{\delta^2 \frac{\left|\mathbf{q}_\mathsf{x}\right|}{t}}{\delta t\ \delta \mathsf{x}} \nabla w(\frac{\left|\mathbf{q}_\mathsf{x}\right|}{t}) + \frac{\delta \frac{\left|\mathbf{q}_\mathsf{x}\right|}{t}}{\delta \mathsf{x}} \frac{\delta \frac{\left|\mathbf{q}_\mathsf{x}\right|}{t}}{\delta t} \nabla^2 w(\frac{\left|\mathbf{q}_\mathsf{x}\right|}{t}) = -\frac{\mathbf{q}_\mathsf{x}}{t^2} \left( \frac{1}{\left|\mathbf{q}_\mathsf{x}\right|}\nabla w(\frac{\left|\mathbf{q}_\mathsf{x}\right|}{t}) + \frac{1}{t}\nabla^2 w(\frac{\left|\mathbf{q}_\mathsf{x}\right|}{t}) \right)\)

where \( \left|\mathbf{q}_\mathsf{x}\right| \) represents the norm of the query coordinates expressed in centered basis.

Warning
Requires \(\nabla^2 w(x)\) to be valid

Definition at line 74 of file weightFilter.hpp.

◆ spaced2w()

DistWeightFilter< DataPoint, WeightKernel >::MatrixType DistWeightFilter::spaced2w ( const VectorType _q,
const DataPoint  
) const
inline

Second order derivative in space (for each spatial dimension \(\mathsf{x})\).

Parameters
_qQuery in global coordinate system

\( \frac{\delta^2 \frac{\left|\mathbf{q}_\mathsf{x}\right|}{t}}{\delta \mathsf{x}^2} \nabla w(\frac{\left|\mathbf{q}_\mathsf{x}\right|}{t}) + \left(\frac{\delta \frac{\left|\mathbf{q}_\mathsf{x}\right|}{t}}{\delta \mathsf{x}}\right)^2 \nabla^2 w(\frac{\left|\mathbf{q}_\mathsf{x}\right|}{t}) = \frac{1}{t\left|\mathbf{q}_\mathsf{x}\right|} \left( I_d - \frac{\mathbf{q}_\mathsf{x}\mathbf{q}_\mathsf{x}^T}{\left|\mathbf{q}_\mathsf{x}\right|^2}\right) \nabla w(\frac{\left|\mathbf{q}_\mathsf{x}\right|}{t}) + \frac{\mathbf{q}_\mathsf{x}\mathbf{q}_\mathsf{x}^T}{t^2\left|\mathbf{q}_\mathsf{x}\right|^2} \nabla^2 w(\frac{\left|\mathbf{q}_\mathsf{x}\right|}{t}) \)

where \( \left|\mathbf{q}_\mathsf{x}\right| \) represents the norm of the query coordinates expressed in centered basis, for each spatial dimensions \( \mathsf{x}\).

Warning
Requires \(\nabla^2 w(x)\) to be valid

Definition at line 36 of file weightFilter.hpp.

◆ spacedw()

DistWeightFilter< DataPoint, WeightKernel >::VectorType DistWeightFilter::spacedw ( const VectorType _q,
const DataPoint  
) const
inline

First order derivative in space (for each spatial dimension \(\mathsf{x})\).

Parameters
_qQuery in global coordinate system

\( \frac{\delta \frac{\left|\mathbf{q}_\mathsf{x}\right|}{t}}{\delta \mathsf{x}} \nabla w(\frac{\left|\mathbf{q}_\mathsf{x}\right|}{t}) = \frac{\mathbf{q}}{t\left|q\right|} \nabla{w(\frac{\left|\mathbf{q}_\mathsf{x}\right|}{t})} \)

where \( \left|\mathbf{q}_\mathsf{x}\right| \) represents the norm of the query coordinates expressed in centered basis, for each spatial dimensions \( \mathsf{x}\).

Warning
Requires \(\nabla w(x)\) to be valid

Definition at line 22 of file weightFilter.hpp.

Member Data Documentation

◆ isCompact

constexpr bool Ponca::DistWeightFilter< _DataPoint, WeightKernel >::isCompact = WeightKernel::isCompact
staticconstexpr

Flag indicating if the weighting kernel is compact of not.

Definition at line 49 of file weightFilter.h.

◆ m_t

Evaluation scale.

Definition at line 194 of file weightFilter.h.

◆ m_wk

1D function applied to weight queries

Definition at line 195 of file weightFilter.h.