g2o
Loading...
Searching...
No Matches
Public Member Functions | List of all members
g2o::RobustKernelHuber Class Reference

Huber Cost Function. More...

#include <robust_kernel_impl.h>

Inheritance diagram for g2o::RobustKernelHuber:
Inheritance graph
[legend]
Collaboration diagram for g2o::RobustKernelHuber:
Collaboration graph
[legend]

Public Member Functions

virtual void robustify (double e2, Vector3 &rho) const
 
- Public Member Functions inherited from g2o::RobustKernel
 RobustKernel ()
 
 RobustKernel (double delta)
 
virtual ~RobustKernel ()
 
virtual void setDelta (double delta)
 
double delta () const
 

Additional Inherited Members

- Protected Attributes inherited from g2o::RobustKernel
double _delta
 

Detailed Description

Huber Cost Function.

Loss function as described by Huber See http://en.wikipedia.org/wiki/Huber_loss_function

If e^(1/2) < d rho(e) = e

else

          1/2    2

rho(e) = 2 d e - d

Definition at line 77 of file robust_kernel_impl.h.

Member Function Documentation

◆ robustify()

void g2o::RobustKernelHuber::robustify ( double  squaredError,
Vector3 rho 
) const
virtual

compute the scaling factor for a error: The error is e^T Omega e The output rho is rho[0]: The actual scaled error value rho[1]: First derivative of the scaling function rho[2]: Second derivative of the scaling function

Implements g2o::RobustKernel.

Definition at line 60 of file robust_kernel_impl.cpp.

60 {
61 double dsqr = _delta * _delta;
62 if (e <= dsqr) { // inlier
63 rho[0] = e;
64 rho[1] = 1.;
65 rho[2] = 0.;
66 } else { // outlier
67 double sqrte = sqrt(e); // absolute value of the error
68 rho[0] =
69 2 * sqrte * _delta - dsqr; // rho(e) = 2 * delta * e^(1/2) - delta^2
70 rho[1] = _delta / sqrte; // rho'(e) = delta / sqrt(e)
71 rho[2] = -0.5 * rho[1] /
72 e; // rho''(e) = -1 / (2*e^(3/2)) = -1/2 * (delta/e) / e
73 }
74}
Jet< T, N > sqrt(const Jet< T, N > &f)
Definition jet.h:444

References g2o::RobustKernel::_delta.


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