ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
VoxelBlockGrid.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <unordered_map>
11 
16 
17 namespace cloudViewer {
18 namespace t {
19 namespace geometry {
20 namespace kernel {
21 namespace voxel_grid {
22 
23 using index_t = int;
24 
25 void PointCloudTouch(std::shared_ptr<core::HashMap>& hashmap,
26  const core::Tensor& points,
27  core::Tensor& voxel_block_coords,
28  index_t voxel_grid_resolution,
29  float voxel_size,
30  float sdf_trunc);
31 
32 void DepthTouch(std::shared_ptr<core::HashMap>& hashmap,
33  const core::Tensor& depth,
34  const core::Tensor& intrinsic,
35  const core::Tensor& extrinsic,
36  core::Tensor& voxel_block_coords,
37  index_t voxel_grid_resolution,
38  float voxel_size,
39  float sdf_trunc,
40  float depth_scale,
41  float depth_max,
42  index_t stride);
43 
45  const core::Tensor& block_keys,
46  core::Tensor& voxel_coords,
47  core::Tensor& flattened_indices,
48  index_t block_resolution,
49  float voxel_size);
50 
51 void Integrate(const core::Tensor& depth,
52  const core::Tensor& color,
53  const core::Tensor& block_indices,
54  const core::Tensor& block_keys,
55  TensorMap& block_value_map,
56  const core::Tensor& depth_intrinsic,
57  const core::Tensor& color_intrinsic,
58  const core::Tensor& extrinsic,
59  index_t resolution,
60  float voxel_size,
61  float sdf_trunc,
62  float depth_scale,
63  float depth_max);
64 
65 void EstimateRange(const core::Tensor& block_keys,
66  core::Tensor& range_minmax_map,
67  const core::Tensor& intrinsics,
68  const core::Tensor& extrinsics,
69  int h,
70  int w,
71  int down_factor,
72  int64_t block_resolution,
73  float voxel_size,
74  float depth_min,
75  float depth_max,
76  core::Tensor& fragment_buffer);
77 
78 void RayCast(std::shared_ptr<core::HashMap>& hashmap,
79  const TensorMap& block_value_map,
80  const core::Tensor& range_map,
81  TensorMap& renderings_map,
82  const core::Tensor& intrinsic,
83  const core::Tensor& extrinsic,
84  index_t h,
85  index_t w,
86  index_t block_resolution,
87  float voxel_size,
88  float depth_scale,
89  float depth_min,
90  float depth_max,
91  float weight_threshold,
92  float trunc_voxel_multiplier,
93  int range_map_down_factor);
94 
95 void ExtractPointCloud(const core::Tensor& block_indices,
96  const core::Tensor& nb_block_indices,
97  const core::Tensor& nb_block_masks,
98  const core::Tensor& block_keys,
99  const TensorMap& block_value_map,
103  index_t block_resolution,
104  float voxel_size,
105  float weight_threshold,
106  index_t& valid_size);
107 
108 void ExtractTriangleMesh(const core::Tensor& block_indices,
109  const core::Tensor& inv_block_indices,
110  const core::Tensor& nb_block_indices,
111  const core::Tensor& nb_block_masks,
112  const core::Tensor& block_keys,
113  const TensorMap& block_value_map,
114  core::Tensor& vertices,
115  core::Tensor& triangles,
116  core::Tensor& vertex_normals,
117  core::Tensor& vertex_colors,
118  index_t block_resolution,
119  float voxel_size,
120  float weight_threshold,
121  index_t& vertex_count);
122 
124 void PointCloudTouchCPU(std::shared_ptr<core::HashMap>& hashmap,
125  const core::Tensor& points,
126  core::Tensor& voxel_block_coords,
127  index_t voxel_grid_resolution,
128  float voxel_size,
129  float sdf_trunc);
130 
131 void DepthTouchCPU(std::shared_ptr<core::HashMap>& hashmap,
132  const core::Tensor& depth,
133  const core::Tensor& intrinsic,
134  const core::Tensor& extrinsic,
135  core::Tensor& voxel_block_coords,
136  index_t voxel_grid_resolution,
137  float voxel_size,
138  float sdf_trunc,
139  float depth_scale,
140  float depth_max,
141  index_t stride);
142 
144  const core::Tensor& block_keys,
145  core::Tensor& voxel_coords,
146  core::Tensor& flattened_indices,
147  index_t block_resolution,
148  float voxel_size);
149 
150 template <typename input_depth_t,
151  typename input_color_t,
152  typename tsdf_t,
153  typename weight_t,
154  typename color_t>
155 void IntegrateCPU(const core::Tensor& depth,
156  const core::Tensor& color,
157  const core::Tensor& block_indices,
158  const core::Tensor& block_keys,
159  TensorMap& block_value_map,
160  const core::Tensor& depth_intrinsic,
161  const core::Tensor& color_intrinsic,
162  const core::Tensor& extrinsic,
163  index_t resolution,
164  float voxel_size,
165  float sdf_trunc,
166  float depth_scale,
167  float depth_max);
168 
169 void EstimateRangeCPU(const core::Tensor& block_keys,
170  core::Tensor& range_minmax_map,
171  const core::Tensor& intrinsics,
172  const core::Tensor& extrinsics,
173  int h,
174  int w,
175  int down_factor,
176  int64_t block_resolution,
177  float voxel_size,
178  float depth_min,
179  float depth_max,
180  core::Tensor& fragment_buffer);
181 
182 template <typename tsdf_t, typename weight_t, typename color_t>
183 void RayCastCPU(std::shared_ptr<core::HashMap>& hashmap,
184  const TensorMap& block_value_map,
185  const core::Tensor& range_map,
186  TensorMap& renderings_map,
187  const core::Tensor& intrinsic,
188  const core::Tensor& extrinsic,
189  index_t h,
190  index_t w,
191  index_t block_resolution,
192  float voxel_size,
193  float depth_scale,
194  float depth_min,
195  float depth_max,
196  float weight_threshold,
197  float trunc_voxel_multiplier,
198  int range_map_down_factor);
199 
200 template <typename tsdf_t, typename weight_t, typename color_t>
201 void ExtractPointCloudCPU(const core::Tensor& block_indices,
202  const core::Tensor& nb_block_indices,
203  const core::Tensor& nb_block_masks,
204  const core::Tensor& block_keys,
205  const TensorMap& block_value_map,
209  index_t block_resolution,
210  float voxel_size,
211  float weight_threshold,
212  index_t& valid_size);
213 
214 template <typename tsdf_t, typename weight_t, typename color_t>
215 void ExtractTriangleMeshCPU(const core::Tensor& block_indices,
216  const core::Tensor& inv_block_indices,
217  const core::Tensor& nb_block_indices,
218  const core::Tensor& nb_block_masks,
219  const core::Tensor& block_keys,
220  const TensorMap& block_value_map,
221  core::Tensor& vertices,
222  core::Tensor& triangles,
223  core::Tensor& vertex_normals,
224  core::Tensor& vertex_colors,
225  index_t block_resolution,
226  float voxel_size,
227  float weight_threshold,
228  index_t& vertex_count);
229 
230 #ifdef BUILD_CUDA_MODULE
231 void PointCloudTouchCUDA(std::shared_ptr<core::HashMap>& hashmap,
232  const core::Tensor& points,
233  core::Tensor& voxel_block_coords,
234  index_t voxel_grid_resolution,
235  float voxel_size,
236  float sdf_trunc);
237 
238 void DepthTouchCUDA(std::shared_ptr<core::HashMap>& hashmap,
239  const core::Tensor& depth,
240  const core::Tensor& intrinsic,
241  const core::Tensor& extrinsic,
242  core::Tensor& voxel_block_coords,
243  index_t voxel_grid_resolution,
244  float voxel_size,
245  float sdf_trunc,
246  float depth_scale,
247  float depth_max,
248  index_t stride);
249 
250 void GetVoxelCoordinatesAndFlattenedIndicesCUDA(const core::Tensor& buf_indices,
251  const core::Tensor& block_keys,
252  core::Tensor& voxel_coords,
253  core::Tensor& flattened_indices,
254  index_t block_resolution,
255  float voxel_size);
256 
257 template <typename input_depth_t,
258  typename input_color_t,
259  typename tsdf_t,
260  typename weight_t,
261  typename color_t>
262 void IntegrateCUDA(const core::Tensor& depth,
263  const core::Tensor& color,
264  const core::Tensor& block_indices,
265  const core::Tensor& block_keys,
266  TensorMap& block_value_map,
267  const core::Tensor& depth_intrinsic,
268  const core::Tensor& color_intrinsic,
269  const core::Tensor& extrinsic,
270  index_t resolution,
271  float voxel_size,
272  float sdf_trunc,
273  float depth_scale,
274  float depth_max);
275 
276 void EstimateRangeCUDA(const core::Tensor& block_keys,
277  core::Tensor& range_minmax_map,
278  const core::Tensor& intrinsics,
279  const core::Tensor& extrinsics,
280  int h,
281  int w,
282  int down_factor,
283  int64_t block_resolution,
284  float voxel_size,
285  float depth_min,
286  float depth_max,
287  core::Tensor& fragment_buffer);
288 
289 template <typename tsdf_t, typename weight_t, typename color_t>
290 void RayCastCUDA(std::shared_ptr<core::HashMap>& hashmap,
291  const TensorMap& block_value_map,
292  const core::Tensor& range_map,
293  TensorMap& renderings_map,
294  const core::Tensor& intrinsic,
295  const core::Tensor& extrinsic,
296  index_t h,
297  index_t w,
298  index_t block_resolution,
299  float voxel_size,
300  float depth_scale,
301  float depth_min,
302  float depth_max,
303  float weight_threshold,
304  float trunc_voxel_multiplier,
305  int range_map_down_factor);
306 
307 template <typename tsdf_t, typename weight_t, typename color_t>
308 void ExtractPointCloudCUDA(const core::Tensor& block_indices,
309  const core::Tensor& nb_block_indices,
310  const core::Tensor& nb_block_masks,
311  const core::Tensor& block_keys,
312  const TensorMap& block_value_map,
316  index_t block_resolution,
317  float voxel_size,
318  float weight_threshold,
319  index_t& valid_size);
320 
321 template <typename tsdf_t, typename weight_t, typename color_t>
322 void ExtractTriangleMeshCUDA(const core::Tensor& block_indices,
323  const core::Tensor& inv_block_indices,
324  const core::Tensor& nb_block_indices,
325  const core::Tensor& nb_block_masks,
326  const core::Tensor& block_keys,
327  const TensorMap& block_value_map,
328  core::Tensor& vertices,
329  core::Tensor& triangles,
330  core::Tensor& vertex_normals,
331  core::Tensor& vertex_colors,
332  index_t block_resolution,
333  float voxel_size,
334  float weight_threshold,
335  index_t& vertex_count);
336 
337 #endif
338 } // namespace voxel_grid
339 } // namespace kernel
340 } // namespace geometry
341 } // namespace t
342 } // namespace cloudViewer
cloudViewer
Generic file read and write utility for python interface.
Definition: CloudViewerConfig.cpp:12
colors
double colors[3]
Definition: TriangleMeshIO.cpp:53
cloudViewer::t::geometry::TensorMap
Definition: TensorMap.h:31
PointCloud.h
cloudViewer::core::Tensor::GetDtype
Dtype GetDtype() const
Definition: Tensor.h:1164
ShapeUtil.h
cloudViewer::t::geometry::kernel::voxel_grid::ExtractTriangleMeshCPU
void ExtractTriangleMeshCPU(const core::Tensor &block_indices, const core::Tensor &inv_block_indices, const core::Tensor &nb_block_indices, const core::Tensor &nb_block_masks, const core::Tensor &block_keys, const TensorMap &block_value_map, core::Tensor &vertices, core::Tensor &triangles, core::Tensor &vertex_normals, core::Tensor &vertex_colors, index_t block_resolution, float voxel_size, float weight_threshold, index_t &vertex_count)
Definition: VoxelBlockGridImpl.h:1305
CUDAUtils.h
Common CUDA utilities.
FileSystem.h
cloudViewer::t::geometry::BufferRadiusNeighbors
static std::pair< core::Tensor, core::Tensor > BufferRadiusNeighbors(std::shared_ptr< core::HashMap > &hashmap, const core::Tensor &active_buf_indices)
Definition: VoxelBlockGrid.cpp:23
cloudViewer::core::Dtype::Bool
static const Dtype Bool
Definition: Dtype.h:34
cloudViewer::core::Tensor::GetLength
int64_t GetLength() const
Definition: Tensor.h:1125
cloudViewer::core::make_pair
CLOUDVIEWER_HOST_DEVICE Pair< First, Second > make_pair(const First &_first, const Second &_second)
Definition: SlabTraits.h:49
cloudViewer::core::Tensor::GetShape
SizeVector GetShape() const
Definition: Tensor.h:1127
core::Tensor
copy
bool copy
Definition: VtkUtils.cpp:74
cloudViewer::t::geometry::TriangleMesh::SetVertexColors
void SetVertexColors(const core::Tensor &value)
Definition: TriangleMesh.h:268
cloudViewer::utility::filesystem::GetFileExtensionInLowerCase
std::string GetFileExtensionInLowerCase(const std::string &filename)
Definition: FileSystem.cpp:281
cloudViewer::t::geometry::kernel::voxel_grid::ExtractPointCloudCPU
void ExtractPointCloudCPU(const core::Tensor &block_indices, const core::Tensor &nb_block_indices, const core::Tensor &nb_block_masks, const core::Tensor &block_keys, const TensorMap &block_value_map, core::Tensor &points, core::Tensor &normals, core::Tensor &colors, index_t block_resolution, float voxel_size, float weight_threshold, index_t &valid_size)
Definition: VoxelBlockGridImpl.h:1043
cloudViewer::t::geometry::VoxelBlockGrid::GetVoxelCoordinates
core::Tensor GetVoxelCoordinates(const core::Tensor &voxel_indices) const
Definition: VoxelBlockGrid.cpp:131
format
filament::Texture::InternalFormat format
Definition: FilamentResourceManager.cpp:181
cloudViewer::core::IsDevice::IsCUDA
bool IsCUDA() const
Definition: Device.h:99
cloudViewer::core::Tensor::Contiguous
Tensor Contiguous() const
Definition: Tensor.cpp:772
cloudViewer::t::geometry::CheckBlockCoordinates
void CheckBlockCoordinates(const core::Tensor &block_coords)
Definition: Utility.h:69
Utility.h
cloudViewer::t::geometry::ConstructTensorMap
static TensorMap ConstructTensorMap(const core::HashMap &block_hashmap, std::unordered_map< std::string, int > name_attr_map)
Definition: VoxelBlockGrid.cpp:54
cloudViewer::core::Device::DeviceType::CPU
@ CPU
Geometry.h
cloudViewer::core::HashMap
Definition: HashMap.h:23
VoxelBlockGrid.h
cloudViewer::t::geometry::Image
The Image class stores image with customizable rows, cols, channels, dtype and device.
Definition: Image.h:29
cloudViewer::core::Tensor::View
Tensor View(const SizeVector &dst_shape) const
Definition: Tensor.cpp:721
color
math::float4 color
Definition: LineSetBuffers.cpp:46
cloudViewer::t::geometry::Image::GetRows
int64_t GetRows() const
Get the number of rows of the image.
Definition: Image.h:84
cloudViewer::t::geometry::VoxelBlockGrid::GetAttribute
core::Tensor GetAttribute(const std::string &attr_name) const
Definition: VoxelBlockGrid.cpp:120
NumpyIO.h
TensorMap.h
cloudViewer::t::geometry::PointCloud
A point cloud contains a list of 3D points.
Definition: PointCloud.h:82
cloudViewer::core::HashMap::GetValueTensor
Tensor GetValueTensor(size_t index=0) const
Definition: HashMap.cpp:294
cloudViewer::core::Dtype
Definition: Dtype.h:21
cloudViewer::t::geometry::VoxelBlockGrid::Load
static VoxelBlockGrid Load(const std::string &file_name)
Load a voxel block grid from a .npz file.
Definition: VoxelBlockGrid.cpp:541
cloudViewer::t::geometry::TriangleMesh
A triangle mesh contains vertices and triangles.
Definition: TriangleMesh.h:98
normals
double normals[3]
Definition: TriangleMeshIO.cpp:54
width
int width
Definition: FileIOFactory.cpp:142
float
float
Definition: my_point_types.h:154
cloudViewer::core::Dtype::Float32
static const Dtype Float32
Definition: Dtype.h:24
CUDA_CALL
#define CUDA_CALL(cuda_function,...)
Definition: CUDAUtils.h:49
cloudViewer::t::geometry::CheckExtrinsicTensor
void CheckExtrinsicTensor(const core::Tensor &extrinsic)
Definition: Utility.h:53
height
int height
Definition: FileIOFactory.cpp:143
cloudViewer::t::geometry::TensorMap::Contains
bool Contains(const std::string &key) const
Definition: TensorMap.h:187
cloudViewer::core::Tensor::Arange
static Tensor Arange(const Scalar start, const Scalar stop, const Scalar step=1, const Dtype dtype=core::Int64, const Device &device=core::Device("CPU:0"))
Create a 1D tensor with evenly spaced values in the given interval.
Definition: Tensor.cpp:436
cloudViewer::t::geometry::kernel::voxel_grid::RayCast
void RayCast(std::shared_ptr< core::HashMap > &hashmap, const TensorMap &block_value_map, const core::Tensor &range_map, TensorMap &renderings_map, const core::Tensor &intrinsic, const core::Tensor &extrinsic, index_t h, index_t w, index_t block_resolution, float voxel_size, float depth_scale, float depth_min, float depth_max, float weight_threshold, float trunc_voxel_multiplier, int range_map_down_factor)
Definition: VoxelBlockGrid.cpp:227
cloudViewer::core::Tensor::Zeros
static Tensor Zeros(const SizeVector &shape, Dtype dtype, const Device &device=Device("CPU:0"))
Create a tensor fill with zeros.
Definition: Tensor.cpp:406
cloudViewer::t::geometry::VoxelBlockGrid::ExtractTriangleMesh
TriangleMesh ExtractTriangleMesh(float weight_threshold=3.0f, int estimated_vertex_numer=-1)
Definition: VoxelBlockGrid.cpp:437
cloudViewer::core::Int32
const Dtype Int32
Definition: Dtype.cpp:46
cloudViewer::t::geometry::kernel::voxel_grid::GetVoxelCoordinatesAndFlattenedIndicesCPU
void GetVoxelCoordinatesAndFlattenedIndicesCPU(const core::Tensor &buf_indices, const core::Tensor &block_keys, core::Tensor &voxel_coords, core::Tensor &flattened_indices, index_t block_resolution, float voxel_size)
Definition: VoxelBlockGridImpl.h:39
cloudViewer::t::geometry::Image::AsTensor
core::Tensor AsTensor() const
Returns the underlying Tensor of the Image.
Definition: Image.h:124
cloudViewer::t::geometry::kernel::voxel_grid::index_t
int index_t
Definition: VoxelBlockGrid.h:23
cloudViewer::t::geometry::kernel::voxel_grid::RayCastCPU
void RayCastCPU(std::shared_ptr< core::HashMap > &hashmap, const TensorMap &block_value_map, const core::Tensor &range_map, TensorMap &renderings_map, const core::Tensor &intrinsic, const core::Tensor &extrinsic, index_t h, index_t w, index_t block_resolution, float voxel_size, float depth_scale, float depth_min, float depth_max, float weight_threshold, float trunc_voxel_multiplier, int range_map_down_factor)
Definition: VoxelBlockGridImpl.h:544
cloudViewer::t::geometry::kernel::voxel_grid::ExtractTriangleMesh
void ExtractTriangleMesh(const core::Tensor &block_indices, const core::Tensor &inv_block_indices, const core::Tensor &nb_block_indices, const core::Tensor &nb_block_masks, const core::Tensor &block_keys, const TensorMap &block_value_map, core::Tensor &vertices, core::Tensor &triangles, core::Tensor &vertex_normals, core::Tensor &vertex_colors, index_t block_resolution, float voxel_size, float weight_threshold, int &vertex_count)
Definition: VoxelBlockGrid.cpp:334
cloudViewer::core::Device
Definition: Device.h:18
cloudViewer::t::geometry::CheckColorTensor
void CheckColorTensor(const core::Tensor &color)
Definition: Utility.h:27
DISPATCH_VALUE_DTYPE_TO_TEMPLATE
#define DISPATCH_VALUE_DTYPE_TO_TEMPLATE(WEIGHT_DTYPE, COLOR_DTYPE,...)
Definition: VoxelBlockGrid.cpp:85
cloudViewer::t::geometry::VoxelBlockGrid::Integrate
void Integrate(const core::Tensor &block_coords, const Image &depth, const Image &color, const core::Tensor &depth_intrinsic, const core::Tensor &color_intrinsic, const core::Tensor &extrinsic, float depth_scale=1000.0f, float depth_max=3.0f, float trunc_voxel_multiplier=8.0f)
Definition: VoxelBlockGrid.cpp:293
cloudViewer::t::geometry::VoxelBlockGrid::ExtractPointCloud
PointCloud ExtractPointCloud(float weight_threshold=3.0f, int estimated_point_number=-1)
Definition: VoxelBlockGrid.cpp:405
cloudViewer::core::Dtype::UInt8
static const Dtype UInt8
Definition: Dtype.h:30
cloudViewer::core::Tensor::IndexGet
Tensor IndexGet(const std::vector< Tensor > &index_tensors) const
Advanced indexing getter. This will always allocate a new Tensor.
Definition: Tensor.cpp:905
cloudViewer::t::geometry::VoxelBlockGrid::GetVoxelCoordinatesAndFlattenedIndices
std::pair< core::Tensor, core::Tensor > GetVoxelCoordinatesAndFlattenedIndices()
Definition: VoxelBlockGrid.cpp:187
cloudViewer::t::geometry::kernel::voxel_grid::PointCloudTouch
void PointCloudTouch(std::shared_ptr< core::HashMap > &hashmap, const core::Tensor &points, core::Tensor &voxel_block_coords, index_t voxel_grid_resolution, float voxel_size, float sdf_trunc)
Definition: VoxelBlockGrid.cpp:25
cloudViewer::core::Float64
const Dtype Float64
Definition: Dtype.cpp:43
VoxelBlockGrid.h
cloudViewer::t::geometry::VoxelBlockGrid::GetVoxelIndices
core::Tensor GetVoxelIndices() const
Get all active voxel indices.
Definition: VoxelBlockGrid.cpp:181
cloudViewer::t::geometry::VoxelBlockGrid
Definition: VoxelBlockGrid.h:26
cloudViewer::t::geometry::Image::GetCols
int64_t GetCols() const
Get the number of columns of the image.
Definition: Image.h:87
points
int points
Definition: FileIOFactory.cpp:144
cloudViewer::core::Dtype::Int64
static const Dtype Int64
Definition: Dtype.h:29
cloudViewer::core::Float32
const Dtype Float32
Definition: Dtype.cpp:42
cloudViewer::core::SizeVector
Definition: SizeVector.h:70
HashMap.h
cloudViewer::t::geometry::kernel::voxel_grid::PointCloudTouchCPU
void PointCloudTouchCPU(std::shared_ptr< core::HashMap > &hashmap, const core::Tensor &points, core::Tensor &voxel_block_coords, index_t voxel_grid_resolution, float voxel_size, float sdf_trunc)
CPU.
Definition: VoxelBlockGridCPU.cpp:55
cloudViewer::t::geometry::VoxelBlockGrid::VoxelBlockGrid
VoxelBlockGrid()=default
LogError
#define LogError(...)
Definition: Logging.h:60
cloudViewer::t::geometry::VoxelBlockGrid::RayCast
TensorMap RayCast(const core::Tensor &block_coords, const core::Tensor &intrinsic, const core::Tensor &extrinsic, int width, int height, const std::vector< std::string > attrs={"depth", "color"}, float depth_scale=1000.0f, float depth_min=0.1f, float depth_max=3.0f, float weight_threshold=3.0f, float trunc_voxel_multiplier=8.0f, int range_map_down_factor=8)
Definition: VoxelBlockGrid.cpp:329
cloudViewer::t::geometry::VoxelBlockGrid::GetUniqueBlockCoordinates
core::Tensor GetUniqueBlockCoordinates(const Image &depth, const core::Tensor &intrinsic, const core::Tensor &extrinsic, float depth_scale=1000.0f, float depth_max=3.0f, float trunc_voxel_multiplier=8.0)
Definition: VoxelBlockGrid.cpp:213
cloudViewer::t::geometry::VoxelBlockGrid::Save
void Save(const std::string &file_name) const
Save a voxel block grid to a .npz file.
Definition: VoxelBlockGrid.cpp:475
cloudViewer::t::geometry::kernel::voxel_grid::GetVoxelCoordinatesAndFlattenedIndices
void GetVoxelCoordinatesAndFlattenedIndices(const core::Tensor &buf_indices, const core::Tensor &block_keys, core::Tensor &voxel_coords, core::Tensor &flattened_indices, index_t block_resolution, float voxel_size)
Definition: VoxelBlockGrid.cpp:66
cloudViewer::core::IsDevice::IsCPU
bool IsCPU() const
Definition: Device.h:95
cloudViewer::core::HashBackendType
HashBackendType
Definition: HashMap.h:21
cloudViewer::t::geometry::TriangleMesh::SetVertexNormals
void SetVertexNormals(const core::Tensor &value)
Definition: TriangleMesh.h:275
cloudViewer::t::io::ReadNpz
std::unordered_map< std::string, core::Tensor > ReadNpz(const std::string &file_name)
Definition: NumpyIO.cpp:675
cloudViewer::t::geometry::VoxelBlockGrid::To
VoxelBlockGrid To(const core::Device &device, bool copy=false) const
Convert the hash map to another device.
Definition: VoxelBlockGrid.cpp:530
cloudViewer::t::io::WriteNpz
void WriteNpz(const std::string &file_name, const std::unordered_map< std::string, core::Tensor > &tensor_map)
Definition: NumpyIO.cpp:759
cloudViewer::t::geometry::kernel::voxel_grid::DepthTouchCPU
void DepthTouchCPU(std::shared_ptr< core::HashMap > &hashmap, const core::Tensor &depth, const core::Tensor &intrinsic, const core::Tensor &extrinsic, core::Tensor &voxel_block_coords, index_t voxel_grid_resolution, float voxel_size, float sdf_trunc, float depth_scale, float depth_max, index_t stride)
Definition: VoxelBlockGridCPU.cpp:117
cloudViewer::t::geometry::kernel::voxel_grid::DepthTouch
void DepthTouch(std::shared_ptr< core::HashMap > &hashmap, const core::Tensor &depth, const core::Tensor &intrinsic, const core::Tensor &extrinsic, core::Tensor &voxel_block_coords, index_t voxel_grid_resolution, float voxel_size, float sdf_trunc, float depth_scale, float depth_max, index_t stride)
Definition: VoxelBlockGrid.cpp:42
Tensor.h
cloudViewer::t::geometry::CheckIntrinsicTensor
void CheckIntrinsicTensor(const core::Tensor &intrinsic)
Definition: Utility.h:37
LogWarning
#define LogWarning(...)
Definition: Logging.h:72
DISPATCH_INPUT_DTYPE_TO_TEMPLATE
#define DISPATCH_INPUT_DTYPE_TO_TEMPLATE(DEPTH_DTYPE, COLOR_DTYPE,...)
Definition: VoxelBlockGrid.cpp:106
cloudViewer::t::geometry::PointCloud::GetPointPositions
core::Tensor & GetPointPositions()
Get the value of the "positions" attribute. Convenience function.
Definition: PointCloud.h:124
cloudViewer::t::geometry::kernel::voxel_grid::Integrate
void Integrate(const core::Tensor &depth, const core::Tensor &color, const core::Tensor &block_indices, const core::Tensor &block_keys, TensorMap &block_value_map, const core::Tensor &depth_intrinsic, const core::Tensor &color_intrinsic, const core::Tensor &extrinsic, index_t resolution, float voxel_size, float sdf_trunc, float depth_scale, float depth_max)
Definition: VoxelBlockGrid.cpp:126
cloudViewer::t::geometry::kernel::voxel_grid::EstimateRangeCPU
void EstimateRangeCPU(const core::Tensor &block_keys, core::Tensor &range_minmax_map, const core::Tensor &intrinsics, const core::Tensor &extrinsics, int h, int w, int down_factor, int64_t block_resolution, float voxel_size, float depth_min, float depth_max, core::Tensor &fragment_buffer)
Definition: VoxelBlockGridImpl.h:302
cloudViewer::t::geometry::kernel::voxel_grid::ExtractPointCloud
void ExtractPointCloud(const core::Tensor &block_indices, const core::Tensor &nb_block_indices, const core::Tensor &nb_block_masks, const core::Tensor &block_keys, const TensorMap &block_value_map, core::Tensor &points, core::Tensor &normals, core::Tensor &colors, index_t block_resolution, float voxel_size, float weight_threshold, int &valid_size)
Definition: VoxelBlockGrid.cpp:284
cloudViewer::core::Device::DeviceType::CUDA
@ CUDA
cloudViewer::t::geometry::kernel::voxel_grid::EstimateRange
void EstimateRange(const core::Tensor &block_keys, core::Tensor &range_minmax_map, const core::Tensor &intrinsics, const core::Tensor &extrinsics, int h, int w, int down_factor, int64_t block_resolution, float voxel_size, float depth_min, float depth_max, core::Tensor &fragment_buffer)
Definition: VoxelBlockGrid.cpp:194
cloudViewer::core::Int64
const Dtype Int64
Definition: Dtype.cpp:47
cloudViewer::core::Tensor::To
Tensor To(Dtype dtype, bool copy=false) const
Definition: Tensor.cpp:739
cloudViewer::geometry::PointCloud
::ccPointCloud PointCloud
Definition: PointCloud.h:19
voxel_size
double voxel_size
Definition: VoxelGridIO.cpp:28
cloudViewer::t::geometry::CheckDepthTensor
void CheckDepthTensor(const core::Tensor &depth)
Definition: Utility.h:17
cloudViewer::t::geometry::kernel::voxel_grid::IntegrateCPU
void IntegrateCPU(const core::Tensor &depth, const core::Tensor &color, const core::Tensor &block_indices, const core::Tensor &block_keys, TensorMap &block_value_map, const core::Tensor &depth_intrinsic, const core::Tensor &color_intrinsic, const core::Tensor &extrinsic, index_t resolution, float voxel_size, float sdf_trunc, float depth_scale, float depth_max)
Definition: VoxelBlockGridImpl.h:150
name
std::string name
Definition: FileIOFactory.cpp:129
DeviceHashBackend.h
stride
size_t stride
Definition: TriangleMeshBuffers.cpp:166