Open3D (C++ API)  0.15.1
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-2021 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  GeneralizedICP = 4,
54 };
55 
62 public:
66 
67 public:
69  const = 0;
76  virtual double ComputeRMSE(const geometry::PointCloud &source,
77  const geometry::PointCloud &target,
78  const CorrespondenceSet &corres) const = 0;
85  virtual Eigen::Matrix4d ComputeTransformation(
86  const geometry::PointCloud &source,
87  const geometry::PointCloud &target,
88  const CorrespondenceSet &corres) const = 0;
89 };
90 
95 public:
100  TransformationEstimationPointToPoint(bool with_scaling = false)
101  : with_scaling_(with_scaling) {}
103 
104 public:
106  const override {
107  return type_;
108  };
109  double ComputeRMSE(const geometry::PointCloud &source,
110  const geometry::PointCloud &target,
111  const CorrespondenceSet &corres) const override;
112  Eigen::Matrix4d ComputeTransformation(
113  const geometry::PointCloud &source,
114  const geometry::PointCloud &target,
115  const CorrespondenceSet &corres) const override;
116 
117 public:
124  bool with_scaling_ = false;
125 
126 private:
127  const TransformationEstimationType type_ =
129 };
130 
135 public:
139 
143  std::shared_ptr<RobustKernel> kernel)
144  : kernel_(std::move(kernel)) {}
145 
146 public:
148  const override {
149  return type_;
150  };
151  double ComputeRMSE(const geometry::PointCloud &source,
152  const geometry::PointCloud &target,
153  const CorrespondenceSet &corres) const override;
154  Eigen::Matrix4d ComputeTransformation(
155  const geometry::PointCloud &source,
156  const geometry::PointCloud &target,
157  const CorrespondenceSet &corres) const override;
158 
159 public:
161  std::shared_ptr<RobustKernel> kernel_ = std::make_shared<L2Loss>();
162 
163 private:
164  const TransformationEstimationType type_ =
166 };
167 
168 } // namespace registration
169 } // namespace pipelines
170 } // namespace open3d
A point cloud consists of point coordinates, and optionally point colors and point normals.
Definition: PointCloud.h:55
Definition: TransformationEstimation.h:61
virtual double ComputeRMSE(const geometry::PointCloud &source, const geometry::PointCloud &target, const CorrespondenceSet &corres) const =0
virtual Eigen::Matrix4d ComputeTransformation(const geometry::PointCloud &source, const geometry::PointCloud &target, const CorrespondenceSet &corres) const =0
virtual TransformationEstimationType GetTransformationEstimationType() const =0
virtual ~TransformationEstimation()
Definition: TransformationEstimation.h:65
TransformationEstimation()
Default Constructor.
Definition: TransformationEstimation.h:64
double ComputeRMSE(const geometry::PointCloud &source, const geometry::PointCloud &target, const CorrespondenceSet &corres) const override
Definition: TransformationEstimation.cpp:64
TransformationEstimationPointToPlane()
Default Constructor.
Definition: TransformationEstimation.h:137
Eigen::Matrix4d ComputeTransformation(const geometry::PointCloud &source, const geometry::PointCloud &target, const CorrespondenceSet &corres) const override
Definition: TransformationEstimation.cpp:78
~TransformationEstimationPointToPlane() override
Definition: TransformationEstimation.h:138
std::shared_ptr< RobustKernel > kernel_
shared_ptr to an Abstract RobustKernel that could mutate at runtime.
Definition: TransformationEstimation.h:161
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:147
TransformationEstimationPointToPlane(std::shared_ptr< RobustKernel > kernel)
Constructor that takes as input a RobustKernel.
Definition: TransformationEstimation.h:142
TransformationEstimationPointToPoint(bool with_scaling=false)
Parameterized Constructor.
Definition: TransformationEstimation.h:100
double ComputeRMSE(const geometry::PointCloud &source, const geometry::PointCloud &target, const CorrespondenceSet &corres) const override
Definition: TransformationEstimation.cpp:38
Eigen::Matrix4d ComputeTransformation(const geometry::PointCloud &source, const geometry::PointCloud &target, const CorrespondenceSet &corres) const override
Definition: TransformationEstimation.cpp:50
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:105
bool with_scaling_
Set to True to estimate scaling, False to force scaling to be 1.
Definition: TransformationEstimation.h:124
~TransformationEstimationPointToPoint() override
Definition: TransformationEstimation.h:102
TransformationEstimationType
Definition: TransformationEstimation.h:48
std::vector< Eigen::Vector2i > CorrespondenceSet
Definition: TransformationEstimation.h:46
Definition: PinholeCameraIntrinsic.cpp:35
Definition: Device.h:138