Public Types | Public Member Functions | Private Attributes
rrel_trunc_quad_obj Class Reference

Truncated quadratic robust loss function. More...

#include <rrel_trunc_quad_obj.h>

Inheritance diagram for rrel_trunc_quad_obj:
Inheritance graph
[legend]

List of all members.

Public Types

typedef vcl_vector< double >
::const_iterator 
vect_const_iter
 The iterators used to pass in values.
typedef vcl_vector< double >
::iterator 
vect_iter
 The iterators used to pass out values.

Public Member Functions

 rrel_trunc_quad_obj (double scale_mult=2.0)
 Constructor.
virtual ~rrel_trunc_quad_obj ()
 Destructor.
virtual double rho (double u) const
 The robust loss function for the M-estimator.
virtual double rho (double r, double s) const
 The robust loss function for the M-estimator.
virtual double wgt (double u) const
 The weight of the residual.
virtual void wgt (vect_const_iter res_begin, vect_const_iter res_end, vect_const_iter scale_begin, vect_iter wgt_begin) const
 Evaluate the objective function on heteroscedastic residuals.
virtual void wgt (vect_const_iter begin, vect_const_iter end, double scale, vect_iter wgt_begin) const
 Computes the weights for homoscedastic residuals.
virtual double wgt (double r, double s) const
 The weight of the residual.
double wgt_fast (double u) const
 Fast version of the wgt(u) computation.
double rho_fast (double u) const
 Fast version of the rho(u) computation.
virtual double fcn (vect_const_iter res_begin, vect_const_iter res_end, vect_const_iter scale_begin, vnl_vector< double > *=0) const
 Evaluate the objective function on heteroscedastic residuals.
virtual double fcn (vect_const_iter begin, vect_const_iter end, double scale, vnl_vector< double > *=0) const
 Evaluate the objective function on homoscedastic residuals.
virtual bool requires_prior_scale () const
 False.
virtual bool can_estimate_scale () const
 True if the objective function can estimate scale.
virtual double scale (vect_const_iter, vect_const_iter) const
 Scale estimate.

Private Attributes

double T_sqr_
 Squared threshold.

Detailed Description

Truncated quadratic robust loss function.

The objective function for the truncated quadratic M-estimator is

