Loading [MathJax]/extensions/TeX/AMSsymbols.js
Open3D (C++ API)  0.14.1
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
RGBDOdometry.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 
30 
31 #pragma once
32 
33 #include "open3d/core/Tensor.h"
36 
37 namespace open3d {
38 namespace t {
39 namespace pipelines {
40 namespace odometry {
41 
42 enum class Method {
43  PointToPlane, // Implemented and commented in
44  // ComputeOdometryResultPointToPlane
45  Intensity, // Implemented and commented in ComputeOdometryResultIntensity
46  Hybrid, // Implemented and commented in ComputeOdometryResultHybrid
47 };
48 
50 public:
60  OdometryConvergenceCriteria(int max_iteration,
61  double relative_rmse = 1e-6,
62  double relative_fitness = 1e-6)
63  : max_iteration_(max_iteration),
64  relative_rmse_(relative_rmse),
65  relative_fitness_(relative_fitness) {}
66 
67 public:
76 };
77 
79 public:
87  4, core::Float64, core::Device("CPU:0")),
88  double inlier_rmse = 0.0,
89  double fitness = 0.0)
90  : transformation_(transformation),
91  inlier_rmse_(inlier_rmse),
92  fitness_(fitness) {}
93 
95 
96 public:
100  double inlier_rmse_;
103  double fitness_;
104 };
105 
107 public:
116  OdometryLossParams(float depth_outlier_trunc = 0.07,
117  float depth_huber_delta = 0.05,
118  float intensity_huber_delta = 0.1)
119  : depth_outlier_trunc_(depth_outlier_trunc),
120  depth_huber_delta_(depth_huber_delta),
121  intensity_huber_delta_(intensity_huber_delta) {
122  if (depth_outlier_trunc_ < 0) {
124  "Depth outlier truncation < 0, outliers will be counted!");
125  }
126  if (depth_huber_delta_ >= depth_outlier_trunc_) {
128  "Huber delta is greater than truncation, huber norm will "
129  "degenerate to L2 norm!");
130  }
131  }
132 
133 public:
138 };
139 
165  const t::geometry::RGBDImage& source,
166  const t::geometry::RGBDImage& target,
167  const core::Tensor& intrinsics,
168  const core::Tensor& init_source_to_target =
170  const float depth_scale = 1000.0f,
171  const float depth_max = 3.0f,
172  const std::vector<OdometryConvergenceCriteria>& criteria_list = {10, 5,
173  3},
174  const Method method = Method::Hybrid,
175  const OdometryLossParams& params = OdometryLossParams());
176 
203  const core::Tensor& source_vertex_map,
204  const core::Tensor& target_vertex_map,
205  const core::Tensor& target_normal_map,
206  const core::Tensor& intrinsics,
207  const core::Tensor& init_source_to_target,
208  const float depth_outlier_trunc,
209  const float depth_huber_delta);
210 
246  const core::Tensor& source_depth,
247  const core::Tensor& target_depth,
248  const core::Tensor& source_intensity,
249  const core::Tensor& target_intensity,
250  const core::Tensor& target_intensity_dx,
251  const core::Tensor& target_intensity_dy,
252  const core::Tensor& source_vertex_map,
253  const core::Tensor& intrinsics,
254  const core::Tensor& init_source_to_target,
255  const float depth_outlier_trunc,
256  const float intensity_huber_delta);
257 
303  const core::Tensor& source_depth,
304  const core::Tensor& target_depth,
305  const core::Tensor& source_intensity,
306  const core::Tensor& target_intensity,
307  const core::Tensor& target_depth_dx,
308  const core::Tensor& target_depth_dy,
309  const core::Tensor& target_intensity_dx,
310  const core::Tensor& target_intensity_dy,
311  const core::Tensor& source_vertex_map,
312  const core::Tensor& intrinsics,
313  const core::Tensor& init_source_to_target,
314  const float depth_outlier_trunc,
315  const float depth_huber_delta,
316  const float intensity_huber_delta);
317 
318 } // namespace odometry
319 } // namespace pipelines
320 } // namespace t
321 } // namespace open3d
double fitness_
Definition: RGBDOdometry.h:103
int max_iteration_
Maximum iteration before iteration stops.
Definition: RGBDOdometry.h:69
core::Tensor transformation_
The estimated transformation matrix of dtype Float64 on CPU device.
Definition: RGBDOdometry.h:98
~OdometryResult()
Definition: RGBDOdometry.h:94
#define LogWarning(...)
Definition: Logging.h:84
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:439
double inlier_rmse_
RMSE of all inlier. Lower is better.
Definition: RGBDOdometry.h:100
Definition: Device.h:39
float depth_huber_delta_
Definition: RGBDOdometry.h:136
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:411
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:86
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:60
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:472
double relative_rmse_
Definition: RGBDOdometry.h:72
Definition: PinholeCameraIntrinsic.cpp:35
RGBDImage A pair of color and depth images.
Definition: RGBDImage.h:40
const Dtype Float64
Definition: Dtype.cpp:62
static Tensor Eye(int64_t n, Dtype dtype, const Device &device)
Create an identity matrix of size n x n.
Definition: Tensor.cpp:392
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:75
Method
Definition: RGBDOdometry.h:42
double relative_fitness_
Definition: RGBDOdometry.h:75
float intensity_huber_delta_
Definition: RGBDOdometry.h:137
float depth_outlier_trunc_
Depth difference threshold used to filter projective associations.
Definition: RGBDOdometry.h:135
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:116