|
MeanPositionDer< DataPoint, _WFunctor, DiffType, T > & | meanPositionDer () |
| Explicit conversion to MeanPositionDer , to access methods potentially hidden by heritage.
|
|
const MeanPositionDer< DataPoint, _WFunctor, DiffType, T > & | meanPositionDer () const |
| Explicit conversion to MeanPositionDer , to access methods potentially hidden by heritage.
|
|
void | init (const VectorType &_evalPos) |
| Set the evaluation position and reset the internal states.
|
|
bool | addLocalNeighbor (Scalar w, const VectorType &localQ, const DataPoint &attributes, ScalarArray &dw) |
| Add a neighbor to perform the fit.
|
|
VectorArray | barycenterDerivatives () const |
| Compute derivatives of the barycenter (in local frame).
|
|
template<class DataPoint, class _WFunctor, int DiffType, typename T>
class Ponca::MeanPositionDer< DataPoint, _WFunctor, DiffType, T >
Definition at line 102 of file mean.h.
template<class DataPoint , class _WFunctor , int DiffType, typename T >
Compute derivatives of the barycenter (in local frame).
- See also
- MeanPosition::barycenterLocal()
Step-by-step derivation from the barycenter definition
Given the definition of the barycenter \( b(\mathbf{x}) = \frac{\sum_i w_\mathbf{x}(\mathbf{p_i}) \mathbf{p_i}}{\sum_i w_\mathbf{x}(\mathbf{p_i})} \), where \(\left[\mathbf{p_i} \in \text{neighborhood}(\mathbf{x})\right]\) are all the point samples in \(\mathbf{x}\)'s neighborhood.
We denote \( t(\mathbf{x}) = \sum_i w_\mathbf{x}(\mathbf{p_i}) \mathbf{p_i} \) and \( s(\mathbf{x}) = \sum_i w_\mathbf{x}(\mathbf{p_i})\), such that \( b(\mathbf{x}) = \frac{t(\mathbf{x})}{s(\mathbf{x})}\).
By definition, \( b'(\mathbf{x}) = \frac{s(\mathbf{x})t'(\mathbf{x}) - t(\mathbf{x})s'(\mathbf{x})}{s(\mathbf{x})^2}\). We have \( s'(\mathbf{x}) = \sum_i w'_\mathbf{x}(\mathbf{p_i}) \).
We rewrite \( t(\mathbf{x}) = \sum u(\mathbf{x})v(\mathbf{x}) \), with \( u(\mathbf{x}) = w_\mathbf{x}(\mathbf{p_i}) \) and \( v(\mathbf{x}) = \mathbf{p_i} \).
As the point cloud coordinates are constants, \(v(\mathbf{x})\) is constant, its derivative is null, and so \( t'(\mathbf{x}) = \sum_i u'(\mathbf{x}) v(\mathbf{x}) = \sum_i w'_\mathbf{x}(\mathbf{p_i}) \mathbf{p_i} \).
Which leads to \( b'(\mathbf{x}) = \frac{\sum_i w'_\mathbf{x}(\mathbf{p_i}) \mathbf{p_i} - b(\mathbf{x})\sum w'(\mathbf{x})}{\sum_i w_\mathbf{x}(\mathbf{p_i})} \)
- Note
- This code is not directly tested, but rather indirectly by testing CovariancePlaneDer::dNormal()
Definition at line 141 of file mean.h.