Open3D (C++ API)  0.18.0+252c867
TransformationEstimation.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <Eigen/Core>
11 #include <memory>
12 #include <string>
13 #include <utility>
14 #include <vector>
15 
17 
18 namespace open3d {
19 
20 namespace geometry {
21 class PointCloud;
22 }
23 
24 namespace pipelines {
25 namespace registration {
26 
27 typedef std::vector<Eigen::Vector2i> CorrespondenceSet;
28 
30  Unspecified = 0,
31  PointToPoint = 1,
32  PointToPlane = 2,
33  ColoredICP = 3,
34  GeneralizedICP = 4,
35 };
36 
43 public:
47 
48 public:
50  const = 0;
57  virtual double ComputeRMSE(const geometry::PointCloud &source,
58  const geometry::PointCloud &target,
59  const CorrespondenceSet &corres) const = 0;
66  virtual Eigen::Matrix4d ComputeTransformation(
67  const geometry::PointCloud &source,
68  const geometry::PointCloud &target,
69  const CorrespondenceSet &corres) const = 0;
70 };
71 
76 public:
81  TransformationEstimationPointToPoint(bool with_scaling = false)
82  : with_scaling_(with_scaling) {}
84 
85 public:
87  const override {
88  return type_;
89  };
90  double ComputeRMSE(const geometry::PointCloud &source,
91  const geometry::PointCloud &target,
92  const CorrespondenceSet &corres) const override;
93  Eigen::Matrix4d ComputeTransformation(
94  const geometry::PointCloud &source,
95  const geometry::PointCloud &target,
96  const CorrespondenceSet &corres) const override;
97 
98 public:
105  bool with_scaling_ = false;
106 
107 private:
108  const TransformationEstimationType type_ =
110 };
111 
116 public:
120 
124  std::shared_ptr<RobustKernel> kernel)
125  : kernel_(std::move(kernel)) {}
126 
127 public:
129  const override {
130  return type_;
131  };
132  double ComputeRMSE(const geometry::PointCloud &source,
133  const geometry::PointCloud &target,
134  const CorrespondenceSet &corres) const override;
135  Eigen::Matrix4d ComputeTransformation(
136  const geometry::PointCloud &source,
137  const geometry::PointCloud &target,
138  const CorrespondenceSet &corres) const override;
139 
140 public:
142  std::shared_ptr<RobustKernel> kernel_ = std::make_shared<L2Loss>();
143 
144 private:
145  const TransformationEstimationType type_ =
147 };
148 
149 } // namespace registration
150 } // namespace pipelines
151 } // namespace open3d
A point cloud consists of point coordinates, and optionally point colors and point normals.
Definition: PointCloud.h:36
Definition: TransformationEstimation.h:42
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:46
TransformationEstimation()
Default Constructor.
Definition: TransformationEstimation.h:45
double ComputeRMSE(const geometry::PointCloud &source, const geometry::PointCloud &target, const CorrespondenceSet &corres) const override
Definition: TransformationEstimation.cpp:45
TransformationEstimationPointToPlane()
Default Constructor.
Definition: TransformationEstimation.h:118
Eigen::Matrix4d ComputeTransformation(const geometry::PointCloud &source, const geometry::PointCloud &target, const CorrespondenceSet &corres) const override
Definition: TransformationEstimation.cpp:59
~TransformationEstimationPointToPlane() override
Definition: TransformationEstimation.h:119
std::shared_ptr< RobustKernel > kernel_
shared_ptr to an Abstract RobustKernel that could mutate at runtime.
Definition: TransformationEstimation.h:142
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:128
TransformationEstimationPointToPlane(std::shared_ptr< RobustKernel > kernel)
Constructor that takes as input a RobustKernel.
Definition: TransformationEstimation.h:123
TransformationEstimationPointToPoint(bool with_scaling=false)
Parameterized Constructor.
Definition: TransformationEstimation.h:81
double ComputeRMSE(const geometry::PointCloud &source, const geometry::PointCloud &target, const CorrespondenceSet &corres) const override
Definition: TransformationEstimation.cpp:19
Eigen::Matrix4d ComputeTransformation(const geometry::PointCloud &source, const geometry::PointCloud &target, const CorrespondenceSet &corres) const override
Definition: TransformationEstimation.cpp:31
TransformationEstimationType GetTransformationEstimationType() const override
Definition: TransformationEstimation.h:86
bool with_scaling_
Set to True to estimate scaling, False to force scaling to be 1.
Definition: TransformationEstimation.h:105
~TransformationEstimationPointToPoint() override
Definition: TransformationEstimation.h:83
std::vector< Eigen::Vector2i > CorrespondenceSet
Definition: Feature.h:25
TransformationEstimationType
Definition: TransformationEstimation.h:29
Definition: PinholeCameraIntrinsic.cpp:16
Definition: Device.h:107