PointCloud object#
The PointCloud class is essential for all
point cloud operations and processing within this Toolbox. It wraps an
Open3D point cloud, which can hold the
point coordinates and, optionally, their colors and surface normals.
Open3D is an open-source library that supports rapid development of software that deals with 3D data. The Open3D frontend exposes a set of carefully selected data structures and algorithms in both C++ and Python. The backend is highly optimized and is set up for parallelization.
The PointCloud class provides a subset of commonly used methods but does not
attempt to wrap every Open3D method. Instead, any method or property not known to the
PointCloud class, such as pc.some_method(), falls through to the native Open3D
method some_method() on the encapsulated Open3D object, and all parameters are
passed through. If the return value is an Open3D point cloud, or a tuple that contains
one, it is wrapped and returned as a PointCloud instance. A name that neither class
knows raises AttributeError.
Note
Open3D uses NumPy arrays in which points are rows. This is different to the
Toolbox convention of points as columns. The Toolbox wrappers handle this
transposition, but anything that falls through to Open3D, or that is reached through
pcd, uses the Open3D convention.
- class PointCloud(arg: Any, depth_scale: float = 1.0, **kwargs)[source][source]#
A set of 3D points, optionally with colors and surface normals
A thin wrapper around an Open3D
open3d.geometry.PointCloudthat keeps the Toolbox conventions: points, colors and normals are 3xN arrays with one point per column. Methods that Open3D provides and that are not wrapped here are forwarded to it. See the constructor for the ways to create a point cloud.See also
Create new point cloud object
- Parameters:
arg (
o3d.geometry.PointCloud,PointCloud, ndarray(3,N)) – point cloud data as an Open3D or MVTB PointCloud object, 3xN array of points.depth_scale (float, optional) – depth scale factor, defaults to 1.0
- Raises:
RuntimeError – PointCloud class requires Open3D to be installed: pip install open3d or pip install machinevision-toolbox-python[open3d]
ValueError – bad arguments
This object wraps an Open3D
open3d.geometry.PointCloudobject. It can be created from:an Open3D point cloud object
a 3xN array of point coordinates
a depth image as a 1-plane
Imageinstancean RGBD image as a 4-plane
Imageinstancea tuple of two images (RGB, D) as 3-plane and 1-plane
Imageinstances
Warning
Open3D must be installed.
The wrapped Open3D
open3d.geometry.PointCloudobject has many methods and properties but rather than writing individual wrappers the__getattr__picks up these references and invokes them on the underlying Open3D object. Any returned Open3D point cloud objects are converted to aPointCloudinstance.See also
__getattr__open3d.geometry.PointCloudImageCentralCamera- __init__(arg: Any, depth_scale: float = 1.0, **kwargs) None[source][source]#
Create new point cloud object
- Parameters:
arg (
o3d.geometry.PointCloud,PointCloud, ndarray(3,N)) – point cloud data as an Open3D or MVTB PointCloud object, 3xN array of points.depth_scale (float, optional) – depth scale factor, defaults to 1.0
- Raises:
RuntimeError – PointCloud class requires Open3D to be installed: pip install open3d or pip install machinevision-toolbox-python[open3d]
ValueError – bad arguments
This object wraps an Open3D
open3d.geometry.PointCloudobject. It can be created from:an Open3D point cloud object
a 3xN array of point coordinates
a depth image as a 1-plane
Imageinstancean RGBD image as a 4-plane
Imageinstancea tuple of two images (RGB, D) as 3-plane and 1-plane
Imageinstances
Warning
Open3D must be installed.
The wrapped Open3D
open3d.geometry.PointCloudobject has many methods and properties but rather than writing individual wrappers the__getattr__picks up these references and invokes them on the underlying Open3D object. Any returned Open3D point cloud objects are converted to aPointCloudinstance.See also
__getattr__open3d.geometry.PointCloudImageCentralCamera
Informational#
Access to point cloud data#
Point cloud i/o#
Create point cloud from file |
|
Create point cloud from depth image |
|
Write point cloud to file |
|
Display point cloud using Open3D |
Point cloud operations#
Copy point cloud |
|
Transform point cloud |
|
Downsample point cloud by voxelization |
|
Downsample point cloud by random selection |
|
Voxelize point cloud |
|
Estimate point normals |
|
Get point normal data as array |
|
Remove point cloud outliers |
|
Find the dominant plane using RANSAC |
|
Select points by index |
|
Colorize point cloud |
|
Remove the colors from a point cloud |
|
Join point clouds |
|
Register point cloud using ICP |
|
Access Open3D PointCloud methods and attributes |