Loading [MathJax]/extensions/TeX/AMSsymbols.js
Open3D (C++ API)  0.14.1
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Model.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 
27 #pragma once
28 
29 #include "open3d/core/Tensor.h"
35 
36 namespace open3d {
37 namespace t {
38 namespace pipelines {
39 namespace slam {
40 
44 class Model {
45 public:
46  Model() {}
47  Model(float voxel_size,
48  int block_resolution,
49  int block_count,
50  const core::Tensor& T_init = core::Tensor::Eye(4,
52  core::Device("CPU:0")),
53  const core::Device& device = core::Device("CUDA:0"));
54 
56  void UpdateFramePose(int frame_id, const core::Tensor& T_frame_to_world) {
57  if (frame_id != frame_id_ + 1) {
58  utility::LogWarning("Skipped {} frames in update T!",
59  frame_id - (frame_id_ + 1));
60  }
61  frame_id_ = frame_id;
62  T_frame_to_world_ = T_frame_to_world.Contiguous();
63  }
64 
71  void SynthesizeModelFrame(Frame& raycast_frame,
72  float depth_scale,
73  float depth_min,
74  float depth_max,
75  bool enable_color = true);
76 
85  const Frame& raycast_frame,
86  float depth_scale,
87  float depth_max,
88  float depth_diff);
89 
95  void Integrate(const Frame& input_frame,
96  float depth_scale,
97  float depth_max);
98 
105  t::geometry::PointCloud ExtractPointCloud(int estimated_number = -1,
106  float weight_threshold = 3.0f);
107 
115  int estimated_number = -1, float weight_threshold = 3.0f);
116 
119 
120 public:
124 
128 
129  int frame_id_ = -1;
130 };
131 } // namespace slam
132 } // namespace pipelines
133 } // namespace t
134 } // namespace open3d
core::Tensor frustum_block_coords_
Definition: Model.h:123
A triangle mesh contains vertices and triangles.
Definition: TriangleMesh.h:106
t::geometry::PointCloud ExtractPointCloud(int estimated_number=-1, float weight_threshold=3.0f)
Definition: Model.cpp:114
Model()
Definition: Model.h:46
Definition: Model.h:44
core::HashMap GetHashMap()
Get block hashmap int the TSDFVoxelGrid.
Definition: Model.cpp:124
int frame_id_
Definition: Model.h:129
void SynthesizeModelFrame(Frame &raycast_frame, float depth_scale, float depth_min, float depth_max, bool enable_color=true)
Definition: Model.cpp:57
#define LogWarning(...)
Definition: Logging.h:84
core::Tensor T_frame_to_world_
Definition: Model.h:127
void Integrate(const Frame &input_frame, float depth_scale, float depth_max)
Definition: Model.cpp:100
Tensor Contiguous() const
Definition: Tensor.cpp:746
Definition: Device.h:39
A point cloud contains a list of 3D points.
Definition: PointCloud.h:95
t::geometry::VoxelBlockGrid voxel_grid_
Maintained volumetric map.
Definition: Model.h:122
odometry::OdometryResult TrackFrameToModel(const Frame &input_frame, const Frame &raycast_frame, float depth_scale, float depth_max, float depth_diff)
Definition: Model.cpp:80
Definition: HashMap.h:40
Definition: PinholeCameraIntrinsic.cpp:35
core::Tensor GetCurrentFramePose()
Definition: Model.h:55
Definition: VoxelBlockGrid.h:45
t::geometry::TriangleMesh ExtractTriangleMesh(int estimated_number=-1, float weight_threshold=3.0f)
Definition: Model.cpp:119
void UpdateFramePose(int frame_id, const core::Tensor &T_frame_to_world)
Definition: Model.h:56
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
Frame is a container class storing an intrinsic matrix and several 2D tensors, from depth map...
Definition: Frame.h:41