Open3D (C++ API)  0.19.0
Loading...
Searching...
No Matches
TransformationEstimation.h
Go to the documentation of this file.
1// ----------------------------------------------------------------------------
2// - Open3D: www.open3d.org -
3// ----------------------------------------------------------------------------
4// Copyright (c) 2018-2024 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
18namespace open3d {
19
20namespace geometry {
21class PointCloud;
22}
23
24namespace pipelines {
25namespace registration {
26
27typedef std::vector<Eigen::Vector2i> CorrespondenceSet;
28
30 Unspecified = 0,
31 PointToPoint = 1,
32 PointToPlane = 2,
33 ColoredICP = 3,
35};
36
43public:
47
48public:
50 const = 0;
57 virtual double ComputeRMSE(const geometry::PointCloud &source,
59 const CorrespondenceSet &corres) const = 0;
66 virtual Eigen::Matrix4d ComputeTransformation(
67 const geometry::PointCloud &source,
69 const CorrespondenceSet &corres) const = 0;
70
77 virtual std::tuple<std::shared_ptr<const geometry::PointCloud>,
78 std::shared_ptr<const geometry::PointCloud>>
80 const geometry::PointCloud &source,
82 double max_correspondence_distance) const = 0;
83};
84
89public:
94 TransformationEstimationPointToPoint(bool with_scaling = false)
95 : with_scaling_(with_scaling) {}
97
98public:
100 const override {
101 return type_;
102 };
103 double ComputeRMSE(const geometry::PointCloud &source,
105 const CorrespondenceSet &corres) const override;
106 Eigen::Matrix4d ComputeTransformation(
107 const geometry::PointCloud &source,
109 const CorrespondenceSet &corres) const override;
110
111 std::tuple<std::shared_ptr<const geometry::PointCloud>,
112 std::shared_ptr<const geometry::PointCloud>>
114 const geometry::PointCloud &source,
116 double max_correspondence_distance) const override;
117
118public:
125 bool with_scaling_ = false;
126
127private:
128 const TransformationEstimationType type_ =
130};
131
136public:
140
144 std::shared_ptr<RobustKernel> kernel)
145 : kernel_(std::move(kernel)) {}
146
147public:
149 const override {
150 return type_;
151 };
152 double ComputeRMSE(const geometry::PointCloud &source,
154 const CorrespondenceSet &corres) const override;
155 Eigen::Matrix4d ComputeTransformation(
156 const geometry::PointCloud &source,
158 const CorrespondenceSet &corres) const override;
159
160 std::tuple<std::shared_ptr<const geometry::PointCloud>,
161 std::shared_ptr<const geometry::PointCloud>>
163 const geometry::PointCloud &source,
165 double max_correspondence_distance) const override;
166
167public:
169 std::shared_ptr<RobustKernel> kernel_ = std::make_shared<L2Loss>();
170
171private:
172 const TransformationEstimationType type_ =
174};
175
176} // namespace registration
177} // namespace pipelines
178} // namespace open3d
Real target
Definition SurfaceReconstructionPoisson.cpp:267
A point cloud consists of point coordinates, and optionally point colors and point normals.
Definition PointCloud.h:36
Definition TransformationEstimation.h:42
virtual std::tuple< std::shared_ptr< const geometry::PointCloud >, std::shared_ptr< const geometry::PointCloud > > InitializePointCloudsForTransformation(const geometry::PointCloud &source, const geometry::PointCloud &target, double max_correspondence_distance) const =0
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:65
TransformationEstimationPointToPlane()
Default Constructor.
Definition TransformationEstimation.h:138
Eigen::Matrix4d ComputeTransformation(const geometry::PointCloud &source, const geometry::PointCloud &target, const CorrespondenceSet &corres) const override
Definition TransformationEstimation.cpp:79
~TransformationEstimationPointToPlane() override
Definition TransformationEstimation.h:139
std::shared_ptr< RobustKernel > kernel_
shared_ptr to an Abstract RobustKernel that could mutate at runtime.
Definition TransformationEstimation.h:169
TransformationEstimationType GetTransformationEstimationType() const override
Definition TransformationEstimation.h:148
TransformationEstimationPointToPlane(std::shared_ptr< RobustKernel > kernel)
Constructor that takes as input a RobustKernel.
Definition TransformationEstimation.h:143
std::tuple< std::shared_ptr< const geometry::PointCloud >, std::shared_ptr< const geometry::PointCloud > > InitializePointCloudsForTransformation(const geometry::PointCloud &source, const geometry::PointCloud &target, double max_correspondence_distance) const override
Definition TransformationEstimation.cpp:114
TransformationEstimationPointToPoint(bool with_scaling=false)
Parameterized Constructor.
Definition TransformationEstimation.h:94
double ComputeRMSE(const geometry::PointCloud &source, const geometry::PointCloud &target, const CorrespondenceSet &corres) const override
Definition TransformationEstimation.cpp:20
Eigen::Matrix4d ComputeTransformation(const geometry::PointCloud &source, const geometry::PointCloud &target, const CorrespondenceSet &corres) const override
Definition TransformationEstimation.cpp:32
TransformationEstimationType GetTransformationEstimationType() const override
Definition TransformationEstimation.h:99
bool with_scaling_
Set to True to estimate scaling, False to force scaling to be 1.
Definition TransformationEstimation.h:125
std::tuple< std::shared_ptr< const geometry::PointCloud >, std::shared_ptr< const geometry::PointCloud > > InitializePointCloudsForTransformation(const geometry::PointCloud &source, const geometry::PointCloud &target, double max_correspondence_distance) const override
Definition TransformationEstimation.cpp:48
~TransformationEstimationPointToPoint() override
Definition TransformationEstimation.h:96
std::vector< Eigen::Vector2i > CorrespondenceSet
Definition Feature.h:25
TransformationEstimationType
Definition TransformationEstimation.h:29
Definition PinholeCameraIntrinsic.cpp:16
Definition Device.h:111