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.

  1. 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 = 8.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.

  1. compute_unique_block_coordinates(self: open3d.cpu.pybind.t.geometry.VoxelBlockGrid, pcd: open3d.cpu.pybind.t.geometry.PointCloud, trunc_voxel_multiplier: float = 8.0) -> open3d.cpu.pybind.core.Tensor

Obtain active block coordinates from a point cloud.

cpu(self: open3d.cpu.pybind.t.geometry.VoxelBlockGrid) open3d.cpu.pybind.t.geometry.VoxelBlockGrid#

Transfer the voxel block grid to CPU. If the voxel block grid is already on CPU, no copy will be performed.

cuda(self: open3d.cpu.pybind.t.geometry.VoxelBlockGrid, device_id: int = 0) open3d.cpu.pybind.t.geometry.VoxelBlockGrid#

Transfer the voxel block grid to a CUDA device. If the voxel block grid is already on the specified CUDA device, no copy will be performed.

extract_point_cloud(self: open3d.cpu.pybind.t.geometry.VoxelBlockGrid, weight_threshold: float = 3.0, estimated_point_number: int = -1) 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, weight_threshold: float = 3.0, estimated_vertex_number: int = -1) 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.

  1. 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, depth_intrinsic: open3d.cpu.pybind.core.Tensor, color_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 = 8.0) -> None

Specific operation for TSDF volumes.Integrate an RGB-D frame in the selected block coordinates using pinhole camera model.

  1. 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, trunc_voxel_multiplier: float = 8.0) -> None

Specific operation for TSDF volumes.Integrate an RGB-D frame in the selected block coordinates using pinhole camera model.

  1. 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, trunc_voxel_multiplier: float = 8.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, trunc_voxel_multiplier: float = 8.0, range_map_down_factor: int = 8) 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, file_name: str) None#

Save the voxel block grid to a npz file.

to(self: open3d.cpu.pybind.t.geometry.VoxelBlockGrid, device: open3d.cpu.pybind.core.Device, copy: bool = False) open3d.cpu.pybind.t.geometry.VoxelBlockGrid#

Transfer the voxel block grid to a specified device.

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.

  1. 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.

  1. 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.

  1. 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.

  1. 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.