Ponca  aa50bfdf187919869239c5b44b748842569114c1
Point Cloud Analysis library
Loading...
Searching...
No Matches
Ponca::MeanPosition< DataPoint, _WFunctor, T > Class Template Reference

Compute the barycenter of the input points. More...

#include <mean.h>

+ Inheritance diagram for Ponca::MeanPosition< DataPoint, _WFunctor, T >:
+ Collaboration diagram for Ponca::MeanPosition< DataPoint, _WFunctor, 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.
 

Public Member Functions

MeanPosition< DataPoint, _WFunctor, T > & meanPosition ()
 Explicit conversion to MeanPosition , to access methods potentially hidden by heritage.
 
const MeanPosition< DataPoint, _WFunctor, T > & meanPosition () const
 Explicit conversion to MeanPosition , 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)
 Add a neighbor to perform the fit.
 
VectorType barycenter () const
 Barycenter of the input points expressed in the global frame.
 

Protected Types

enum  { PROVIDES_MEAN_POSITION }
 
using Base = T
 Base class of the procedure.
 

Protected Member Functions

VectorType barycenterLocal () const
 Barycenter of the input points expressed in the local frame.
 

Protected Attributes

VectorType m_sumP {VectorType::Zero()}
 Sum of the input points vectors.
 

Detailed Description

template<class DataPoint, class _WFunctor, typename T>
class Ponca::MeanPosition< DataPoint, _WFunctor, T >

Compute the barycenter of the input points.

Warning
The barycenter is not stored explicitly, but rather computed from the sum of the neighbors positions.

This primitive provides:

PROVIDES_MEAN_POSITION 

Definition at line 24 of file mean.h.

Member Typedef Documentation

◆ Base

template<class DataPoint , class _WFunctor , typename T >
using Ponca::MeanPosition< DataPoint, _WFunctor, T >::Base = T
protected

Base class of the procedure.

Definition at line 25 of file mean.h.

◆ Scalar

template<class DataPoint , class _WFunctor , typename T >
using Ponca::MeanPosition< DataPoint, _WFunctor, T >::Scalar = typename DataPoint::Scalar

Alias to scalar type.

Definition at line 25 of file mean.h.

◆ VectorType

template<class DataPoint , class _WFunctor , typename T >
using Ponca::MeanPosition< DataPoint, _WFunctor, T >::VectorType = typename Base::VectorType

Alias to vector type.

Definition at line 25 of file mean.h.

◆ WFunctor

template<class DataPoint , class _WFunctor , typename T >
using Ponca::MeanPosition< DataPoint, _WFunctor, T >::WFunctor = typename Base::WFunctor

Alias to weight function.

Definition at line 25 of file mean.h.

Member Enumeration Documentation

◆ anonymous enum

template<class DataPoint , class _WFunctor , typename T >
anonymous enum
protected

Definition at line 28 of file mean.h.

Member Function Documentation

◆ addLocalNeighbor()

template<class DataPoint , class _WFunctor , typename T >
bool MeanPosition::addLocalNeighbor ( Scalar  w,
const VectorType localQ,
const DataPoint &  attributes 
)
inline

Add a neighbor to perform the fit.

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

Definition at line 19 of file mean.hpp.

◆ barycenter()

template<class DataPoint , class _WFunctor , typename T >
VectorType Ponca::MeanPosition< DataPoint, _WFunctor, T >::barycenter ( ) const
inline

Barycenter of the input points expressed in the global frame.

Defined as \( 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

Definition at line 40 of file mean.h.

◆ barycenterLocal()

template<class DataPoint , class _WFunctor , typename T >
VectorType Ponca::MeanPosition< DataPoint, _WFunctor, T >::barycenterLocal ( ) const
inlineprotected

Barycenter of the input points expressed in the local frame.

See also
barycenter()
Warning
Provided for internal use only: any access to the barycenter in other computing classes must be done using this function and not barycenter()

Defined as \( 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

Definition at line 54 of file mean.h.

◆ init()

template<class DataPoint , class _WFunctor , typename T >
void MeanPosition::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 12 of file mean.hpp.

◆ meanPosition() [1/2]

template<class DataPoint , class _WFunctor , typename T >
MeanPosition< DataPoint, _WFunctor, T > & Ponca::MeanPosition< DataPoint, _WFunctor, T >::meanPosition ( )
inline

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

Definition at line 32 of file mean.h.

◆ meanPosition() [2/2]

template<class DataPoint , class _WFunctor , typename T >
const MeanPosition< DataPoint, _WFunctor, T > & Ponca::MeanPosition< DataPoint, _WFunctor, T >::meanPosition ( ) const
inline

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

Definition at line 32 of file mean.h.

Member Data Documentation

◆ m_sumP

template<class DataPoint , class _WFunctor , typename T >
VectorType Ponca::MeanPosition< DataPoint, _WFunctor, T >::m_sumP {VectorType::Zero()}
protected

Sum of the input points vectors.

Definition at line 29 of file mean.h.