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 <vector>
30 #include <memory>
31 #include <string>
32 #include <Eigen/Core>
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 
55 public:
58 
59 public:
60  virtual TransformationEstimationType GetTransformationEstimationType()
61  const = 0;
62  virtual double ComputeRMSE(const geometry::PointCloud &source,
63  const geometry::PointCloud &target,
64  const CorrespondenceSet &corres) const = 0;
65  virtual Eigen::Matrix4d ComputeTransformation(
66  const geometry::PointCloud &source,
67  const geometry::PointCloud &target,
68  const CorrespondenceSet &corres) const = 0;
69 };
70 
73 public:
74  TransformationEstimationPointToPoint(bool with_scaling = false)
75  : with_scaling_(with_scaling) {}
77 
78 public:
80  const override {
81  return type_;
82  };
83  double ComputeRMSE(const geometry::PointCloud &source,
84  const geometry::PointCloud &target,
85  const CorrespondenceSet &corres) const override;
86  Eigen::Matrix4d ComputeTransformation(
87  const geometry::PointCloud &source,
88  const geometry::PointCloud &target,
89  const CorrespondenceSet &corres) const override;
90 
91 public:
92  bool with_scaling_ = false;
93 
94 private:
95  const TransformationEstimationType type_ =
96  TransformationEstimationType::PointToPoint;
97 };
98 
101 public:
104 
105 public:
107  const override {
108  return type_;
109  };
110  double ComputeRMSE(const geometry::PointCloud &source,
111  const geometry::PointCloud &target,
112  const CorrespondenceSet &corres) const override;
113  Eigen::Matrix4d ComputeTransformation(
114  const geometry::PointCloud &source,
115  const geometry::PointCloud &target,
116  const CorrespondenceSet &corres) const override;
117 
118 private:
119  const TransformationEstimationType type_ =
120  TransformationEstimationType::PointToPlane;
121 };
122 
123 } // namespace registration
124 } // namespace open3d
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:106
TransformationEstimationPointToPoint(bool with_scaling=false)
Definition: TransformationEstimation.h:74
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:79
TransformationEstimationPointToPlane()
Definition: TransformationEstimation.h:102
std::vector< Eigen::Vector2i > CorrespondenceSet
Definition: TransformationEstimation.h:42
Definition: PointCloud.h:47
~TransformationEstimationPointToPlane() override
Definition: TransformationEstimation.h:103
Definition: TransformationEstimation.h:54
TransformationEstimationType
Definition: TransformationEstimation.h:44
Definition: PinholeCameraIntrinsic.cpp:33
~TransformationEstimationPointToPoint() override
Definition: TransformationEstimation.h:76
TransformationEstimation()
Definition: TransformationEstimation.h:56
Estimate a transformation for point to plane distance.
Definition: TransformationEstimation.h:100
virtual ~TransformationEstimation()
Definition: TransformationEstimation.h:57
Estimate a transformation for point to point distance.
Definition: TransformationEstimation.h:72