Open3D (C++ API)  0.18.0+252c867
RGBDOdometry.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 
11 
12 #pragma once
13 
14 #include "open3d/core/Tensor.h"
17 
18 namespace open3d {
19 namespace t {
20 namespace pipelines {
21 namespace odometry {
22 
23 enum class Method {
24  PointToPlane, // Implemented and commented in
25  // ComputeOdometryResultPointToPlane
26  Intensity, // Implemented and commented in ComputeOdometryResultIntensity
27  Hybrid, // Implemented and commented in ComputeOdometryResultHybrid
28 };
29 
31 public:
41  OdometryConvergenceCriteria(int max_iteration,
42  double relative_rmse = 1e-6,
43  double relative_fitness = 1e-6)
44  : max_iteration_(max_iteration),
45  relative_rmse_(relative_rmse),
46  relative_fitness_(relative_fitness) {}
47 
48 public:
57 };
58 
60 public:
68  4, core::Float64, core::Device("CPU:0")),
69  double inlier_rmse = 0.0,
70  double fitness = 0.0)
71  : transformation_(transformation),
72  inlier_rmse_(inlier_rmse),
73  fitness_(fitness) {}
74 
76 
77 public:
81  double inlier_rmse_;
84  double fitness_;
85 };
86 
88 public:
97  OdometryLossParams(float depth_outlier_trunc = 0.07,
98  float depth_huber_delta = 0.05,
99  float intensity_huber_delta = 0.1)
100  : depth_outlier_trunc_(depth_outlier_trunc),
101  depth_huber_delta_(depth_huber_delta),
102  intensity_huber_delta_(intensity_huber_delta) {
103  if (depth_outlier_trunc_ < 0) {
105  "Depth outlier truncation < 0, outliers will be counted!");
106  }
109  "Huber delta is greater than truncation, huber norm will "
110  "degenerate to L2 norm!");
111  }
112  }
113 
114 public:
119 };
120 
146  const t::geometry::RGBDImage& source,
147  const t::geometry::RGBDImage& target,
148  const core::Tensor& intrinsics,
149  const core::Tensor& init_source_to_target =
151  const float depth_scale = 1000.0f,
152  const float depth_max = 3.0f,
153  const std::vector<OdometryConvergenceCriteria>& criteria_list = {10, 5,
154  3},
155  const Method method = Method::Hybrid,
156  const OdometryLossParams& params = OdometryLossParams());
157 
183 OdometryResult ComputeOdometryResultPointToPlane(
184  const core::Tensor& source_vertex_map,
185  const core::Tensor& target_vertex_map,
186  const core::Tensor& target_normal_map,
187  const core::Tensor& intrinsics,
188  const core::Tensor& init_source_to_target,
189  const float depth_outlier_trunc,
190  const float depth_huber_delta);
191 
226 OdometryResult ComputeOdometryResultIntensity(
227  const core::Tensor& source_depth,
228  const core::Tensor& target_depth,
229  const core::Tensor& source_intensity,
230  const core::Tensor& target_intensity,
231  const core::Tensor& target_intensity_dx,
232  const core::Tensor& target_intensity_dy,
233  const core::Tensor& source_vertex_map,
234  const core::Tensor& intrinsics,
235  const core::Tensor& init_source_to_target,
236  const float depth_outlier_trunc,
237  const float intensity_huber_delta);
238 
283 OdometryResult ComputeOdometryResultHybrid(
284  const core::Tensor& source_depth,
285  const core::Tensor& target_depth,
286  const core::Tensor& source_intensity,
287  const core::Tensor& target_intensity,
288  const core::Tensor& target_depth_dx,
289  const core::Tensor& target_depth_dy,
290  const core::Tensor& target_intensity_dx,
291  const core::Tensor& target_intensity_dy,
292  const core::Tensor& source_vertex_map,
293  const core::Tensor& intrinsics,
294  const core::Tensor& init_source_to_target,
295  const float depth_outlier_trunc,
296  const float depth_huber_delta,
297  const float intensity_huber_delta);
298 
302  const geometry::Image& source_depth,
303  const geometry::Image& target_depth,
304  const core::Tensor& intrinsic,
305  const core::Tensor& source_to_target,
306  const float dist_thr,
307  const float depth_scale = 1000.0f,
308  const float depth_max = 3.0f);
309 } // namespace odometry
310 } // namespace pipelines
311 } // namespace t
312 } // namespace open3d
#define LogWarning(...)
Definition: Logging.h:60
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:386
The Image class stores image with customizable rows, cols, channels, dtype and device.
Definition: Image.h:29
RGBDImage A pair of color and depth images.
Definition: RGBDImage.h:21
int max_iteration_
Maximum iteration before iteration stops.
Definition: RGBDOdometry.h:50
OdometryConvergenceCriteria(int max_iteration, double relative_rmse=1e-6, double relative_fitness=1e-6)
Constructor for the convergence criteria, where we stop iterations once the criteria are met.
Definition: RGBDOdometry.h:41
double relative_fitness_
Definition: RGBDOdometry.h:56
double relative_rmse_
Definition: RGBDOdometry.h:53
float intensity_huber_delta_
Definition: RGBDOdometry.h:118
float depth_huber_delta_
Definition: RGBDOdometry.h:117
float depth_outlier_trunc_
Depth difference threshold used to filter projective associations.
Definition: RGBDOdometry.h:116
OdometryLossParams(float depth_outlier_trunc=0.07, float depth_huber_delta=0.05, float intensity_huber_delta=0.1)
Constructor for the odometry loss function.
Definition: RGBDOdometry.h:97
OdometryResult(const core::Tensor &transformation=core::Tensor::Eye(4, core::Float64, core::Device("CPU:0")), double inlier_rmse=0.0, double fitness=0.0)
Constructor for the odometry result.
Definition: RGBDOdometry.h:67
double inlier_rmse_
RMSE of all inlier. Lower is better.
Definition: RGBDOdometry.h:81
core::Tensor transformation_
The estimated transformation matrix of dtype Float64 on CPU device.
Definition: RGBDOdometry.h:79
~OdometryResult()
Definition: RGBDOdometry.h:75
double fitness_
Definition: RGBDOdometry.h:84
const Dtype Float64
Definition: Dtype.cpp:43
Method
Definition: RGBDOdometry.h:23
OdometryResult RGBDOdometryMultiScale(const RGBDImage &source, const RGBDImage &target, const Tensor &intrinsics, const Tensor &init_source_to_target, const float depth_scale, const float depth_max, const std::vector< OdometryConvergenceCriteria > &criteria, const Method method, const OdometryLossParams &params)
Create an RGBD image pyramid given the original source and target RGBD images, and perform hierarchic...
Definition: RGBDOdometry.cpp:56
OdometryResult ComputeOdometryResultHybrid(const Tensor &source_depth, const Tensor &target_depth, const Tensor &source_intensity, const Tensor &target_intensity, const Tensor &target_depth_dx, const Tensor &target_depth_dy, const Tensor &target_intensity_dx, const Tensor &target_intensity_dy, const Tensor &source_vertex_map, const Tensor &intrinsics, const Tensor &init_source_to_target, const float depth_outlier_trunc, const float depth_huber_delta, const float intensity_huber_delta)
Estimates the 4x4 rigid transformation T from source to target, with inlier rmse and fitness....
Definition: RGBDOdometry.cpp:453
OdometryResult ComputeOdometryResultPointToPlane(const Tensor &source_vertex_map, const Tensor &target_vertex_map, const Tensor &target_normal_map, const Tensor &intrinsics, const Tensor &init_source_to_target, const float depth_outlier_trunc, const float depth_huber_delta)
Estimates the 4x4 rigid transformation T from source to target, with inlier rmse and fitness....
Definition: RGBDOdometry.cpp:392
OdometryResult ComputeOdometryResultIntensity(const Tensor &source_depth, const Tensor &target_depth, const Tensor &source_intensity, const Tensor &target_intensity, const Tensor &target_intensity_dx, const Tensor &target_intensity_dy, const Tensor &source_vertex_map, const Tensor &intrinsics, const Tensor &init_source_to_target, const float depth_outlier_trunc, const float intensity_huber_delta)
Estimates the 4x4 rigid transformation T from source to target, with inlier rmse and fitness....
Definition: RGBDOdometry.cpp:420
core::Tensor ComputeOdometryInformationMatrix(const geometry::Image &source_depth, const geometry::Image &target_depth, const core::Tensor &intrinsic, const core::Tensor &source_to_target, const float dist_thr, const float depth_scale, const float depth_max)
Definition: RGBDOdometry.cpp:489
Definition: PinholeCameraIntrinsic.cpp:16