Open3D (C++ API)  0.11.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 <Eigen/Core>
30 #include <memory>
31 #include <string>
32 #include <utility>
33 #include <vector>
34 
36 
37 namespace open3d {
38 
39 namespace geometry {
40 class PointCloud;
41 }
42 
43 namespace pipelines {
44 namespace registration {
45 
46 typedef std::vector<Eigen::Vector2i> CorrespondenceSet;
47 
49  Unspecified = 0,
50  PointToPoint = 1,
51  PointToPlane = 2,
52  ColoredICP = 3,
53 };
54 
61 public:
65 
66 public:
67  virtual TransformationEstimationType GetTransformationEstimationType()
68  const = 0;
75  virtual double ComputeRMSE(const geometry::PointCloud &source,
76  const geometry::PointCloud &target,
77  const CorrespondenceSet &corres) const = 0;
84  virtual Eigen::Matrix4d ComputeTransformation(
85  const geometry::PointCloud &source,
86  const geometry::PointCloud &target,
87  const CorrespondenceSet &corres) const = 0;
88 };
89 
94 public:
99  TransformationEstimationPointToPoint(bool with_scaling = false)
100  : with_scaling_(with_scaling) {}
102 
103 public:
105  const override {
106  return type_;
107  };
108  double ComputeRMSE(const geometry::PointCloud &source,
109  const geometry::PointCloud &target,
110  const CorrespondenceSet &corres) const override;
111  Eigen::Matrix4d ComputeTransformation(
112  const geometry::PointCloud &source,
113  const geometry::PointCloud &target,
114  const CorrespondenceSet &corres) const override;
115 
116 public:
123  bool with_scaling_ = false;
124 
125 private:
126  const TransformationEstimationType type_ =
127  TransformationEstimationType::PointToPoint;
128 };
129 
134 public:
138 
142  std::shared_ptr<RobustKernel> kernel)
143  : kernel_(std::move(kernel)) {}
144 
145 public:
147  const override {
148  return type_;
149  };
150  double ComputeRMSE(const geometry::PointCloud &source,
151  const geometry::PointCloud &target,
152  const CorrespondenceSet &corres) const override;
153  Eigen::Matrix4d ComputeTransformation(
154  const geometry::PointCloud &source,
155  const geometry::PointCloud &target,
156  const CorrespondenceSet &corres) const override;
157 
158 public:
160  std::shared_ptr<RobustKernel> kernel_ = std::make_shared<L2Loss>();
161 
162 private:
163  const TransformationEstimationType type_ =
164  TransformationEstimationType::PointToPlane;
165 };
166 
167 } // namespace registration
168 } // namespace pipelines
169 } // namespace open3d
~TransformationEstimationPointToPlane() override
Definition: TransformationEstimation.h:137
virtual ~TransformationEstimation()
Definition: TransformationEstimation.h:64
Definition: Optional.h:922
TransformationEstimation()
Default Constructor.
Definition: TransformationEstimation.h:63
A point cloud consists of point coordinates, and optionally point colors and point normals...
Definition: PointCloud.h:54
TransformationEstimationPointToPoint(bool with_scaling=false)
Parameterized Constructor.
Definition: TransformationEstimation.h:99
TransformationEstimationPointToPlane()
Default Constructor.
Definition: TransformationEstimation.h:136
std::vector< Eigen::Vector2i > CorrespondenceSet
Definition: TransformationEstimation.h:46
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:104
TransformationEstimationPointToPlane(std::shared_ptr< RobustKernel > kernel)
Constructor that takes as input a RobustKernel kernel Any of the implemented statistical robust kern...
Definition: TransformationEstimation.h:141
~TransformationEstimationPointToPoint() override
Definition: TransformationEstimation.h:101
Definition: PinholeCameraIntrinsic.cpp:35
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:146
Definition: TransformationEstimation.h:60
TransformationEstimationType
Definition: TransformationEstimation.h:48