|
| MeanNormalDer< DataPoint, _NFilter, DiffType, T > & | meanNormalDer () |
| | Explicit conversion to MeanNormalDer , to access methods potentially hidden by heritage.
|
| |
| const MeanNormalDer< DataPoint, _NFilter, DiffType, T > & | meanNormalDer () const |
| | Explicit conversion to MeanNormalDer , to access methods potentially hidden by heritage.
|
| |
| void | init () |
| | 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 | dMeanNormal () const |
| | Compute the derivative of the mean normal vector of the input points.
|
| |
template<class DataPoint, class _NFilter, int DiffType, typename T>
class Ponca::MeanNormalDer< DataPoint, _NFilter, DiffType, T >
Compute the derivatives of the input points mean normal.
This primitive requires:
PROVIDES_PRIMITIVE_DERIVATIVE, PROVIDES_MEAN_NORMAL
This primitive provides:
PROVIDES_MEAN_NORMAL_DERIVATIVE
- See also
- MeanNormal
Definition at line 173 of file mean.h.
template<class DataPoint , class _NFilter , int DiffType, typename T >
Compute the derivative of the mean normal vector of the input points.
Step-by-step derivation of the mean normal :
Given the definition of the mean normal \( n(\mathbf{x}) = \frac{\sum_i w_\mathbf{x}(\mathbf{p_i}) \mathbf{n_i}}{\sum_i w_\mathbf{x}(\mathbf{p_i})} \), where \(\left[\mathbf{p_i}, \mathbf{n_i} \in \text{neighborhood}(\mathbf{x})\right]\) are all the point and normal samples in \(\mathbf{x}\)'s neighborhood.
We denote \( t(\mathbf{x}) = \sum_i w_\mathbf{x}(\mathbf{p_i}) \mathbf{n_i} \) and \( s(\mathbf{x}) = \sum_i w_\mathbf{x}(\mathbf{p_i})\), such that \( n(\mathbf{x}) = \frac{t(\mathbf{x})}{s(\mathbf{x})}\).
By definition, \( n'(\mathbf{x}) = \frac{s(\mathbf{x})t'(\mathbf{x}) - t(\mathbf{x})s'(\mathbf{x})}{s(\mathbf{x})^2}\).
Assuming the weight of each normal is dependent on the position, 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{n_i} \).
Assuming the normal vectors themselves do not change with position, \(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{n_i}) \mathbf{n_i} \).
Which leads to \( n'(\mathbf{x}) = \frac{\sum_i w'_\mathbf{x}(\mathbf{p_i}) \mathbf{n_i} - n(\mathbf{x})\sum_i w'_\mathbf{x}(\mathbf{p_i})}{\sum_i w_\mathbf{x}(\mathbf{p_i})} \).
- Note
- This code is not directly tested.
Definition at line 214 of file mean.h.