Open3D (C++ API)
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 <vector>
33 
34 namespace open3d {
35 
36 namespace geometry {
37 class PointCloud;
38 }
39 
40 namespace registration {
41 
42 typedef std::vector<Eigen::Vector2i> CorrespondenceSet;
43 
45  Unspecified = 0,
46  PointToPoint = 1,
47  PointToPlane = 2,
48  ColoredICP = 3,
49 };
50 
57 public:
61 
62 public:
63  virtual TransformationEstimationType GetTransformationEstimationType()
64  const = 0;
71  virtual double ComputeRMSE(const geometry::PointCloud &source,
72  const geometry::PointCloud &target,
73  const CorrespondenceSet &corres) const = 0;
80  virtual Eigen::Matrix4d ComputeTransformation(
81  const geometry::PointCloud &source,
82  const geometry::PointCloud &target,
83  const CorrespondenceSet &corres) const = 0;
84 };
85 
90 public:
95  TransformationEstimationPointToPoint(bool with_scaling = false)
96  : with_scaling_(with_scaling) {}
98 
99 public:
101  const override {
102  return type_;
103  };
104  double ComputeRMSE(const geometry::PointCloud &source,
105  const geometry::PointCloud &target,
106  const CorrespondenceSet &corres) const override;
107  Eigen::Matrix4d ComputeTransformation(
108  const geometry::PointCloud &source,
109  const geometry::PointCloud &target,
110  const CorrespondenceSet &corres) const override;
111 
112 public:
119  bool with_scaling_ = false;
120 
121 private:
122  const TransformationEstimationType type_ =
123  TransformationEstimationType::PointToPoint;
124 };
125 
130 public:
134 
135 public:
137  const override {
138  return type_;
139  };
140  double ComputeRMSE(const geometry::PointCloud &source,
141  const geometry::PointCloud &target,
142  const CorrespondenceSet &corres) const override;
143  Eigen::Matrix4d ComputeTransformation(
144  const geometry::PointCloud &source,
145  const geometry::PointCloud &target,
146  const CorrespondenceSet &corres) const override;
147 
148 private:
149  const TransformationEstimationType type_ =
150  TransformationEstimationType::PointToPlane;
151 };
152 
153 } // namespace registration
154 } // namespace open3d
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:136
TransformationEstimationPointToPoint(bool with_scaling=false)
Parameterized Constructor.
Definition: TransformationEstimation.h:95
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:100
TransformationEstimationPointToPlane()
Default Constructor.
Definition: TransformationEstimation.h:132
std::vector< Eigen::Vector2i > CorrespondenceSet
Definition: TransformationEstimation.h:42
A point cloud consists of point coordinates, and optionally point colors and point normals...
Definition: PointCloud.h:54
~TransformationEstimationPointToPlane() override
Definition: TransformationEstimation.h:133
Definition: TransformationEstimation.h:56
TransformationEstimationType
Definition: TransformationEstimation.h:44
Definition: Open3DViewer.h:29
~TransformationEstimationPointToPoint() override
Definition: TransformationEstimation.h:97
TransformationEstimation()
Default Constructor.
Definition: TransformationEstimation.h:59
Definition: TransformationEstimation.h:129
virtual ~TransformationEstimation()
Definition: TransformationEstimation.h:60
Definition: TransformationEstimation.h:89