\[ \rho(u) = \left\{ \begin{array}{ll} u^2, & |u| \le T \\ T^2, & |u| > T \end{array} \right. \]

where u is a scale-normalized residual ( $ r/\sigma $) and $ T $ is a threshold. This has been used in a number of vision applications despite the fact that the wgt function is discontinuous. This is the same cost function used in the MSAC generalisation of RANSAC.

Definition at line 29 of file rrel_trunc_quad_obj.h.


Member Typedef Documentation

typedef vcl_vector<double>::const_iterator rrel_objective::vect_const_iter [inherited]

The iterators used to pass in values.

Since we don't allow member templates, we have to fix on a particular type of container for residuals. Using this typedef will allow things to easily change when member templates are allowed.

Definition at line 27 of file rrel_objective.h.

typedef vcl_vector<double>::iterator rrel_objective::vect_iter [inherited]

The iterators used to pass out values.

Definition at line 30 of file rrel_objective.h.


Constructor & Destructor Documentation

rrel_trunc_quad_obj::rrel_trunc_quad_obj ( double  scale_mult = 2.0)

Constructor.

scale_mult * scale is the truncation threshold.

Definition at line 4 of file rrel_trunc_quad_obj.cxx.

rrel_trunc_quad_obj::~rrel_trunc_quad_obj ( ) [virtual]

Destructor.

Definition at line 10 of file rrel_trunc_quad_obj.cxx.


Member Function Documentation

virtual bool rrel_objective::can_estimate_scale ( ) const [inline, virtual, inherited]

True if the objective function can estimate scale.

Some objective functions, such as MUSE, can provide an accurate inlier scale estimate.

Reimplemented in rrel_muset_obj, and rrel_lms_obj.

Definition at line 72 of file rrel_objective.h.

double rrel_m_est_obj::fcn ( vect_const_iter  res_begin,
vect_const_iter  res_end,
vect_const_iter  scale_begin,
vnl_vector< double > *  = 0 
) const [virtual, inherited]

Evaluate the objective function on heteroscedastic residuals.

See also:
rrel_objective::fcn.

Implements rrel_objective.

Definition at line 5 of file rrel_m_est_obj.cxx.

double rrel_m_est_obj::fcn ( vect_const_iter  begin,
vect_const_iter  end,
double  scale,
vnl_vector< double > *  = 0 
) const [virtual, inherited]

Evaluate the objective function on homoscedastic residuals.

See also:
rrel_objective::fcn.

Implements rrel_objective.

Definition at line 19 of file rrel_m_est_obj.cxx.

virtual bool rrel_m_est_obj::requires_prior_scale ( ) const [inline, virtual, inherited]

False.

In general, most M-estimators work quite well with an estimated scale. The scale estimate should be robust, but not necessarily efficient (e.g. MAD scale estimate.)

Implements rrel_objective.

Definition at line 73 of file rrel_m_est_obj.h.

double rrel_trunc_quad_obj::rho ( double  u) const [virtual]

The robust loss function for the M-estimator.

Implements rrel_m_est_obj.

Definition at line 16 of file rrel_trunc_quad_obj.cxx.

virtual double rrel_trunc_quad_obj::rho ( double  r,
double  s 
) const [inline, virtual]

The robust loss function for the M-estimator.

Overriding the overloaded version rho(u) hides the superclass' implementation of this version of rho(). This implementation simply calls the superclass' version of the same routine. r is the residual and s is the scale for that residual.

Reimplemented from rrel_m_est_obj.

Definition at line 48 of file rrel_trunc_quad_obj.h.

double rrel_trunc_quad_obj::rho_fast ( double  u) const [inline]

Fast version of the rho(u) computation.

Definition at line 97 of file rrel_trunc_quad_obj.h.

virtual double rrel_objective::scale ( vect_const_iter  ,
vect_const_iter   
) const [inline, virtual, inherited]

Scale estimate.

The result is undefined if can_estimate_scale() is false.

Reimplemented in rrel_muset_obj, and rrel_lms_obj.

Definition at line 76 of file rrel_objective.h.

double rrel_trunc_quad_obj::wgt ( double  u) const [virtual]

The weight of the residual.

Implements rrel_m_est_obj.

Definition at line 22 of file rrel_trunc_quad_obj.cxx.

virtual void rrel_trunc_quad_obj::wgt ( vect_const_iter  res_begin,
vect_const_iter  res_end,
vect_const_iter  scale_begin,
vect_iter  wgt_begin 
) const [inline, virtual]

Evaluate the objective function on heteroscedastic residuals.

Overriding the overloaded version wgt(u) hides the superclass' implementation of this version of wgt(). This implementation simply calls the superclass' version of the same routine.

See also:
rrel_wls_obj::wgt()

Reimplemented from rrel_m_est_obj.

Definition at line 59 of file rrel_trunc_quad_obj.h.

virtual void rrel_trunc_quad_obj::wgt ( vect_const_iter  begin,
vect_const_iter  end,
double  scale,
vect_iter  wgt_begin 
) const [inline, virtual]

Computes the weights for homoscedastic residuals.

Overriding the overloaded version wgt(u) hides the superclass' implementation of this version of wgt(). This implementation simply calls the superclass' version of the same routine.

See also:
rrel_wls_obj::wgt()

Reimplemented from rrel_m_est_obj.

Definition at line 69 of file rrel_trunc_quad_obj.h.

virtual double rrel_trunc_quad_obj::wgt ( double  r,
double  s 
) const [inline, virtual]

The weight of the residual.

Overriding the overloaded version wgt(u) hides the superclass' implementation of this version of wgt(). This implementation simply calls the superclass' version of the same routine. r is the residual and s is the scale for that residual.

Reimplemented from rrel_m_est_obj.

Definition at line 80 of file rrel_trunc_quad_obj.h.

double rrel_trunc_quad_obj::wgt_fast ( double  u) const [inline]

Fast version of the wgt(u) computation.

Definition at line 104 of file rrel_trunc_quad_obj.h.


Member Data Documentation

double rrel_trunc_quad_obj::T_sqr_ [private]

Squared threshold.

Definition at line 92 of file rrel_trunc_quad_obj.h.


The documentation for this class was generated from the following files: