IDS peak ICV v1.4.0
Loading...
Searching...
No Matches
PointCloud Class Reference

Public Member Functions

PointCloud create_from_xyz_image (cls, XYZImage xyz_image, Union[Image, ids_peak_ipl.Image, None] overlay_image=None, Union[Image, ids_peak_ipl.Image, None] intensity_image=None)
 Creates a point cloud from a xyz image and optional metadata.
 
PointCloud create_from_undistorted_depth_map (cls, UndistortedImage undistorted_depth_map, Union[Image, ids_peak_ipl.Image, None] overlay_image=None, Union[Image, ids_peak_ipl.Image, None] intensity_image=None)
 Creates a point cloud from an undistorted depth map and optional metadata.
 
PointCloud create_from_points (cls, Union[XYZArray, XYZIArray, XYZRGBArray] points, PointCloudPointType point_type)
 Creates a point cloud from points.
 
PointCloud create_from_file (cls, str file_path, PointCloudPointType point_type=PointCloudPointType.XYZ)
 Loads a point cloud from a file.
 
None __init__ (self, *Any args, **Any kwargs)
 In order to create a point cloud, please refer to the class methods.
 
PointCloud transform (self, npt.NDArray matrix)
 Applies a transformation of a point cloud based on the given matrix.
 
PointCloud transform_to_workspace (self, ExtrinsicParameters extrinsic_parameters)
 Transforms a point cloud to the workspace coordinate system using the extrinsic parameters.
 
Union[XYZArray, XYZIArray, XYZRGBArray] points (self)
 Get the points of the point cloud.
 
bool __eq__ (self, object other)
 Check if two point clouds are equal.
 
bool __ne__ (self, object other)
 Check if two point clouds are not equal.
 
None __del__ (self)
 
str __repr__ (self)
 Get a string representation of the Point Cloud represented by points.
 
None save (self, str file_path)
 Saves point cloud to file.
 

Data Fields

 points
 
list _sorted_points_cache = [PointXYZ(p[0], p[1], p[2]) for p in other]
 

Protected Member Functions

None _init_points (self, Type[ctypes.Structure] c_type, Type python_type, Callable[[ctypes.Array], Iterable[Any]] func)
 
None _init_point_type (self)
 

Protected Attributes

 _handle = None
 
np.ndarray|None _sorted_points_cache = None
 
np.ndarray|None _points = None
 
 _point_type = None
 

Detailed Description

A point cloud is a set of data points defined in a three-dimensional (3D) coordinate system.

Each point is represented by its X, Y, and Z coordinates, specifying its exact position in 3D space. Optionally it can contain intensity metadata. Point clouds are often generated from depth maps, such as those obtained from a time-of-flight camera. They serve as a detailed digital representation of the shape and size of physical objects, enabling precise measurements and analysis.

Since
ids_peak_icv 1.1

Constructor & Destructor Documentation

◆ __init__()

None __init__ ( self,
*Any args,
**Any kwargs )

In order to create a point cloud, please refer to the class methods.

Since
ids_peak_icv 1.1

◆ __del__()

None __del__ ( self)

Member Function Documentation

◆ __eq__()

bool __eq__ ( self,
object other )

Check if two point clouds are equal.

Parameters
otherAnother point cloud object
Returns
True if point clouds are equal, False otherwise
Since
ids_peak_icv 1.1

◆ __ne__()

bool __ne__ ( self,
object other )

Check if two point clouds are not equal.

Parameters
otherAnother point cloud object
Returns
True if point clouds are not equal, False otherwise
Since
ids_peak_icv 1.1

◆ __repr__()

str __repr__ ( self)

Get a string representation of the Point Cloud represented by points.

Returns
String representation of the Point Cloud
Since
ids_peak_icv 1.1

◆ _init_point_type()

None _init_point_type ( self)
protected

◆ _init_points()

None _init_points ( self,
Type[ctypes.Structure] c_type,
Type python_type,
Callable[[ctypes.Array], Iterable[Any]] func )
protected

◆ create_from_file()

PointCloud create_from_file ( cls,
str file_path,
PointCloudPointType point_type = PointCloudPointType.XYZ )

Loads a point cloud from a file.

The chosen file type is determined by the given extension.

The following file formats are supported:

  • [PLY]
