Open3D (C++ API)  0.11.0
RobustKernel.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // The MIT License (MIT)
5 //
6 // Copyright (c) 2018 www.open3d.org
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to deal
10 // in the Software without restriction, including without limitation the rights
11 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 // copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // The above copyright notice and this permission notice shall be included in
16 // all copies or substantial portions of the Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 // IN THE SOFTWARE.
25 // ----------------------------------------------------------------------------
26 // @author Ignacio Vizzo [ivizzo@uni-bonn.de]
27 //
28 // Copyright (c) 2020 Ignacio Vizzo, Cyrill Stachniss, University of Bonn.
29 // ----------------------------------------------------------------------------
30 
31 #pragma once
32 
33 namespace open3d {
34 namespace pipelines {
35 namespace registration {
36 
62 class RobustKernel {
63 public:
64  virtual ~RobustKernel() = default;
70  virtual double Weight(double /*residual*/) const = 0;
71 };
72 
79 class L2Loss : public RobustKernel {
80 public:
85  double Weight(double residual) const override;
86 };
87 
93 // p(r) = abs(r)
94 class L1Loss : public RobustKernel {
95 public:
100  double Weight(double residual) const override;
101 };
102 
112 class HuberLoss : public RobustKernel {
113 public:
119  explicit HuberLoss(double k) : k_(k) {}
120 
127  double Weight(double residual) const override;
128 
129 public:
131  double k_;
132 };
133 
140 class CauchyLoss : public RobustKernel {
141 public:
145  explicit CauchyLoss(double k) : k_(k) {}
146 
152  double Weight(double residual) const override;
153 
154 public:
156  double k_;
157 };
158 
165 class GMLoss : public RobustKernel {
166 public:
170  explicit GMLoss(double k) : k_(k) {}
171 
177  double Weight(double residual) const override;
178 
179 public:
181  double k_;
182 };
183 
194 class TukeyLoss : public RobustKernel {
195 public:
199  explicit TukeyLoss(double k) : k_(k) {}
200 
201 public:
208  double Weight(double residual) const override;
209 
210 public:
211  double k_;
212 };
213 
214 } // namespace registration
215 } // namespace pipelines
216 } // namespace open3d
Definition: RobustKernel.h:94
double k_
Scaling paramter.
Definition: RobustKernel.h:156
double k_
Definition: RobustKernel.h:211
Definition: RobustKernel.h:165
CauchyLoss(double k)
Parametrized Constructor.
Definition: RobustKernel.h:145
Definition: RobustKernel.h:140
TukeyLoss(double k)
Parametrized Constructor.
Definition: RobustKernel.h:199
virtual double Weight(double) const =0
Definition: RobustKernel.h:194
double k_
Scaling paramter.
Definition: RobustKernel.h:181
Definition: RobustKernel.h:112
Definition: PinholeCameraIntrinsic.cpp:35
Definition: RobustKernel.h:79
double k_
Scaling paramter.
Definition: RobustKernel.h:131
GMLoss(double k)
Parametrized Constructor.
Definition: RobustKernel.h:170
HuberLoss(double k)
Parametrized Constructor.
Definition: RobustKernel.h:119