Open3D (C++ API)  0.13.0
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 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 
55 typedef std::pair<core::Tensor, core::Tensor> CorrespondenceSet;
56 
58  Unspecified = 0,
59  PointToPoint = 1,
60  PointToPlane = 2,
61  ColoredICP = 3,
62 };
63 
70 public:
74 
75 public:
76  virtual TransformationEstimationType GetTransformationEstimationType()
77  const = 0;
78 
86  virtual double ComputeRMSE(
87  const geometry::PointCloud &source,
88  const geometry::PointCloud &target,
89  const CorrespondenceSet &correspondences) const = 0;
99  virtual core::Tensor ComputeTransformation(
100  const geometry::PointCloud &source,
101  const geometry::PointCloud &target,
102  const CorrespondenceSet &correspondences) const = 0;
103 };
104 
110 public:
111  // TODO: support with_scaling.
114 
115 public:
117  const override {
118  return type_;
119  };
128  double ComputeRMSE(const geometry::PointCloud &source,
129  const geometry::PointCloud &target,
130  const CorrespondenceSet &correspondences) const override;
131 
141  core::Tensor ComputeTransformation(
142  const geometry::PointCloud &source,
143  const geometry::PointCloud &target,
144  const CorrespondenceSet &correspondences) const override;
145 
146 private:
147  const TransformationEstimationType type_ =
148  TransformationEstimationType::PointToPoint;
149 };
150 
156 public:
160 
161 public:
163  const override {
164  return type_;
165  };
174  double ComputeRMSE(const geometry::PointCloud &source,
175  const geometry::PointCloud &target,
176  const CorrespondenceSet &correspondences) const override;
177 
188  core::Tensor ComputeTransformation(
189  const geometry::PointCloud &source,
190  const geometry::PointCloud &target,
191  const CorrespondenceSet &correspondences) const override;
192 
193 private:
194  const TransformationEstimationType type_ =
195  TransformationEstimationType::PointToPlane;
196 };
197 
198 } // namespace registration
199 } // namespace pipelines
200 } // namespace t
201 } // namespace open3d
TransformationEstimationType
Definition: TransformationEstimation.h:57
TransformationEstimation()
Default Constructor.
Definition: TransformationEstimation.h:72
~TransformationEstimationPointToPlane() override
Definition: TransformationEstimation.h:159
std::pair< core::Tensor, core::Tensor > CorrespondenceSet
CorrespondenceSet: pair of 2x Int64 tensors of shape {C,}, where C is the number of good corresponden...
Definition: TransformationEstimation.h:55
A pointcloud contains a set of 3D points.
Definition: PointCloud.h:95
Definition: PinholeCameraIntrinsic.cpp:35
Definition: Tensor.h:50
virtual ~TransformationEstimation()
Definition: TransformationEstimation.h:73
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:162
TransformationEstimationPointToPlane()
Default constructor.
Definition: TransformationEstimation.h:158
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:116
Definition: TransformationEstimation.h:69
~TransformationEstimationPointToPoint() override
Definition: TransformationEstimation.h:113
TransformationEstimationPointToPoint()
Definition: TransformationEstimation.h:112