ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
RobustKernel.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 // @author Ignacio Vizzo [ivizzo@uni-bonn.de]
8 //
9 // Copyright (c) 2020 Ignacio Vizzo, Cyrill Stachniss, University of Bonn.
10 // ----------------------------------------------------------------------------
11 
12 #pragma once
13 
14 namespace cloudViewer {
15 namespace pipelines {
16 namespace registration {
17 
43 class RobustKernel {
44 public:
45  virtual ~RobustKernel() = default;
51  virtual double Weight(double residual) const = 0;
52 };
53 
60 class L2Loss : public RobustKernel {
61 public:
66  double Weight(double residual) const override;
67 };
68 
74 // p(r) = abs(r)
75 class L1Loss : public RobustKernel {
76 public:
81  double Weight(double residual) const override;
82 };
83 
93 class HuberLoss : public RobustKernel {
94 public:
100  explicit HuberLoss(double k) : k_(k) {}
101 
108  double Weight(double residual) const override;
109 
110 public:
112  double k_;
113 };
114 
121 class CauchyLoss : public RobustKernel {
122 public:
126  explicit CauchyLoss(double k) : k_(k) {}
127 
133  double Weight(double residual) const override;
134 
135 public:
137  double k_;
138 };
139 
146 class GMLoss : public RobustKernel {
147 public:
151  explicit GMLoss(double k) : k_(k) {}
152 
158  double Weight(double residual) const override;
159 
160 public:
162  double k_;
163 };
164 
175 class TukeyLoss : public RobustKernel {
176 public:
180  explicit TukeyLoss(double k) : k_(k) {}
181 
182 public:
189  double Weight(double residual) const override;
190 
191 public:
192  double k_;
193 };
194 
195 } // namespace registration
196 } // namespace pipelines
197 } // namespace cloudViewer
CauchyLoss(double k)
Parametrized Constructor.
Definition: RobustKernel.h:126
double Weight(double residual) const override
double Weight(double residual) const override
GMLoss(double k)
Parametrized Constructor.
Definition: RobustKernel.h:151
HuberLoss(double k)
Parametrized Constructor.
Definition: RobustKernel.h:100
double Weight(double residual) const override
double Weight(double residual) const override
double Weight(double residual) const override
virtual double Weight(double residual) const =0
TukeyLoss(double k)
Parametrized Constructor.
Definition: RobustKernel.h:180
double Weight(double residual) const override
Generic file read and write utility for python interface.