CVB++ 14.0
PointCloudFactory Class Reference

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

#include <cvb/point_cloud_factory.hpp>

Static Public Member Functions

template<class T >
static std::shared_ptr< T > Load (const String &fileName, PointCloudFlags flags)
 Loads a 3D point, polygon or mesh file (typed). More...
 
static PointCloudPtr Load (const String &fileName, PointCloudFlags flags)
 Loads a 3D point, polygon or mesh file. More...
 
template<class T >
static std::shared_ptr< T > Create (const ImagePlane &rangeMap, const Calibrator3D &calibrator, PointCloudFlags flags)
 Creates a new Cartesian 3D point cloud from the given 2.5D range map image (typed). More...
 
static PointCloudPtr Create (const ImagePlane &rangeMap, const Calibrator3D &calibrator, PointCloudFlags flags)
 Creates a new Cartesian 3D point cloud from the given 2.5D range map image. More...
 
template<class T >
static std::shared_ptr< T > CreateWithSettings (const ImagePlane &rangeMap, const Calibrator3D &calibrator, PointCloudFlags flags, const SensorSettings &settings, double encoderStep)
 Creates a new Cartesian 3D point cloud from the given 2.5D range map image with modified camera settings. More...
 
static PointCloudPtr CreateWithSettings (const ImagePlane &rangeMap, const Calibrator3D &calibrator, PointCloudFlags flags, const SensorSettings &settings, double encoderStep)
 Creates a new Cartesian 3D point cloud from the given 2.5D range map image with modified camera settings. More...
 
static SparsePointCloudPtr CreateSparse (std::size_t numPoints, PointCloudFlags flags)
 Creates a new sparse Cartesian 3D point cloud. More...
 
static SparsePointCloudPtr CreateSparse (const std::vector< void * > &planeBasePtrs, int numPlanes, Cvb::DataType dataType, std::size_t numPoints, const std::vector< std::intptr_t > &planeIncs)
 Creates a point cloud from the given memory without copying the data. More...
 
static DensePointCloudPtr CreateDense (Size2D< int > size, PointCloudFlags flags)
 Creates a new dense Cartesian 3D point cloud. More...
 
static DensePointCloudPtr CreateDense (const Cvb::ImagePlane &rangeMap, Factors3D factors, PointCloudFlags flags)
 Creates a new Cartesian 3D point cloud from the given 2.5D range map image. More...
 

Detailed Description

Factory object for creating point cloud objects.

Member Function Documentation

◆ Create() [1/2]

static std::shared_ptr< T > Create ( const ImagePlane rangeMap,
const Calibrator3D calibrator,
PointCloudFlags  flags 
)
inlinestatic

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

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

Parameters
[in]rangeMapHandle of 2.5D image plane.
[in]calibratorCalibration object to apply.
[in]flagsPointCloudFlags specifying the kind of point cloud to be created.
Returns
A typed pointer to the point cloud.
Exceptions
Anyexception derived from std::exception including CvbException.
Examples
Cvb/CppPointCloudCreateCalibrated, Foundation/CppMetricCalibration, Foundation/CppMetricCalibrationInclinationLaserPlane, and Foundation/CppMetricCalibrationRigidBodyTrafo.

◆ Create() [2/2]

static PointCloudPtr Create ( const ImagePlane rangeMap,
const Calibrator3D calibrator,
PointCloudFlags  flags 
)
inlinestatic

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

Note
Creating a calibrated point cloud, the camera settings applied during the acquisition of the range map have to be known. Default settings are read from the calibrator loaded from a calibration file. If the actual settings differ from the default ones, the user has to set them and create a calibrated point cloud with function CreateWithSettings().
Parameters
[in]rangeMapHandle of 2.5D image plane.
[in]calibratorCalibration object to apply.
[in]flagsFlags specifying the kind of point cloud to be created.
Returns
A pointer to the point cloud.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ CreateDense() [1/2]

static DensePointCloudPtr CreateDense ( const Cvb::ImagePlane rangeMap,
Factors3D  factors,
PointCloudFlags  flags 
)
inlinestatic

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

Parameters
[in]rangeMap2.5D image plane.
[in]factorsFactors to apply.
[in]flagsSpecifying the kind of point cloud to be created.
Returns
The size as number of columns and number of rows.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ CreateDense() [2/2]

