Open3D (C++ API)  0.12.0
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 
85  virtual double ComputeRMSE(const geometry::PointCloud &source,
86  const geometry::PointCloud &target,
87  CorrespondenceSet &corres) const = 0;
94  virtual core::Tensor ComputeTransformation(
95  const geometry::PointCloud &source,
96  const geometry::PointCloud &target,
97  CorrespondenceSet &corres) const = 0;
98 };
99 
104 public:
105  // TODO: support with_scaling.
108 
109 public:
111  const override {
112  return type_;
113  };
114  double ComputeRMSE(const geometry::PointCloud &source,
115  const geometry::PointCloud &target,
116  CorrespondenceSet &corres) const override;
117  core::Tensor ComputeTransformation(
118  const geometry::PointCloud &source,
119  const geometry::PointCloud &target,
120  CorrespondenceSet &corres) const override;
121 
122 private:
123  const TransformationEstimationType type_ =
124  TransformationEstimationType::PointToPoint;
125 };
126 
131 public:
135 
136 public:
138  const override {
139  return type_;
140  };
141  double ComputeRMSE(const geometry::PointCloud &source,
142  const geometry::PointCloud &target,
143  CorrespondenceSet &corres) const override;
144  core::Tensor ComputeTransformation(
145  const geometry::PointCloud &source,
146  const geometry::PointCloud &target,
147  CorrespondenceSet &corres) const override;
148 
149 private:
150  const TransformationEstimationType type_ =
151  TransformationEstimationType::PointToPlane;
152 };
153 
154 } // namespace registration
155 } // namespace pipelines
156 } // namespace t
157 } // namespace open3d
TransformationEstimationType
Definition: TransformationEstimation.h:57
TransformationEstimation()
Default Constructor.
Definition: TransformationEstimation.h:72
~TransformationEstimationPointToPlane() override
Definition: TransformationEstimation.h:134
std::pair< core::Tensor, core::Tensor > CorrespondenceSet
Definition: TransformationEstimation.h:55
A pointcloud contains a set of 3D points.
Definition: PointCloud.h:94
Definition: PinholeCameraIntrinsic.cpp:35
Definition: Tensor.h:48
virtual ~TransformationEstimation()
Definition: TransformationEstimation.h:73
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:137
TransformationEstimationPointToPlane()
Default constructor.
Definition: TransformationEstimation.h:133
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:110
Definition: TransformationEstimation.h:69
~TransformationEstimationPointToPoint() override
Definition: TransformationEstimation.h:107
TransformationEstimationPointToPoint()
Definition: TransformationEstimation.h:106