Ponca  e26a0e88a45818354616c1a7180bcd203aecad3c
Point Cloud Analysis library
Loading...
Searching...
No Matches
Ponca::MeanNormalDer< DataPoint, _WFunctor, DiffType, T > Class Template Reference
+ Inheritance diagram for Ponca::MeanNormalDer< DataPoint, _WFunctor, DiffType, T >:
+ Collaboration diagram for Ponca::MeanNormalDer< DataPoint, _WFunctor, DiffType, T >:

Public Types

using Scalar = typename DataPoint::Scalar
 Alias to scalar type.
 
using VectorType = typename Base::VectorType
 Alias to vector type.
 
using WFunctor = typename Base::WFunctor
 Alias to weight function.
 
using ScalarArray = typename Base::ScalarArray
 Alias to scalar derivatives array.
 
using VectorArray = typename Base::VectorArray
 Alias to vector derivatives array.
 

Public Member Functions

MeanNormalDer< DataPoint, _WFunctor, DiffType, T > & meanNormalDer ()
 Explicit conversion to MeanNormalDer , to access methods potentially hidden by heritage.
 
const MeanNormalDer< DataPoint, _WFunctor, DiffType, T > & meanNormalDer () const
 Explicit conversion to MeanNormalDer , 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 dMeanNormal () const
 Compute the derivative of the mean normal vector of the input points.
 

Protected Types

enum  { Check , PROVIDES_MEAN_NORMAL_DERIVATIVE }
 
using Base = T
 Base class of the procedure.
 

Protected Attributes

VectorArray m_dSumN {VectorArray::Zero()}
 Derivatives of the input normals of the input points vectors.
 

Detailed Description

template<class DataPoint, class _WFunctor, int DiffType, typename T>
class Ponca::MeanNormalDer< DataPoint, _WFunctor, DiffType, T >

Definition at line 135 of file mean.h.

Member Typedef Documentation

◆ Base

template<class DataPoint , class _WFunctor , int DiffType, typename T >
using Ponca::MeanNormalDer< DataPoint, _WFunctor, DiffType, T >::Base = T
protected

Base class of the procedure.

Definition at line 136 of file mean.h.

◆ Scalar

template<class DataPoint , class _WFunctor , int DiffType, typename T >
using Ponca::MeanNormalDer< DataPoint, _WFunctor, DiffType, T >::Scalar = typename DataPoint::Scalar

Alias to scalar type.

Definition at line 136 of file mean.h.

◆ ScalarArray

template<class DataPoint , class _WFunctor , int DiffType, typename T >
using Ponca::MeanNormalDer< DataPoint, _WFunctor, DiffType, T >::ScalarArray = typename Base::ScalarArray

Alias to scalar derivatives array.

Definition at line 137 of file mean.h.

◆ VectorArray

template<class DataPoint , class _WFunctor , int DiffType, typename T >
using Ponca::MeanNormalDer< DataPoint, _WFunctor, DiffType, T >::VectorArray = typename Base::VectorArray

Alias to vector derivatives array.

Definition at line 137 of file mean.h.

◆ VectorType

template<class DataPoint , class _WFunctor , int DiffType, typename T >
using Ponca::MeanNormalDer< DataPoint, _WFunctor, DiffType, T >::VectorType = typename Base::VectorType

Alias to vector type.

Definition at line 136 of file mean.h.

◆ WFunctor

template<class DataPoint , class _WFunctor , int DiffType, typename T >
using Ponca::MeanNormalDer< DataPoint, _WFunctor, DiffType, T >::WFunctor = typename Base::WFunctor

Alias to weight function.

Definition at line 136 of file mean.h.

Member Enumeration Documentation

◆ anonymous enum

template<class DataPoint , class _WFunctor , int DiffType, typename T >
anonymous enum
protected
Enumerator
PROVIDES_MEAN_NORMAL_DERIVATIVE 

Provides derivative of the mean normal.

Definition at line 140 of file mean.h.

Member Function Documentation

◆ addLocalNeighbor()

template<class DataPoint , class _WFunctor , int DiffType, typename T >
bool MeanNormalDer::addLocalNeighbor ( Scalar  w,
const VectorType localQ,
const DataPoint &  attributes,
ScalarArray dw 
)
inline

Add a neighbor to perform the fit.

Returns
false if param nei is not a valid neighbour (weight = 0)

Definition at line 82 of file mean.hpp.

◆ dMeanNormal()

template<class DataPoint , class _WFunctor , int DiffType, typename T >
VectorArray Ponca::MeanNormalDer< DataPoint, _WFunctor, DiffType, T >::dMeanNormal ( ) const
inline

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 176 of file mean.h.

◆ init()

template<class DataPoint , class _WFunctor , int DiffType, typename T >
void MeanNormalDer::init ( const VectorType _evalPos)
inline

Set the evaluation position and reset the internal states.

Warning
Must be called be for any computation (but after #setWeightFunc)

Definition at line 75 of file mean.hpp.

◆ meanNormalDer() [1/2]

template<class DataPoint , class _WFunctor , int DiffType, typename T >
MeanNormalDer< DataPoint, _WFunctor, DiffType, T > & Ponca::MeanNormalDer< DataPoint, _WFunctor, DiffType, T >::meanNormalDer ( )
inline

Explicit conversion to MeanNormalDer , to access methods potentially hidden by heritage.

Definition at line 151 of file mean.h.

◆ meanNormalDer() [2/2]

template<class DataPoint , class _WFunctor , int DiffType, typename T >
const MeanNormalDer< DataPoint, _WFunctor, DiffType, T > & Ponca::MeanNormalDer< DataPoint, _WFunctor, DiffType, T >::meanNormalDer ( ) const
inline

Explicit conversion to MeanNormalDer , to access methods potentially hidden by heritage.

Definition at line 151 of file mean.h.

Member Data Documentation

◆ m_dSumN

template<class DataPoint , class _WFunctor , int DiffType, typename T >
VectorArray Ponca::MeanNormalDer< DataPoint, _WFunctor, DiffType, T >::m_dSumN {VectorArray::Zero()}
protected

Derivatives of the input normals of the input points vectors.

Definition at line 147 of file mean.h.