Open3D (C++ API)  0.17.0
Registration.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 <tuple>
11 #include <vector>
12 
13 #include "open3d/core/Tensor.h"
16 
17 namespace open3d {
18 namespace t {
19 
20 namespace geometry {
21 class PointCloud;
22 }
23 
24 namespace pipelines {
25 namespace registration {
26 class Feature;
27 
32 public:
43  ICPConvergenceCriteria(double relative_fitness = 1e-6,
44  double relative_rmse = 1e-6,
45  int max_iteration = 30)
46  : relative_fitness_(relative_fitness),
47  relative_rmse_(relative_rmse),
48  max_iteration_(max_iteration) {}
50 
51 public:
60 };
61 
66 public:
72  4, core::Float64, core::Device("CPU:0")))
73  : transformation_(transformation), inlier_rmse_(0.0), fitness_(0.0) {}
74 
76 
77  bool IsBetterThan(const RegistrationResult &other) const {
78  return fitness_ > other.fitness_ || (fitness_ == other.fitness_ &&
79  inlier_rmse_ < other.inlier_rmse_);
80  }
81 
82 public:
90  double inlier_rmse_;
93  double fitness_;
94 };
95 
105  const geometry::PointCloud &source,
106  const geometry::PointCloud &target,
107  double max_correspondence_distance,
108  const core::Tensor &transformation =
110 
130 ICP(const geometry::PointCloud &source,
131  const geometry::PointCloud &target,
132  const double max_correspondence_distance,
133  const core::Tensor &init_source_to_target =
135  const TransformationEstimation &estimation =
138  const double voxel_size = -1.0,
139  const std::function<void(const std::unordered_map<std::string, core::Tensor>
140  &)> &callback_after_iteration = nullptr);
141 
168  const geometry::PointCloud &source,
169  const geometry::PointCloud &target,
170  const std::vector<double> &voxel_sizes,
171  const std::vector<ICPConvergenceCriteria> &criteria_list,
172  const std::vector<double> &max_correspondence_distances,
173  const core::Tensor &init_source_to_target =
175  const TransformationEstimation &estimation =
177  const std::function<
178  void(const std::unordered_map<std::string, core::Tensor> &)>
179  &callback_after_iteration = nullptr);
180 
192  const geometry::PointCloud &target,
193  const double max_correspondence_distance,
194  const core::Tensor &transformation);
195 
196 } // namespace registration
197 } // namespace pipelines
198 } // namespace t
199 } // namespace open3d
Definition: Device.h:18
Definition: Tensor.h:32
static Tensor Eye(int64_t n, Dtype dtype, const Device &device)
Create an identity matrix of size n x n.
Definition: Tensor.cpp:385
A point cloud contains a list of 3D points.
Definition: PointCloud.h:80
Class that defines the convergence criteria of ICP.
Definition: Registration.h:31
double relative_rmse_
Definition: Registration.h:57
double relative_fitness_
Definition: Registration.h:54
ICPConvergenceCriteria(double relative_fitness=1e-6, double relative_rmse=1e-6, int max_iteration=30)
Parameterized Constructor. ICP algorithm stops if the relative change of fitness and rmse hit relativ...
Definition: Registration.h:43
int max_iteration_
Maximum iteration before iteration stops.
Definition: Registration.h:59
core::Tensor correspondences_
Definition: Registration.h:88
~RegistrationResult()
Definition: Registration.h:75
double fitness_
Definition: Registration.h:93
core::Tensor transformation_
The estimated transformation matrix of dtype Float64 on CPU device.
Definition: Registration.h:84
bool IsBetterThan(const RegistrationResult &other) const
Definition: Registration.h:77
RegistrationResult(const core::Tensor &transformation=core::Tensor::Eye(4, core::Float64, core::Device("CPU:0")))
Parameterized Constructor.
Definition: Registration.h:71
double inlier_rmse_
RMSE of all inlier correspondences. Lower is better.
Definition: Registration.h:90
Definition: TransformationEstimation.h:42
const Dtype Float64
Definition: Dtype.cpp:43
RegistrationResult MultiScaleICP(const geometry::PointCloud &source, const geometry::PointCloud &target, const std::vector< double > &voxel_sizes, const std::vector< ICPConvergenceCriteria > &criterias, const std::vector< double > &max_correspondence_distances, const core::Tensor &init_source_to_target, const TransformationEstimation &estimation, const std::function< void(const std::unordered_map< std::string, core::Tensor > &)> &callback_after_iteration)
Functions for Multi-Scale ICP registration. It will run ICP on different voxel level,...
Definition: Registration.cpp:318
core::Tensor GetInformationMatrix(const geometry::PointCloud &source, const geometry::PointCloud &target, const double max_correspondence_distance, const core::Tensor &transformation)
Computes Information Matrix, from the transformation between source and target pointcloud....
Definition: Registration.cpp:397
RegistrationResult EvaluateRegistration(const geometry::PointCloud &source, const geometry::PointCloud &target, double max_correspondence_distance, const core::Tensor &transformation)
Function for evaluating registration between point clouds.
Definition: Registration.cpp:64
RegistrationResult ICP(const geometry::PointCloud &source, const geometry::PointCloud &target, const double max_correspondence_distance, const core::Tensor &init_source_to_target, const TransformationEstimation &estimation, const ICPConvergenceCriteria &criteria, const double voxel_size, const std::function< void(const std::unordered_map< std::string, core::Tensor > &)> &callback_after_iteration)
Functions for ICP registration.
Definition: Registration.cpp:94
Definition: PinholeCameraIntrinsic.cpp:16