open3d.geometry.VoxelGrid

class open3d.geometry.VoxelGrid

VoxelGrid is a collection of voxels which are aligned in grid.

class Type

Enum class for Geometry types.

HalfEdgeTriangleMesh = <Type.HalfEdgeTriangleMesh: 7>
Image = <Type.Image: 8>
LineSet = <Type.LineSet: 4>
PointCloud = <Type.PointCloud: 1>
RGBDImage = <Type.RGBDImage: 9>
TetraMesh = <Type.TetraMesh: 10>
TriangleMesh = <Type.TriangleMesh: 6>
Unspecified = <Type.Unspecified: 0>
VoxelGrid = <Type.VoxelGrid: 2>
property value
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: open3d.cpu.pybind.geometry.VoxelGrid) -> None

Default constructor

  1. __init__(self: open3d.cpu.pybind.geometry.VoxelGrid, arg0: open3d.cpu.pybind.geometry.VoxelGrid) -> None

Copy constructor

carve_depth_map(self, depth_map, camera_params, keep_voxels_outside_image=False)

Remove all voxels from the VoxelGrid where none of the boundary points of the voxel projects to depth value that is smaller, or equal than the projected depth of the boundary point. If keep_voxels_outside_image is true then voxels are only carved if all boundary points project to a valid image location.

Parameters
Returns

open3d.geometry.VoxelGrid

carve_silhouette(self, silhouette_mask, camera_params, keep_voxels_outside_image=False)

Remove all voxels from the VoxelGrid where none of the boundary points of the voxel projects to a valid mask pixel (pixel value > 0). If keep_voxels_outside_image is true then voxels are only carved if all boundary points project to a valid image location.

Parameters
Returns

open3d.geometry.VoxelGrid

check_if_included(self, queries)

Element-wise check if a query in the list is included in the VoxelGrid. Queries are double precision and are mapped to the closest voxel.

Parameters

queries (open3d.utility.Vector3dVector) –

Returns

List[bool]

clear(self)

Clear all elements in the geometry.

Returns

open3d.geometry.Geometry

static create_dense(origin, color, voxel_size, width, height, depth)

Creates a voxel grid where every voxel is set (hence dense). This is a useful starting point for voxel carving

Parameters
  • origin (numpy.ndarray[numpy.float64[3, 1]]) – Coordinate center of the VoxelGrid

  • color (numpy.ndarray[numpy.float64[3, 1]]) – Voxel color for all voxels if the VoxelGrid.

  • voxel_size (float) – Voxel size of of the VoxelGrid construction.

  • width (float) – Spatial width extend of the VoxelGrid.

  • height (float) – Spatial height extend of the VoxelGrid.

  • depth (float) – Spatial depth extend of the VoxelGrid.

Returns

open3d.geometry.VoxelGrid

create_from_octree(self, octree)

Convert from Octree.

Parameters

octree (open3d.geometry.Octree) – geometry.Octree: The source octree.

Returns

None

static create_from_point_cloud(input, voxel_size)

Creates a VoxelGrid from a given PointCloud. The color value of a given voxel is the average color value of the points that fall into it (if the PointCloud has colors). The bounds of the created VoxelGrid are computed from the PointCloud.

Parameters
Returns

open3d.geometry.VoxelGrid

static create_from_point_cloud_within_bounds(input, voxel_size, min_bound, max_bound)

Creates a VoxelGrid from a given PointCloud. The color value of a given voxel is the average color value of the points that fall into it (if the PointCloud has colors). The bounds of the created VoxelGrid are defined by the given parameters.

Parameters
  • input (open3d.geometry.PointCloud) – The input PointCloud

  • voxel_size (float) – Voxel size of of the VoxelGrid construction.

  • min_bound (numpy.ndarray[numpy.float64[3, 1]]) – Minimum boundary point for the VoxelGrid to create.

  • max_bound (numpy.ndarray[numpy.float64[3, 1]]) – Maximum boundary point for the VoxelGrid to create.

Returns

open3d.geometry.VoxelGrid

static create_from_triangle_mesh(input, voxel_size)

Creates a VoxelGrid from a given TriangleMesh. No color information is converted. The bounds of the created VoxelGrid are computed from the TriangleMesh.

Parameters
Returns

open3d.geometry.VoxelGrid

static create_from_triangle_mesh_within_bounds(input, voxel_size, min_bound, max_bound)

Creates a VoxelGrid from a given TriangleMesh. No color information is converted. The bounds of the created VoxelGrid are defined by the given parameters

Parameters
  • input (open3d.geometry.TriangleMesh) – The input TriangleMesh

  • voxel_size (float) – Voxel size of of the VoxelGrid construction.

  • min_bound (numpy.ndarray[numpy.float64[3, 1]]) – Minimum boundary point for the VoxelGrid to create.

  • max_bound (numpy.ndarray[numpy.float64[3, 1]]) – Maximum boundary point for the VoxelGrid to create.

Returns

open3d.geometry.VoxelGrid

dimension(self)

Returns whether the geometry is 2D or 3D.

Returns

int

get_axis_aligned_bounding_box(self)

Returns an axis-aligned bounding box of the geometry.

Returns

open3d.geometry.AxisAlignedBoundingBox

get_center(self)

Returns the center of the geometry coordinates.

Returns

numpy.ndarray[numpy.float64[3, 1]]

