open3d.t.geometry.VoxelBlockGrid¶
-
class
open3d.t.geometry.
VoxelBlockGrid
¶ A voxel block grid is a sparse grid of voxel blocks. Each voxel block is a dense 3D array, preserving local data distribution. If the block_resolution is set to 1, then the VoxelBlockGrid degenerates to a sparse voxel grid.
-
__init__
(self: open3d.cpu.pybind.t.geometry.VoxelBlockGrid, attr_names: List[str], attr_dtypes: List[open3d.cpu.pybind.core.Dtype], attr_channels: List[open3d.cpu.pybind.core.SizeVector], voxel_size: float = 0.0058, block_resolution: int = 16, block_count: int = 10000, device: open3d.cpu.pybind.core.Device = CPU:0) → None¶
-
attribute
(self: open3d.cpu.pybind.t.geometry.VoxelBlockGrid, attribute_name: str) → open3d.cpu.pybind.core.Tensor¶ Get the attribute tensor to be indexed with voxel_indices.
-
compute_unique_block_coordinates
(*args, **kwargs)¶ Overloaded function.
compute_unique_block_coordinates(self: open3d.cpu.pybind.t.geometry.VoxelBlockGrid, depth: open3d.cpu.pybind.t.geometry.Image, intrinsic: open3d.cpu.pybind.core.Tensor, extrinsic: open3d.cpu.pybind.core.Tensor, depth_scale: float = 1000.0, depth_max: float = 3.0, trunc_voxel_multiplier: float = 4.0) -> open3d.cpu.pybind.core.Tensor
Get a (3, M) active block coordinates from a depth image, with potential duplicates removed.Note: these coordinates are not activated in the internal sparse voxel block. They need to be inserted in the hash map.
compute_unique_block_coordinates(self: open3d.cpu.pybind.t.geometry.VoxelBlockGrid, pcd: open3d.cpu.pybind.t.geometry.PointCloud, trunc_voxel_multiplier: float = 4.0) -> open3d.cpu.pybind.core.Tensor
Obtain active block coordinates from a point cloud.
-
extract_point_cloud
(self: open3d.cpu.pybind.t.geometry.VoxelBlockGrid, point_cloud_size_estimate: int = - 1, weight_threshold: float = 3.0) → open3d.cpu.pybind.t.geometry.PointCloud¶ Specific operation for TSDF volumes.Extract point cloud at isosurface points.
-
extract_triangle_mesh
(self: open3d.cpu.pybind.t.geometry.VoxelBlockGrid, vertex_size_estimate: int = - 1, weight_threshold: float = 3.0) → open3d.cpu.pybind.t.geometry.TriangleMesh¶ Specific operation for TSDF volumes.Extract triangle mesh at isosurface points.
-
hashmap
(self: open3d.cpu.pybind.t.geometry.VoxelBlockGrid) → open3d.cpu.pybind.core.HashMap¶ Get the underlying hash map from 3d block coordinates to block voxel grids.
-
integrate
(*args, **kwargs)¶ Overloaded function.
integrate(self: open3d.cpu.pybind.t.geometry.VoxelBlockGrid, block_coords: open3d.cpu.pybind.core.Tensor, depth: open3d.cpu.pybind.t.geometry.Image, color: open3d.cpu.pybind.t.geometry.Image, intrinsic: open3d.cpu.pybind.core.Tensor, extrinsic: open3d.cpu.pybind.core.Tensor, depth_scale: float = 1000.0, depth_max: float = 3.0) -> None
Specific operation for TSDF volumes.Integrate an RGB-D frame in the selected block coordinates using pinhole camera model.
integrate(self: open3d.cpu.pybind.t.geometry.VoxelBlockGrid, block_coords: open3d.cpu.pybind.core.Tensor, depth: open3d.cpu.pybind.t.geometry.Image, intrinsic: open3d.cpu.pybind.core.Tensor, extrinsic: open3d.cpu.pybind.core.Tensor, depth_scale: float = 1000.0, depth_max: float = 3.0) -> None
Specific operation for TSDF volumes.Similar to RGB-D integration, but only applied to depth images.
-
static
load
(file_name: str) → open3d.cpu.pybind.t.geometry.VoxelBlockGrid¶ Load a voxel block grid from a npz file.
-
ray_cast
(self: open3d.cpu.pybind.t.geometry.VoxelBlockGrid, block_coords: open3d.cpu.pybind.core.Tensor, intrinsic: open3d.cpu.pybind.core.Tensor, extrinsic: open3d.cpu.pybind.core.Tensor, width: int, height: int, render_attributes: List[str] = ['depth', 'color'], depth_scale: float = 1000.0, depth_min: float = 0.10000000149011612, depth_max: float = 3.0, weight_threshold: float = 3.0) → open3d.cpu.pybind.t.geometry.TensorMap¶ Specific operation for TSDF volumes.Perform volumetric ray casting in the selected block coordinates.The block coordinates in the frustum can be taken fromcompute_unique_block_coordinatesAll the block coordinates can be taken from hashmap().key_tensor()
-
save
(self: open3d.cpu.pybind.t.geometry.VoxelBlockGrid, Save the voxel block grid to a npz file.file_name: str) → None¶
-
voxel_coordinates
(self: open3d.cpu.pybind.t.geometry.VoxelBlockGrid, voxel_indices: open3d.cpu.pybind.core.Tensor) → open3d.cpu.pybind.core.Tensor¶ Get a (3, hashmap.Size() * resolution^3) coordinate tensor of activevoxels per block, used for geometry transformation jointly with indices from voxel_indices. Example: For a voxel block grid with (2, 2, 2) block resolution, if the active block coordinates are {(-1, 3, 2), (0, 2, 4)}, the returned result will be a (3, 2 x 8) tensor given by: { key_tensor[voxel_indices[0]] * block_resolution_ + voxel_indices[1] key_tensor[voxel_indices[0]] * block_resolution_ + voxel_indices[2] key_tensor[voxel_indices[0]] * block_resolution_ + voxel_indices[3] } Note: the coordinates are VOXEL COORDINATES in Int64. To access metriccoordinates, multiply by voxel size.
-
voxel_coordinates_and_flattened_indices
(*args, **kwargs)¶ Overloaded function.
voxel_coordinates_and_flattened_indices(self: open3d.cpu.pybind.t.geometry.VoxelBlockGrid, buf_indices: open3d.cpu.pybind.core.Tensor) -> Tuple[open3d.cpu.pybind.core.Tensor, open3d.cpu.pybind.core.Tensor]
Get a (buf_indices.shape[0] * resolution^3, 3), Float32 voxel coordinate tensor,and a (buf_indices.shape[0] * resolution^3, 1), Int64 voxel index tensor.
voxel_coordinates_and_flattened_indices(self: open3d.cpu.pybind.t.geometry.VoxelBlockGrid) -> Tuple[open3d.cpu.pybind.core.Tensor, open3d.cpu.pybind.core.Tensor]
Get a (hashmap.size() * resolution^3, 3), Float32 voxel coordinate tensor,and a (hashmap.size() * resolution^3, 1), Int64 voxel index tensor.
-
voxel_indices
(*args, **kwargs)¶ Overloaded function.
voxel_indices(self: open3d.cpu.pybind.t.geometry.VoxelBlockGrid, arg0: open3d.cpu.pybind.core.Tensor) -> open3d.cpu.pybind.core.Tensor
Get a (4, N), Int64 index tensor for input buffer indices, used for advanced indexing. Returned index tensor can access selected value bufferin the order of (buf_index, index_voxel_x, index_voxel_y, index_voxel_z). Example: For a voxel block grid with (2, 2, 2) block resolution, if the active block coordinates are at buffer index {(2, 4)} given by active_indices() from the underlying hash map, the returned result will be a (4, 2 x 8) tensor: { (2, 0, 0, 0), (2, 1, 0, 0), (2, 0, 1, 0), (2, 1, 1, 0), (2, 0, 0, 1), (2, 1, 0, 1), (2, 0, 1, 1), (2, 1, 1, 1), (4, 0, 0, 0), (4, 1, 0, 0), (4, 0, 1, 0), (4, 1, 1, 0), (4, 0, 0, 1), (4, 1, 0, 1), (4, 0, 1, 1), (4, 1, 1, 1), }Note: the slicing order is z-y-x.
voxel_indices(self: open3d.cpu.pybind.t.geometry.VoxelBlockGrid) -> open3d.cpu.pybind.core.Tensor
Get a (4, N) Int64 idnex tensor for all the active voxels stored in the hash map, used for advanced indexing.
-