Open3D (C++ API)  0.17.0
TransformationEstimation.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <memory>
11 #include <string>
12 #include <utility>
13 #include <vector>
14 
15 #include "open3d/core/Tensor.h"
19 
20 namespace open3d {
21 
22 namespace t {
23 namespace geometry {
24 class PointCloud;
25 }
26 
27 namespace pipelines {
28 namespace registration {
29 
31  Unspecified = 0,
32  PointToPoint = 1,
33  PointToPlane = 2,
34  ColoredICP = 3,
35 };
36 
43 public:
47 
48 public:
50  const = 0;
51 
61  virtual double ComputeRMSE(const geometry::PointCloud &source,
62  const geometry::PointCloud &target,
63  const core::Tensor &correspondences) const = 0;
76  const geometry::PointCloud &source,
77  const geometry::PointCloud &target,
78  const core::Tensor &correspondences) const = 0;
79 };
80 
86 public:
87  // TODO: support with_scaling.
90 
91 public:
93  const override {
94  return type_;
95  };
105  double ComputeRMSE(const geometry::PointCloud &source,
106  const geometry::PointCloud &target,
107  const core::Tensor &correspondences) const override;
108 
121  const geometry::PointCloud &source,
122  const geometry::PointCloud &target,
123  const core::Tensor &correspondences) const override;
124 
125 private:
126  const TransformationEstimationType type_ =
128 };
129 
135 public:
139 
145  : kernel_(kernel) {}
146 
147 public:
149  const override {
150  return type_;
151  };
152 
163  double ComputeRMSE(const geometry::PointCloud &source,
164  const geometry::PointCloud &target,
165  const core::Tensor &correspondences) const override;
166 
180  const geometry::PointCloud &source,
181  const geometry::PointCloud &target,
182  const core::Tensor &correspondences) const override;
183 
184 public:
187 
188 private:
189  const TransformationEstimationType type_ =
191 };
192 
202 public:
204 
212  double lambda_geometric = 0.968,
213  const RobustKernel &kernel =
215  : lambda_geometric_(lambda_geometric), kernel_(kernel) {
216  if (lambda_geometric_ < 0 || lambda_geometric_ > 1.0) {
217  lambda_geometric_ = 0.968;
218  }
219  }
220 
222  const override {
223  return type_;
224  };
225 
226 public:
238  double ComputeRMSE(const geometry::PointCloud &source,
239  const geometry::PointCloud &target,
240  const core::Tensor &correspondences) const override;
241 
256  const geometry::PointCloud &source,
257  const geometry::PointCloud &target,
258  const core::Tensor &correspondences) const override;
259 
260 public:
261  double lambda_geometric_ = 0.968;
264 
265 private:
266  const TransformationEstimationType type_ =
268 };
269 
270 } // namespace registration
271 } // namespace pipelines
272 } // namespace t
273 } // namespace open3d
Definition: Tensor.h:32
A point cloud contains a list of 3D points.
Definition: PointCloud.h:80
~TransformationEstimationForColoredICP() override
Definition: TransformationEstimation.h:203
double ComputeRMSE(const geometry::PointCloud &source, const geometry::PointCloud &target, const core::Tensor &correspondences) const override
Computes RMSE (double) for ColoredICP method, between two pointclouds, given correspondences.
Definition: TransformationEstimation.cpp:163
TransformationEstimationForColoredICP(double lambda_geometric=0.968, const RobustKernel &kernel=RobustKernel(RobustKernelMethod::L2Loss, 1.0, 1.0))
Constructor.
Definition: TransformationEstimation.h:211
core::Tensor ComputeTransformation(const geometry::PointCloud &source, const geometry::PointCloud &target, const core::Tensor &correspondences) const override
Estimates the transformation matrix for ColoredICP method, a tensor of shape {4, 4},...
Definition: TransformationEstimation.cpp:251
double lambda_geometric_
Definition: TransformationEstimation.h:261
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:221
RobustKernel kernel_
RobustKernel for outlier rejection.
Definition: TransformationEstimation.h:263
Definition: TransformationEstimation.h:42
virtual ~TransformationEstimation()
Definition: TransformationEstimation.h:46
virtual core::Tensor ComputeTransformation(const geometry::PointCloud &source, const geometry::PointCloud &target, const core::Tensor &correspondences) const =0
virtual TransformationEstimationType GetTransformationEstimationType() const =0
TransformationEstimation()
Default Constructor.
Definition: TransformationEstimation.h:45
virtual double ComputeRMSE(const geometry::PointCloud &source, const geometry::PointCloud &target, const core::Tensor &correspondences) const =0
TransformationEstimationPointToPlane()
Default constructor.
Definition: TransformationEstimation.h:137
core::Tensor ComputeTransformation(const geometry::PointCloud &source, const geometry::PointCloud &target, const core::Tensor &correspondences) const override
Estimates the transformation matrix for PointToPlane method, a tensor of shape {4,...
Definition: TransformationEstimation.cpp:132
~TransformationEstimationPointToPlane() override
Definition: TransformationEstimation.h:138
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:148
double ComputeRMSE(const geometry::PointCloud &source, const geometry::PointCloud &target, const core::Tensor &correspondences) const override
Computes RMSE (double) for PointToPlane method, between two pointclouds, given correspondences.
Definition: TransformationEstimation.cpp:97
RobustKernel kernel_
RobustKernel for outlier rejection.
Definition: TransformationEstimation.h:186
TransformationEstimationPointToPlane(const RobustKernel &kernel)
Constructor that takes as input a RobustKernel.
Definition: TransformationEstimation.h:144
core::Tensor ComputeTransformation(const geometry::PointCloud &source, const geometry::PointCloud &target, const core::Tensor &correspondences) const override
Estimates the transformation matrix for PointToPoint method, a tensor of shape {4,...
Definition: TransformationEstimation.cpp:70
TransformationEstimationPointToPoint()
Definition: TransformationEstimation.h:88
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:92
double ComputeRMSE(const geometry::PointCloud &source, const geometry::PointCloud &target, const core::Tensor &correspondences) const override
Computes RMSE (double) for PointToPoint method, between two pointclouds, given correspondences.
Definition: TransformationEstimation.cpp:39
~TransformationEstimationPointToPoint() override
Definition: TransformationEstimation.h:89
TransformationEstimationType
Definition: TransformationEstimation.h:30
Definition: PinholeCameraIntrinsic.cpp:16