Open3D (C++ API)  0.16.1
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
39namespace open3d {
40
41namespace t {
42namespace geometry {
43class PointCloud;
44}
45
46namespace pipelines {
47namespace registration {
48
50 Unspecified = 0,
51 PointToPoint = 1,
52 PointToPlane = 2,
53 ColoredICP = 3,
54};
55
62public:
66
67public:
69 const = 0;
70
80 virtual double ComputeRMSE(const geometry::PointCloud &source,
81 const geometry::PointCloud &target,
82 const core::Tensor &correspondences) const = 0;
95 const geometry::PointCloud &source,
96 const geometry::PointCloud &target,
97 const core::Tensor &correspondences) const = 0;
98};
99
105public:
106 // TODO: support with_scaling.
109
110public:
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
140 const geometry::PointCloud &source,
141 const geometry::PointCloud &target,
142 const core::Tensor &correspondences) const override;
143
144private:
145 const TransformationEstimationType type_ =
147};
148
154public:
158
164 : kernel_(kernel) {}
165
166public:
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
199 const geometry::PointCloud &source,
200 const geometry::PointCloud &target,
201 const core::Tensor &correspondences) const override;
202
203public:
206
207private:
208 const TransformationEstimationType type_ =
210};
211
221public:
223
231 double lambda_geometric = 0.968,
232 const RobustKernel &kernel =
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
245public:
257 double ComputeRMSE(const geometry::PointCloud &source,
258 const geometry::PointCloud &target,
259 const core::Tensor &correspondences) const override;
260
275 const geometry::PointCloud &source,
276 const geometry::PointCloud &target,
277 const core::Tensor &correspondences) const override;
278
279public:
280 double lambda_geometric_ = 0.968;
283
284private:
285 const TransformationEstimationType type_ =
287};
288
289} // namespace registration
290} // namespace pipelines
291} // namespace t
292} // namespace open3d
Definition: Tensor.h:51
A point cloud contains a list of 3D points.
Definition: PointCloud.h:99
~TransformationEstimationForColoredICP() override
Definition: TransformationEstimation.h:222
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:182
TransformationEstimationForColoredICP(double lambda_geometric=0.968, const RobustKernel &kernel=RobustKernel(RobustKernelMethod::L2Loss, 1.0, 1.0))
Constructor.
Definition: TransformationEstimation.h:230
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:270
double lambda_geometric_
Definition: TransformationEstimation.h:280
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:240
RobustKernel kernel_
RobustKernel for outlier rejection.
Definition: TransformationEstimation.h:282
Definition: TransformationEstimation.h:61
virtual ~TransformationEstimation()
Definition: TransformationEstimation.h:65
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:64
virtual double ComputeRMSE(const geometry::PointCloud &source, const geometry::PointCloud &target, const core::Tensor &correspondences) const =0
TransformationEstimationPointToPlane()
Default constructor.
Definition: TransformationEstimation.h:156
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:151
~TransformationEstimationPointToPlane() override
Definition: TransformationEstimation.h:157
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:167
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:116
RobustKernel kernel_
RobustKernel for outlier rejection.
Definition: TransformationEstimation.h:205
TransformationEstimationPointToPlane(const RobustKernel &kernel)
Constructor that takes as input a RobustKernel.
Definition: TransformationEstimation.h:163
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:89
TransformationEstimationPointToPoint()
Definition: TransformationEstimation.h:107
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:111
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:58
~TransformationEstimationPointToPoint() override
Definition: TransformationEstimation.h:108
TransformationEstimationType
Definition: TransformationEstimation.h:49
Definition: PinholeCameraIntrinsic.cpp:35