Open3D (C++ API)  0.17.0
Model.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 "open3d/core/Tensor.h"
16 
17 namespace open3d {
18 namespace t {
19 namespace pipelines {
20 namespace slam {
21 
25 class Model {
26 public:
27  Model() {}
28  Model(float voxel_size,
29  int block_resolution = 16,
30  int block_count = 1000,
31  const core::Tensor& T_init = core::Tensor::Eye(4,
33  core::Device("CPU:0")),
34  const core::Device& device = core::Device("CUDA:0"));
35 
37  void UpdateFramePose(int frame_id, const core::Tensor& T_frame_to_world) {
38  if (frame_id != frame_id_ + 1) {
39  utility::LogWarning("Skipped {} frames in update T!",
40  frame_id - (frame_id_ + 1));
41  }
42  frame_id_ = frame_id;
43  T_frame_to_world_ = T_frame_to_world.Contiguous();
44  }
45 
58  void SynthesizeModelFrame(Frame& raycast_frame,
59  float depth_scale = 1000.0,
60  float depth_min = 0.1,
61  float depth_max = 3.0,
62  float trunc_voxel_multiplier = 8.0,
63  bool enable_color = true,
64  float weight_threshold = -1.0);
65 
77  const Frame& input_frame,
78  const Frame& raycast_frame,
79  float depth_scale = 1000.0,
80  float depth_max = 3.0,
81  float depth_diff = 0.07,
83  const std::vector<odometry::OdometryConvergenceCriteria>& criteria =
84  {6, 3, 1});
85 
94  void Integrate(const Frame& input_frame,
95  float depth_scale = 1000.0,
96  float depth_max = 3.0,
97  float trunc_voxel_multiplier = 8.0f);
98 
105  t::geometry::PointCloud ExtractPointCloud(float weight_threshold = 3.0f,
106  int estimated_number = -1);
107 
114  t::geometry::TriangleMesh ExtractTriangleMesh(float weight_threshold = 3.0f,
115  int estimated_number = -1);
116 
119 
120 public:
123 
126 
130 
131  int frame_id_ = -1;
132 };
133 
134 } // namespace slam
135 } // namespace pipelines
136 } // namespace t
137 } // namespace open3d
#define LogWarning(...)
Definition: Logging.h:60
Definition: Device.h:18
Definition: HashMap.h:22
Definition: Tensor.h:32
Tensor Contiguous() const
Definition: Tensor.cpp:739
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
A triangle mesh contains vertices and triangles.
Definition: TriangleMesh.h:92
Definition: VoxelBlockGrid.h:26
Frame is a container class storing an intrinsic matrix and several 2D tensors, from depth map,...
Definition: Frame.h:21
Definition: Model.h:25
core::Tensor frustum_block_coords_
Active block coordinates from prior integration.
Definition: Model.h:125
void Integrate(const Frame &input_frame, float depth_scale=1000.0, float depth_max=3.0, float trunc_voxel_multiplier=8.0f)
Definition: Model.cpp:91
t::geometry::TriangleMesh ExtractTriangleMesh(float weight_threshold=3.0f, int estimated_number=-1)
Definition: Model.cpp:113
void SynthesizeModelFrame(Frame &raycast_frame, float depth_scale=1000.0, float depth_min=0.1, float depth_max=3.0, float trunc_voxel_multiplier=8.0, bool enable_color=true, float weight_threshold=-1.0)
Definition: Model.cpp:38
t::geometry::VoxelBlockGrid voxel_grid_
Maintained volumetric map.
Definition: Model.h:122
void UpdateFramePose(int frame_id, const core::Tensor &T_frame_to_world)
Definition: Model.h:37
core::Tensor GetCurrentFramePose() const
Definition: Model.h:36
int frame_id_
Definition: Model.h:131
core::HashMap GetHashMap()
Get block hashmap int the VoxelBlockGrid.
Definition: Model.cpp:118
Model()
Definition: Model.h:27
core::Tensor T_frame_to_world_
Definition: Model.h:129
odometry::OdometryResult TrackFrameToModel(const Frame &input_frame, const Frame &raycast_frame, float depth_scale=1000.0, float depth_max=3.0, float depth_diff=0.07, odometry::Method method=odometry::Method::PointToPlane, const std::vector< odometry::OdometryConvergenceCriteria > &criteria={6, 3, 1})
Definition: Model.cpp:68
t::geometry::PointCloud ExtractPointCloud(float weight_threshold=3.0f, int estimated_number=-1)
Definition: Model.cpp:108
const Dtype Float64
Definition: Dtype.cpp:43
Method
Definition: RGBDOdometry.h:23
Definition: PinholeCameraIntrinsic.cpp:16