Loading [MathJax]/extensions/TeX/AMSsymbols.js
Open3D (C++ API)  0.14.1
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TransformationEstimation.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-2021 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 
27 #pragma once
28 
29 #include <memory>
30 #include <string>
31 #include <utility>
32 #include <vector>
33 
34 #include "open3d/core/Tensor.h"
38 
39 namespace open3d {
40 
41 namespace t {
42 namespace geometry {
43 class PointCloud;
44 }
45 
46 namespace pipelines {
47 namespace registration {
48 
50  Unspecified = 0,
51  PointToPoint = 1,
52  PointToPlane = 2,
53  ColoredICP = 3,
54 };
55 
62 public:
66 
67 public:
68  virtual TransformationEstimationType GetTransformationEstimationType()
69  const = 0;
70 
80  virtual double ComputeRMSE(const geometry::PointCloud &source,
81  const geometry::PointCloud &target,
82  const core::Tensor &correspondences) const = 0;
94  virtual core::Tensor ComputeTransformation(
95  const geometry::PointCloud &source,
96  const geometry::PointCloud &target,
97  const core::Tensor &correspondences) const = 0;
98 };
99 
105 public:
106  // TODO: support with_scaling.
109 
110 public:
112  const override {
113  return type_;
114  };
124  double ComputeRMSE(const geometry::PointCloud &source,
125  const geometry::PointCloud &target,
126  const core::Tensor &correspondences) const override;
127 
139  core::Tensor ComputeTransformation(
140  const geometry::PointCloud &source,
141  const geometry::PointCloud &target,
142  const core::Tensor &correspondences) const override;
143 
144 private:
145  const TransformationEstimationType type_ =
146  TransformationEstimationType::PointToPoint;
147 };
148 
154 public:
158 
164  : kernel_(kernel) {}
165 
166 public:
168  const override {
169  return type_;
170  };
171 
182  double ComputeRMSE(const geometry::PointCloud &source,
183  const geometry::PointCloud &target,
184  const core::Tensor &correspondences) const override;
185 
198  core::Tensor ComputeTransformation(
199  const geometry::PointCloud &source,
200  const geometry::PointCloud &target,
201  const core::Tensor &correspondences) const override;
202 
203 public:
205  RobustKernel kernel_ = RobustKernel(RobustKernelMethod::L2Loss, 1.0, 1.0);
206 
207 private:
208  const TransformationEstimationType type_ =
209  TransformationEstimationType::PointToPlane;
210 };
211 
221 public:
223 
231  double lambda_geometric = 0.968,
232  const RobustKernel &kernel =
233  RobustKernel(RobustKernelMethod::L2Loss, 1.0, 1.0))
234  : lambda_geometric_(lambda_geometric), kernel_(kernel) {
235  if (lambda_geometric_ < 0 || lambda_geometric_ > 1.0) {
236  lambda_geometric_ = 0.968;
237  }
238  }
239 
241  const override {
242  return type_;
243  };
244 
245 public:
257  double ComputeRMSE(const geometry::PointCloud &source,
258  const geometry::PointCloud &target,
259  const core::Tensor &correspondences) const override;
260 
274  core::Tensor ComputeTransformation(
275  const geometry::PointCloud &source,
276  const geometry::PointCloud &target,
277  const core::Tensor &correspondences) const override;
278 
279 public:
280  double lambda_geometric_ = 0.968;
282  RobustKernel kernel_ = RobustKernel(RobustKernelMethod::L2Loss, 1.0, 1.0);
283 
284 private:
285  const TransformationEstimationType type_ =
286  TransformationEstimationType::ColoredICP;
287 };
288 
289 } // namespace registration
290 } // namespace pipelines
291 } // namespace t
292 } // namespace open3d
~TransformationEstimationForColoredICP() override
Definition: TransformationEstimation.h:222
TransformationEstimationType
Definition: TransformationEstimation.h:49
TransformationEstimation()
Default Constructor.
Definition: TransformationEstimation.h:64
~TransformationEstimationPointToPlane() override
Definition: TransformationEstimation.h:157
TransformationEstimationForColoredICP(double lambda_geometric=0.968, const RobustKernel &kernel=RobustKernel(RobustKernelMethod::L2Loss, 1.0, 1.0))
Constructor.
Definition: TransformationEstimation.h:230
A point cloud contains a list of 3D points.
Definition: PointCloud.h:95
Definition: PinholeCameraIntrinsic.cpp:35
virtual ~TransformationEstimation()
Definition: TransformationEstimation.h:65
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:240
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:167
TransformationEstimationPointToPlane(const RobustKernel &kernel)
Constructor that takes as input a RobustKernel.
Definition: TransformationEstimation.h:163
TransformationEstimationPointToPlane()
Default constructor.
Definition: TransformationEstimation.h:156
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:111
Definition: TransformationEstimation.h:61
~TransformationEstimationPointToPoint() override
Definition: TransformationEstimation.h:108
TransformationEstimationPointToPoint()
Definition: TransformationEstimation.h:107