Parameters
file_pathThe file is loaded from the file path, which should encompass both the directory path and the filename.
point_typeDefines whether the point cloud is loaded with or without meta information and how the meta information is interpreted.
Returns
The point cloud, which was loaded from the file.
Exceptions
IOExceptionIf the specified file path is invalid, you lack the necessary permissions, or the file already exists.
Since
ids_peak_icv 1.1

◆ create_from_points()

PointCloud create_from_points ( cls,
Union[XYZArray, XYZIArray, XYZRGBArray] points,
PointCloudPointType point_type )

Creates a point cloud from points.

Parameters
pointsAn array of PointXYZ or PointXYZI.
point_typeThe type of point.
Returns
Created point cloud instance
Exceptions
MismatchExceptionIf Parameter points is not a numpy array of PointXYZ or PointXYZI objects matching the point_type.
Since
ids_peak_icv 1.1

◆ create_from_undistorted_depth_map()

PointCloud create_from_undistorted_depth_map ( cls,
UndistortedImage undistorted_depth_map,
Union[Image, ids_peak_ipl.Image, None] overlay_image = None,
Union[ Image, ids_peak_ipl.Image, None] intensity_image = None )

Creates a point cloud from an undistorted depth map and optional metadata.

Note
The region of the metadata image is disregarded.
Parameters
undistorted_depth_mapUndistorted image providing the radial depth information.
overlay_imageImage that holds the meta information (e.g. an intensity image).
intensity_imageImage that holds the meta information (e.g. an intensity image). This parameter is deprecated. Use overlay_image instead.
Returns
Created point cloud instance
Exceptions
MismatchExceptionIf the undistorted_depth_map and the intensity image don't have the same size.
Since
ids_peak_icv 1.1

◆ create_from_xyz_image()

PointCloud create_from_xyz_image ( cls,
XYZImage xyz_image,
Union[Image, ids_peak_ipl.Image, None] overlay_image = None,
Union[Image, ids_peak_ipl.Image, None] intensity_image = None )

Creates a point cloud from a xyz image and optional metadata.

Note
The region of the metadata image is disregarded.
Parameters
xyz_imageXYZ image providing the spatial information.
overlay_imageImage that holds the meta information (e.g. an intensity image).
intensity_imageImage that holds the meta information (e.g. an intensity image). This parameter is deprecated. Use overlay_image instead.
Returns
Created point cloud instance
Exceptions
MismatchExceptionIf the xyz_image and the intensity image don't have the same size.
Since
ids_peak_icv 1.1

◆ points()

Union[XYZArray, XYZIArray, XYZRGBArray] points ( self)

Get the points of the point cloud.

Returns
List of Point objects representing the point clouds points.
Since
ids_peak_icv 1.1

◆ save()

None save ( self,
str file_path )

Saves point cloud to file.

The chosen file type is determined by the given extension.

The following file formats are supported:

  • [PLY](only binary)

If no file extension is provided, .ply is automatically added.

Note
If a point cloud does not contain any points it cannot be written to file.
Parameters
file_pathThe file is saved to the file_path, which should encompass both the directory path and the filename.
Exceptions
IOExceptionIf the specified file path is invalid or lacks write permissions.
NotSupportedExceptionIf the specified file extension or point type is not supported or the point cloud is empty.
Since
ids_peak_icv 1.1

◆ transform()

PointCloud transform ( self,
npt.NDArray matrix )

Applies a transformation of a point cloud based on the given matrix.

Parameters
matrixThe transformation matrix
Returns
A new transformed point cloud.
Exceptions
NotPossibleExceptionIf the dtype of numpy array isn't type float32 or the matrix size isn't 4x4.
Since
ids_peak_icv 1.1

◆ transform_to_workspace()

PointCloud transform_to_workspace ( self,
ExtrinsicParameters extrinsic_parameters )

Transforms a point cloud to the workspace coordinate system using the extrinsic parameters.

The point cloud is transformed from the camera coordinate system to the workspace coordinate system using the inverse of the extrinsic parameters.

Parameters
extrinsic_parametersExtrinsic parameters of the workspace calibration.
Returns
A new transformed point cloud.
Since
ids_peak_icv 1.1

Field Documentation

◆ _handle

_handle = None
protected

◆ _point_type

_point_type = None
protected

◆ _points

_points = None
protected

◆ _sorted_points_cache [1/2]

_sorted_points_cache = None
protected

◆ _sorted_points_cache [2/2]

list _sorted_points_cache = [PointXYZ(p[0], p[1], p[2]) for p in other]

◆ points

points