CVBpy 15.0
PointCloudFactory Class Reference

Factory object for creating point cloud objects. More...

Inherits object.

Public Member Functions

Union[cvb.PointCloud, cvb.DensePointCloud, cvb.SparsePointCloudcreate (cvb.ImagePlane range_map, cvb.Calibrator3D calibrator, int flags, Union[Type[cvb.PointCloud|cvb.DensePointCloud|cvb.SparsePointCloud]] point_cloud_type=DensePointCloud)
 Creates a new Cartesian 3D point cloud from the given 2.5D range map image. More...
 
cvb.DensePointCloud create_dense (cvb.ImagePlane range_map, cvb.Calibrator3D calibrator, int flags)
 Creates a new dense Cartesian 3D point cloud from the given 2.5D range map image. More...
 
cvb.DensePointCloud create_dense_from_range_map (cvb.ImagePlane range_map, Union[cvb.Factors3D, List[float]] factors, int flags)
 Creates a new Cartesian 3D point cloud from the given 2.5D range map image. More...
 
cvb.DensePointCloud create_dense_from_size (cvb.Size2D size, int flags)
 Creates a new dense Cartesian 3D point cloud. More...
 
cvb.SparsePointCloud create_sparse (int num_points, int flags)
 Creates a new sparse Cartesian 3D point cloud. More...
 
cvb.SparsePointCloud create_sparse_from_buffer (Any buffer, int layout=PointCloudLayout.Interleaved)
 Creates a new sparse Cartesian 3D point cloud from a python buffer. More...
 
Union[cvb.DensePointCloud, cvb.SparsePointCloudcreate_with_settings (cvb.ImagePlane range_map, cvb.Calibrator3D calibrator, int flags, cvb.SensorSettings settings, float encoder_step, Optional[Type[cvb.DensePointCloud|cvb.SparsePointCloud]] point_cloud_type=DensePointCloud)
 Creates a new Cartesian 3D point cloud from the given 2.5D range map image with modified camera settings. More...
 
Union[cvb.DensePointCloud, cvb.SparsePointCloudload (str file_name, int flags)
 Loads a 3D point, polygon or mesh file. More...
 

Detailed Description

Factory object for creating point cloud objects.

Member Function Documentation

◆ create()

Union[cvb.PointCloud, cvb.DensePointCloud, cvb.SparsePointCloud] create ( cvb.ImagePlane  range_map,
cvb.Calibrator3D  calibrator,
int  flags,
Union[Type[cvb.PointCloud| cvb.DensePointCloud| cvb.SparsePointCloud]]   point_cloud_type = DensePointCloud 
)

Creates a new Cartesian 3D point cloud from the given 2.5D range map image.

Depending on the calibration method the resulting point cloud is a DensePointCloud or a SparsePointCloud. This function will convert the cloud to the given type.

Note, that if the original output point cloud is dense, the confidence layer is always available. Background range map pixels are set non-confident. In case of a sparse point cloud, points representing background values and also the confidence layer are removed (except the user explicitly wants to keep the confidence layer which can be requested via the point cloud flags).

Only range maps with floating point and unsigned integer DataType values are supported. For unsigned integer data types, the following DataType.bytes_per_pixel values are supported: 1, 2 and 4.

Parameters

range_map : cvb.ImagePlane Handle of 2.5D image.

calibrator : cvb.Calibrator3D Calibration object to apply.

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

point_cloud_type : Union[Type[cvb.PointCloud| cvb.DensePointCloud| cvb.SparsePointCloud]] The point cloud type of the object to be returned.

Returns

Union[cvb.PointCloud, cvb.DensePointCloud, cvb.SparsePointCloud] A typed point cloud based on the given point_cloud_type.

◆ create_dense()

cvb.DensePointCloud create_dense ( cvb.ImagePlane  range_map,
cvb.Calibrator3D  calibrator,
int  flags 
)

Creates a new dense Cartesian 3D point cloud from the given 2.5D range map image.

Depending on the calibration method the resulting point cloud is a DensePointCloud or a SparsePointCloud. This function will convert sparse point clouds to dense.

Note, that if the original output point cloud is dense, the confidence layer is always available. Background range map pixels are set non-confident. In case of a sparse point cloud, points representing background values and also the confidence layer are removed (except the user explicitly wants to keep the confidence layer which can be requested via the point cloud flags).

Only range maps with floating point and unsigned integer DataType values are supported. For unsigned integer data types, the following DataType.bytes_per_pixel values are supported: 1, 2 and 4.

Parameters

range_map : cvb.ImagePlane Handle of 2.5D image.

calibrator : cvb.Calibrator3D Calibration object to apply.

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

Returns

cvb.DensePointCloud A point cloud object.

Notes

This function is not recommended for calibrators containing an Affine matrix (which can be checked with LaserPlaneCalibrator3D.correction_of_laser_plane_inclination and Calibrator3D.extrinsic_matrix)! In this case the calibrated point cloud would actually be a SparsePointCloud. The point cloud will be automatically converted with function SparsePointCloud.to_dense_point_cloud then. Be aware, that point clouds created with SparsePointCloud.to_dense_point_cloud might have gaps!

◆ create_dense_from_range_map()

cvb.DensePointCloud create_dense_from_range_map ( cvb.ImagePlane  range_map,
Union[cvb.Factors3D, List[float]]  factors,
int  flags 
)

Creates a new Cartesian 3D point cloud from the given 2.5D range map image.

Only range maps with floating point and unsigned integer DataType values are supported. For unsigned integer data types, the following DataType.bytes_per_pixel values are supported: 1, 2 and 4.

Parameters

range_map : cvb.ImagePlane 2.5D image.

factors : Union[cvb.Factors3D, List[float]] Factors to apply.

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

Returns

cvb.DensePointCloud A dense point cloud object.

◆ create_dense_from_size()

cvb.DensePointCloud create_dense_from_size ( cvb.Size2D  size,
int  flags 
)

Creates a new dense Cartesian 3D point cloud.

The resulting point cloud will always have a contiguous point array. Creating the point cloud with PointCloudFlags.XYZConfidence will provide interleaved XYZConfidence(PointCloudLayout will be Linear), whereas creating it with PointCloudFlags.WithConfidence, only XYZ will be interleaved but not the confidence plane(PointCloudLayout will be Interleaved).

Parameters

size : cvb.Size2D Number of Cartesian X, Y, Z(, W) points on the x/y-component of the lattice.

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

Returns

cvb.DensePointCloud A dense point cloud object.

◆ create_sparse()

cvb.SparsePointCloud create_sparse ( int  num_points,
int  flags 
)

Creates a new sparse Cartesian 3D point cloud.

The resulting point cloud will always have a contiguous point array. Creating the point cloud with PointCloudFlags.XYZConfidence will provide interleaved XYZConfidence(PointCloudLayout will be Linear), whereas creating it with PointCloudFlags.WithConfidence, only XYZ will be interleaved but not the confidence plane(PointCloudLayout will be Interleaved).

Parameters

num_points : int Number of Cartesian X, Y, Z(, W) points.

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

Returns

cvb.SparsePointCloud A sparse point cloud object.

◆ create_sparse_from_buffer()

cvb.SparsePointCloud create_sparse_from_buffer ( Any  buffer,
int   layout = PointCloudLayout.Interleaved 
)

Creates a new sparse Cartesian 3D point cloud from a python buffer.

Currently only single precision (float) data type is supported. Also currently number of planes must be 3. The input buffer will not be copied. You need to take care of its lifetime!

Parameters

buffer : Any Python buffer that supports the buffer protocol.

layout : int A point cloud point layout (see PointCloudLayout).

Returns

cvb.SparsePointCloud A sparse point cloud object.

◆ create_with_settings()

Union[cvb.DensePointCloud, cvb.SparsePointCloud] create_with_settings ( cvb.ImagePlane  range_map,
cvb.Calibrator3D  calibrator,
int  flags,
cvb.SensorSettings  settings,
float  encoder_step,
Optional[Type[cvb.DensePointCloud| cvb.SparsePointCloud]]   point_cloud_type = DensePointCloud 
)

Creates a new Cartesian 3D point cloud from the given 2.5D range map image with modified camera settings.

The point cloud will automatically be converted to the given type.

Note, that the calibration parameters always refer to the whole sensor (with no mirroring of the pixel coordinates). If the camera settings indicate, that a sensor ROI is given or pixel coordinates are mirrored, the range map values will be transformed to the sensor coordinates before applying the calibration parameters. If the user acquires the range map to be calibrated and uses sensor settings different from the default ones, he has to set them correctly via this function.

If you only like to change one or two settings and do not want to care about the other parameters, you can get the default settings via LaserPlaneCalibrator3D.sensor_settings, change the relevant settings within the struct and pass it to PointCloudFactory.create_with_settings.

If you have not changed your camera settings, please use function PointCloudFactory.create. A detailed documentation about the point cloud creation can also be found there.

Note, that if the original output point cloud is dense, the confidence layer is always available. Background range map pixels are set non - confident. In case of a sparse point cloud, points representing background values and also the confidence layer are removed (except the user explicitly wants to keep the confidence layer which can be requested via the point cloud flags).

Only range maps with floating point and unsigned integer DataType values are supported. For unsigned integer data types, the following DataType.bytes_per_pixel values are supported: 1, 2 and 4.

Parameters

range_map : cvb.ImagePlane Handle of 2.5D image plane.

calibrator : cvb.Calibrator3D Calibration object to apply.

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

settings : cvb.SensorSettings Sensor settings applied during the acquisition of the range map.

encoder_step : float Encoder step.

point_cloud_type : Optional[Type[cvb.DensePointCloud| cvb.SparsePointCloud]] The point cloud type of the object to be returned.

Returns

Union[cvb.DensePointCloud, cvb.SparsePointCloud] A typed point cloud based on the given point_cloud_type.

◆ load()

Union[cvb.DensePointCloud, cvb.SparsePointCloud] load ( str  file_name,
int  flags 
)

Loads a 3D point, polygon or mesh file.

Parameters

file_name : str Complete path to the file to load.

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

Returns

Union[cvb.DensePointCloud, cvb.SparsePointCloud] A point cloud object.