PointCloud.DepthImage#
- classmethod PointCloud.DepthImage(depth: Any, camera: Any, rgb: Any = None, depth_scale: float = 1.0, **kwargs: Any) PointCloud[source][source]#
Create point cloud from depth image
Creates a colored or uncolored point cloud.
- Parameters:
depth (
Image) – depth image or an RGBD image.camera (
CentralCamera) – perspective camera modelrgb (
Image, optional) – RGB image for colorizing point cloud, defaults to Nonedepth_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 – input images has wrong number of planes
The depth image is converted to a point cloud using the Open3D, and the pixel values are scaled by
depth_scale. If the depth image is a multi-plane image then theDplane is used.There are two sources of color for point colorization:
RGB planes of the depth image, if present.
rgbis an optional RGB image.
Camera intrinsics are required and provided by a
CentralCamerainstance.