CVBpy 15.1
Loading...
Searching...
No Matches
PointCloud Class Reference

A point cloud object. More...

Inherited by DensePointCloud, and SparsePointCloud.

Public Member Functions

cvb.Cuboid calculate_bounding_box (self, Optional[bool] ignore_non_confident_points)
 Calculates the minimum and maximum extent of the point cloud.
 
cvb.Cuboid calculate_bounding_box_filtered_confidence (self, Callable[[float], bool] confidencePredicate)
 Calculates the minimum and maximum extent of the point cloud using a predicate that filters points based on their confidence value.
 
cvb.Cuboid calculate_bounding_box_filtered_xyz (self, Callable[[float, float, float], bool] xyzPredicate)
 Calculates the minimum and maximum extent of the point cloud using a predicate that filters points based on their x, y, z coordinates.
 
cvb.Point3D calculate_center_of_gravity (self)
 Gets the center of gravity of the point cloud.
 
cvb.Matrix3D calculate_covariance_matrix (self)
 Get the covariance matrix of the point cloud.
 
Union[cvb.DensePointCloud, cvb.SparsePointCloudconvert (self, int flags)
 Creates a new point cloud, which is a copy from this point cloud, but with possibly different data type and number of components.
 
Union[cvb.DensePointCloud, cvb.SparsePointClouddown_sample (self, int mode, int value)
 Creates a new point cloud which has several points being removed dependent on the down sample mode and value.
 
Union[cvb.DensePointCloud, cvb.SparsePointCloudduplicate (self)
 Creates a new point cloud which is a copy from this point cloud.
 
cvb.Plane3D fit_plane (self, Optional[cvb.Cuboid] aoi)
 Fits a plane in the points of the point cloud.
 
Union[cvb.DensePointCloud, cvb.SparsePointCloudfrom_composite (cvb.Composite composite)
 Creates a point cloud from a composite.
 
cvb.SparsePointCloud matrix_transform (self, cvb.Matrix3DH matrix)
 Creates a new point cloud with all points being transformed by the given transformation.
 
cvb.Image range_map (self, cvb.NumberRange x_range, cvb.NumberRange y_range, cvb.Size2D size, float background)
 Creates a new range map image via linear projection in negative z-direction.
 
None save (self, str file_name, Optional[int] flags=cvb.PointCloudFlags.Float)
 Saves the given point cloud to the file with the given file_name.
 
Union[cvb.DensePointCloud, cvb.SparsePointCloudscale (self, Union[cvb.Factors3D, List[float]] factors)
 Creates a new point cloud with all points being scaled by the given factors.
 
cvb.SparsePointCloud transform (self, cvb.AffineMatrix3D transformation)
 Creates a new point cloud with all points being transformed by the given transformation.
 

Properties

 data_type = property
 cvb.DataType: Gets the DataType of the x, y, z(, w) components of the given PointCloud.
 
 layout = property
 int: Gets the layout of the available buffers / planes of the given point cloud (see cvb.PointCloudLayout).
 
 num_points = property
 int: Gets the number of x, y, z(, w) points in the given point cloud.
 
 plane_count = property
 int: Gets the number of planes enumerated by this object.
 
 planes = property
 List[cvb.Plane]: Gets all available planes enumerated by this object.
 

Detailed Description

A point cloud object.

At its core the point cloud is a collection of 3D points (x, y, z and optionally w).

Online Manual
3D Point Clouds
Example
CreateAndAccessCalibratedPointCloud

Member Function Documentation

◆ calculate_bounding_box()

cvb.Cuboid calculate_bounding_box ( self,
Optional[bool] ignore_non_confident_points )

Calculates the minimum and maximum extent of the point cloud.

Parameters

ignore_non_confident_points : Optional[bool] If true, points with confidence < 1 are ignored (default: true). This flag is only valid for point clouds containing a confidence plane.

Returns

cvb.Cuboid The bounding box.

◆ calculate_bounding_box_filtered_confidence()

cvb.Cuboid calculate_bounding_box_filtered_confidence ( self,
Callable[[float], bool] confidencePredicate )

Calculates the minimum and maximum extent of the point cloud using a predicate that filters points based on their confidence value.

The supplied predicate is invoked the confidence value of for each point.Points for which the predicate returns True are included in the bounding box calculation; all others are ignored.

Parameters

confidencePredicate : Callable[[float], bool] A callable receiving confidence value that returns True for points to be included in the calculated bounding box.

Returns

cvb.Cuboid The bounding box.

◆ calculate_bounding_box_filtered_xyz()

cvb.Cuboid calculate_bounding_box_filtered_xyz ( self,
Callable[[float, float, float], bool] xyzPredicate )

Calculates the minimum and maximum extent of the point cloud using a predicate that filters points based on their x, y, z coordinates.

The supplied predicate is invoked for each point x, y, z in the point cloud.Points for which the predicate returns True are included in the bounding box calculation; all others are ignored.

Parameters

xyzPredicate : Callable[[float, float, float], bool] A callable receiving x, y, z that returns True for points to be included in the calculated bounding box.

Returns

cvb.Cuboid The bounding box.

◆ calculate_center_of_gravity()

cvb.Point3D calculate_center_of_gravity ( self)

Gets the center of gravity of the point cloud.

Returns

cvb.Point3D The variable to receive the extent.

◆ calculate_covariance_matrix()

cvb.Matrix3D calculate_covariance_matrix ( self)

Get the covariance matrix of the point cloud.

Returns

cvb.Matrix3D The covariance Matrix to be filled.

◆ convert()

Union[cvb.DensePointCloud, cvb.SparsePointCloud] convert ( self,
int flags )

Creates a new point cloud, which is a copy from this point cloud, but with possibly different data type and number of components.

Parameters

flags : int Flags specifying the kind of point cloud to be created (see cvb.PointCloudFlags).

Returns

Union[cvb.DensePointCloud, cvb.SparsePointCloud] The new point cloud.

◆ down_sample()

Union[cvb.DensePointCloud, cvb.SparsePointCloud] down_sample ( self,
int mode,
int value )

Creates a new point cloud which has several points being removed dependent on the down sample mode and value.

Parameters

mode : int Downsample strategy (see cvb.DownSampleMode).

value : int Every Value-th point will be removed (must be greater than one).

Returns

Union[cvb.DensePointCloud, cvb.SparsePointCloud] The new point cloud.

◆ duplicate()

Union[cvb.DensePointCloud, cvb.SparsePointCloud] duplicate ( self)

Creates a new point cloud which is a copy from this point cloud.

Attention: The duplicated point cloud may have a different point cloud layout.

Returns

Union[cvb.DensePointCloud, cvb.SparsePointCloud] The new point cloud.

◆ fit_plane()

cvb.Plane3D fit_plane ( self,
Optional[cvb.Cuboid] aoi )

Fits a plane in the points of the point cloud.

Also fits a plane in points lying on one line, thus make sure that the points really span a plane.

Parameters

aoi : Optional[cvb.Cuboid] Bounding cuboid to extract points from; if nothing is supplied then self.calculate_bounding_box() is applied.

Returns

cvb.Plane3D Newly created Plane object fitted in the points from the point cloud.

◆ from_composite()

Union[cvb.DensePointCloud, cvb.SparsePointCloud] from_composite ( cvb.Composite composite)

Creates a point cloud from a composite.

Parameters

composite : cvb.Composite A composite to share.

Returns

Union[cvb.DensePointCloud, cvb.SparsePointCloud] An object that shares resources with the composite.

◆ matrix_transform()

cvb.SparsePointCloud matrix_transform ( self,
cvb.Matrix3DH matrix )

Creates a new point cloud with all points being transformed by the given transformation.

Note
Note, that the transformed point cloud is unorganized (sparse).

Parameters

matrix : cvb.Matrix3DH Homogeneous transformation matrix.

Returns

cvb.SparsePointCloud The new point cloud.

◆ range_map()

cvb.Image range_map ( self,
cvb.NumberRange x_range,
cvb.NumberRange y_range,
cvb.Size2D size,
float background )

Creates a new range map image via linear projection in negative z-direction.

Parameters

x_range : cvb.NumberRange Input window along the x-axis (inclusive).

y_range : cvb.NumberRange Input window along the y-axis (inclusive).

size : cvb.Size2D Target size of RangeMap in pixels (greater or equal to 2x2).

background : float Background value (initialization value for RangeMap).

Returns

cvb.Image The range map image.

◆ save()

None save ( self,
str file_name,
Optional[int] flags = cvb.PointCloudFlags.Float )

Saves the given point cloud to the file with the given file_name.

Parameters

file_name : str Complete path where to save the file to.

flags : Optional[int] Flags specifying the kind of point cloud to be created (see cvb.PointCloudFlags).

◆ scale()

Union[cvb.DensePointCloud, cvb.SparsePointCloud] scale ( self,
Union[cvb.Factors3D, List[float]] factors )

Creates a new point cloud with all points being scaled by the given factors.

Parameters

factors : Union[cvb.Factors3D, List[float]] Scale factors to be applied to each point.

Returns

Union[cvb.DensePointCloud, cvb.SparsePointCloud] The new point cloud.

◆ transform()

cvb.SparsePointCloud transform ( self,
cvb.AffineMatrix3D transformation )

Creates a new point cloud with all points being transformed by the given transformation.

Note
Note, that the transformed point cloud is unorganized (sparse).

Parameters

transformation : cvb.AffineMatrix3D 3D transformation.

Returns

cvb.SparsePointCloud The new point cloud.