get_geometry_type(self)

Returns one of registered geometry types.

Returns

open3d.geometry.Geometry.GeometryType

get_max_bound(self)

Returns max bounds for geometry coordinates.

Returns

numpy.ndarray[numpy.float64[3, 1]]

get_min_bound(self)

Returns min bounds for geometry coordinates.

Returns

numpy.ndarray[numpy.float64[3, 1]]

get_oriented_bounding_box(self)

Returns an oriented bounding box of the geometry.

Returns

open3d.geometry.OrientedBoundingBox

static get_rotation_matrix_from_axis_angle(rotation: numpy.ndarray[numpy.float64[3, 1]]) → numpy.ndarray[numpy.float64[3, 3]]
static get_rotation_matrix_from_quaternion(rotation: numpy.ndarray[numpy.float64[4, 1]]) → numpy.ndarray[numpy.float64[3, 3]]
static get_rotation_matrix_from_xyz(rotation: numpy.ndarray[numpy.float64[3, 1]]) → numpy.ndarray[numpy.float64[3, 3]]
static get_rotation_matrix_from_xzy(rotation: numpy.ndarray[numpy.float64[3, 1]]) → numpy.ndarray[numpy.float64[3, 3]]
static get_rotation_matrix_from_yxz(rotation: numpy.ndarray[numpy.float64[3, 1]]) → numpy.ndarray[numpy.float64[3, 3]]
static get_rotation_matrix_from_yzx(rotation: numpy.ndarray[numpy.float64[3, 1]]) → numpy.ndarray[numpy.float64[3, 3]]
static get_rotation_matrix_from_zxy(rotation: numpy.ndarray[numpy.float64[3, 1]]) → numpy.ndarray[numpy.float64[3, 3]]
static get_rotation_matrix_from_zyx(rotation: numpy.ndarray[numpy.float64[3, 1]]) → numpy.ndarray[numpy.float64[3, 3]]
get_voxel(self, point)

Returns voxel index given query point.

Parameters

point (numpy.ndarray[numpy.float64[3, 1]]) – The query point.

Returns

numpy.ndarray[numpy.int32[3, 1]]

get_voxels(self: open3d.cpu.pybind.geometry.VoxelGrid) → List[open3d.cpu.pybind.geometry.Voxel]

Returns List of Voxel: Voxels contained in voxel grid. Changes to the voxels returned from this methodare not reflected in the voxel grid.

has_colors(self)

Returns True if the voxel grid contains voxel colors.

Returns

bool

has_voxels(self)

Returns True if the voxel grid contains voxels.

Returns

bool

is_empty(self)

Returns True iff the geometry is empty.

Returns

bool

rotate(*args, **kwargs)

Overloaded function.

  1. rotate(self, R)

    Apply rotation to the geometry coordinates and normals.

Parameters

R (numpy.ndarray[numpy.float64[3, 3]]) – The rotation matrix

Returns

open3d.geometry.Geometry3D

  1. rotate(self, R, center)

    Apply rotation to the geometry coordinates and normals.

Parameters
  • R (numpy.ndarray[numpy.float64[3, 3]]) – The rotation matrix

  • center (numpy.ndarray[numpy.float64[3, 1]]) – Rotation center used for transformation.

Returns

open3d.geometry.Geometry3D

scale(*args, **kwargs)

Overloaded function.

  1. scale(self, scale, center)

    Apply scaling to the geometry coordinates.

Parameters
  • scale (float) – The scale parameter that is multiplied to the points/vertices of the geometry.

  • center (numpy.ndarray[numpy.float64[3, 1]]) – Scale center used for transformation.

Returns

open3d.geometry.Geometry3D

  1. scale(self, scale, center)

    Apply scaling to the geometry coordinates.

Parameters
  • scale (float) – The scale parameter that is multiplied to the points/vertices of the geometry.

  • center (numpy.ndarray[numpy.float64[3, 1]]) – Scale center used for transformation.

Returns

open3d.geometry.Geometry3D

to_octree(self, max_depth)

Convert to Octree.

Parameters

max_depth (int) – int: Maximum depth of the octree.

Returns

open3d.geometry.Octree

transform(self, arg0)

Apply transformation (4x4 matrix) to the geometry coordinates.

Parameters

arg0 (numpy.ndarray[numpy.float64[4, 4]]) –

Returns

open3d.geometry.Geometry3D

translate(self, translation, relative=True)

Apply translation to the geometry coordinates.

Parameters
  • translation (numpy.ndarray[numpy.float64[3, 1]]) – A 3D vector to transform the geometry

  • relative (bool, optional, default=True) – If true, the translation vector is directly added to the geometry coordinates. Otherwise, the center is moved to the translation vector.

Returns

open3d.geometry.Geometry3D

HalfEdgeTriangleMesh = <Type.HalfEdgeTriangleMesh: 7>
Image = <Type.Image: 8>
LineSet = <Type.LineSet: 4>
PointCloud = <Type.PointCloud: 1>
RGBDImage = <Type.RGBDImage: 9>
TetraMesh = <Type.TetraMesh: 10>
TriangleMesh = <Type.TriangleMesh: 6>
Unspecified = <Type.Unspecified: 0>
VoxelGrid = <Type.VoxelGrid: 2>
property origin

Coorindate of the origin point.

Type

float64 vector of length 3

property voxel_size

float64 Size of the voxel.