static DensePointCloudPtr CreateDense ( Size2D< int >  size,
PointCloudFlags  flags 
)
inlinestatic

Creates a new dense Cartesian 3D point cloud.

The resulting point cloud will always have a contiguous point array. Creating the point cloud with 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
[in]sizeNumber of Cartesian X, Y, Z(, W) points on the x/y-component of the lattice.
[in]flagsSpecifying the kind of point cloud to be created.
Returns
The variable to receive the handle of the point cloud object.
Exceptions
Anyexception derived from std::exception including CvbException.
Examples
Cvb/CppPointCloudCreateAndHandle.

◆ CreateSparse() [1/2]

static SparsePointCloudPtr CreateSparse ( const std::vector< void * > &  planeBasePtrs,
int  numPlanes,
Cvb::DataType  dataType,
std::size_t  numPoints,
const std::vector< std::intptr_t > &  planeIncs 
)
inlinestatic

Creates a point cloud from the given memory without copying the data.

Parameters
[in]planeBasePtrsBase pointers of the X, Y, Z and optionally W component planes.
[in]numPlanesNumber of pPlaneBasePtrs.
[in]dataTypeData type of the pPlaneBasePtrs.
[in]numPointsNumber of elements in each plane.
[in]planeIncsOffset to the next component in the respective plane in bytes.
Returns
The variable to receive the handle of the point cloud object.
Exceptions
Anyexception derived from std::exception including CvbException.

Currently only single precision (float) data type is supported. Also currently number of planes must be 3.

◆ CreateSparse() [2/2]

static SparsePointCloudPtr CreateSparse ( std::size_t  numPoints,
PointCloudFlags  flags 
)
inlinestatic

Creates a new sparse Cartesian 3D point cloud.

The resulting point cloud will always have a contiguous point array. Creating the point cloud with 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
[in]numPointsNumber of Cartesian X, Y, Z(, W) points.
[in]flagsSpecifying the kind of point cloud to be created.
Returns
The variable to receive the handle of the point cloud object.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ CreateWithSettings() [1/2]

static std::shared_ptr< T > CreateWithSettings ( const ImagePlane rangeMap,
const Calibrator3D calibrator,
PointCloudFlags  flags,
const SensorSettings settings,
double  encoderStep 
)
inlinestatic

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.

Parameters
[in]rangeMapHandle of 2.5D image plane.
[in]calibratorCalibration object to apply.
[in]flagsFlags specifying the kind of point cloud to be created.
[in]settingsSensor settings applied during the acquisition of the range map.
[in]encoderStepEncoder step.
Returns
A typed pointer to the point cloud.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ CreateWithSettings() [2/2]

static PointCloudPtr CreateWithSettings ( const ImagePlane rangeMap,
const Calibrator3D calibrator,
PointCloudFlags  flags,
const SensorSettings settings,
double  encoderStep 
)
inlinestatic

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

Creating a calibrated point cloud, the camera settings applied during the acquisition of the range map have to be known. Default settings are read from the calibrator loaded from a calibration file. If the actual settings differ from the default ones, the user has to set them and create a calibrated point cloud via function this function. You can get and check the default settings from the LaserPlaneCalibrator3D object. The default encoder step can also be get from the calibrator via function YFactor().

Parameters
[in]rangeMapHandle of 2.5D image plane.
[in]calibratorCalibration object to apply.
[in]flagsFlags specifying the kind of point cloud to be created.
[in]settingsSensor settings applied during the acquisition of the range map.
[in]encoderStepEncoder step.
Returns
A pointer to the point cloud.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Load() [1/2]

static std::shared_ptr< T > Load ( const String fileName,
PointCloudFlags  flags 
)
inlinestatic

Loads a 3D point, polygon or mesh file (typed).

Parameters
[in]fileNameFull path to the file to load.
[in]flagsPointCloudFlags specifying the kind of point cloud to be created.
Returns
A typed pointer to the point cloud.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Load() [2/2]

static PointCloudPtr Load ( const String fileName,
PointCloudFlags  flags 
)
inlinestatic

Loads a 3D point, polygon or mesh file.

Parameters
[in]fileNameComplete path to the file to load.
[in]flagsFlags specifying the kind of point cloud to be created.
Returns
A pointer to the point cloud.
Exceptions
Anyexception derived from std::exception including CvbException.