Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
vpRobust Class Reference

#include <visp3/core/vpRobust.h>

Public Types

enum  vpRobustEstimatorType { TUKEY, CAUCHY, HUBER }
 

Public Member Functions

 vpRobust (unsigned int n_data)
 
 vpRobust ()
 
 vpRobust (const vpRobust &other)
 
virtual ~vpRobust ()
 
void MEstimator (const vpRobustEstimatorType method, const vpColVector &residues, vpColVector &weights)
 
void MEstimator (const vpRobustEstimatorType method, const vpColVector &residues, const vpColVector &all_residues, vpColVector &weights)
 
vpRobustoperator= (const vpRobust &other)
 
vpRobustoperator= (const vpRobust &&other)
 
void resize (unsigned int n_data)
 
void setIteration (const unsigned int iter)
 
void setThreshold (const double noise_threshold)
 
vpColVector simultMEstimator (vpColVector &residues)
 

Detailed Description

Contains an M-Estimator and various influence function.

Supported methods: M-estimation, Tukey, Cauchy and Huber

Definition at line 60 of file vpRobust.h.

Member Enumeration Documentation

Enumeration of influence functions.

Enumerator
TUKEY 
CAUCHY 
HUBER 

Definition at line 65 of file vpRobust.h.

Constructor & Destructor Documentation

vpRobust::vpRobust ( unsigned int  n_data)

Default Constructor.

Constructor.

Parameters
n_data: Size of the data vector.

Definition at line 68 of file vpRobust.cpp.

References vpColVector::resize(), and vpCDEBUG.

vpRobust::vpRobust ( )

Default constructor.

Definition at line 82 of file vpRobust.cpp.

vpRobust::vpRobust ( const vpRobust other)

Copy constructor.

Definition at line 90 of file vpRobust.cpp.

virtual vpRobust::~vpRobust ( )
inlinevirtual

Destructor.

Definition at line 101 of file vpRobust.h.

Member Function Documentation

void vpRobust::MEstimator ( const vpRobustEstimatorType  method,
const vpColVector residues,
vpColVector weights 
)

Compute the weights according a residue vector and a PsiFunction.

Calculate an Mestimate given a particular loss function using MAD (Median Absolute Deviation) as a scale estimate at each iteration.

Precondition
Requires a column vector of residues.
Postcondition
Keeps a copy of the weights so that rejected points are kept at zero weight.
Parameters
method: Type of M-Estimator $\rho(r_i)$:
  • TUKEY : $ \rho(r_i, C) = \left\{ \begin{array}{ll} \frac{r_i^6}{6} - \frac{C^2r_i^4}{2} +\frac{C^4r_i^2}{2} & \mbox{if} |r_i| < C \\ \frac{1}{6} C^6 & \mbox{else} \end{array} \right. $ with influence function $ \psi(r_i, C) = \left\{ \begin{array}{ll} r_i(r_i^2-C^2)^2 & \mbox{if} |r_i| < C \\ 0 & \mbox{else} \end{array} \right. $ where $C=4.7 \hat{\sigma} $ and with $ \hat{\sigma} = 1.48{Med}_i(|r_i - {Med}_j(r_j)|) $
  • CAUCHY :
  • HUBER :
Parameters
residues: Residues $ r_i $ used in the previous formula.
weights: Vector of weights $w_i = \frac{\psi(r_i)}{r_i}$. Values are in [0, 1]. A value near zero means that the data is an outlier. This vector must have the same size residue vector.
Returns
Returns a Column Vector of weights associated to each residue.

Definition at line 182 of file vpRobust.cpp.

References CAUCHY, vpArray2D< Type >::getRows(), HUBER, resize(), TUKEY, and vpCDEBUG.

Referenced by vpMbEdgeKltTracker::computeVVS(), vpMbEdgeTracker::computeVVSSecondPhaseWeights(), vpMbKltTracker::computeVVSWeights(), vpMeLine::leastSquare(), vpPose::poseVirtualVSrobust(), and vpHomography::robust().

void vpRobust::MEstimator ( const vpRobustEstimatorType  method,
const vpColVector residues,
const vpColVector all_residues,
vpColVector weights 
)

Compute the weights according a residue vector and a PsiFunction.

Definition at line 254 of file vpRobust.cpp.

References CAUCHY, vpArray2D< Type >::getRows(), HUBER, TUKEY, and vpCDEBUG.

vpRobust & vpRobust::operator= ( const vpRobust other)

Copy operator.

Definition at line 98 of file vpRobust.cpp.

vpRobust & vpRobust::operator= ( const vpRobust &&  other)

Move operator.

Definition at line 115 of file vpRobust.cpp.

void vpRobust::resize ( unsigned int  n_data)

Resize containers for sort methods.

Resize containers.

Parameters
n_data: size of input data vector.

Definition at line 134 of file vpRobust.cpp.

References vpColVector::resize().

Referenced by vpMbEdgeKltTracker::computeVVS(), and MEstimator().

void vpRobust::setThreshold ( const double  noise_threshold)
inline

Set maximal noise threshold.

Parameters
noise_threshold: Maximal noise threshold.

Definition at line 129 of file vpRobust.h.

Referenced by vpMbEdgeKltTracker::computeVVS(), vpMbEdgeTracker::computeVVSSecondPhaseWeights(), vpMbKltTracker::computeVVSWeights(), vpMeLine::leastSquare(), and vpPose::poseVirtualVSrobust().

vpColVector vpRobust::simultMEstimator ( vpColVector residues)

Simult Mestimator.

Calculate an Mestimate with a simultaneous scale estimate using HUBER's influence function.

Precondition
Requires a column vector of residues
Postcondition
None
Returns
Returns a Column Vector of weights associated to each residue

Definition at line 393 of file vpRobust.cpp.

References vpArray2D< Type >::getRows(), and vpCDEBUG.