Image Component Library (ICL)
|
Utility class that allows to create 3D (optionally colored) point clouds from given 2D core::depth images. More...
#include <PointCloudCreator.h>
Public Types | |
enum | DepthImageMode { DistanceToCamCenter, DistanceToCamPlane, KinectRAW11Bit } |
Representation of the given core::depth images. More... | |
Public Member Functions | |
PointCloudCreator () | |
creates a null instance | |
PointCloudCreator (const Camera &depthCam, DepthImageMode mode=DistanceToCamPlane) | |
creates a new instance with given core::depth camera (no rgbd mapping is available then) | |
PointCloudCreator (const Camera &depthCam, const Camera &colorCam, DepthImageMode mode=DistanceToCamPlane) | |
creates a new instance with given core::depth camera and color camera for rgbd mapping | |
PointCloudCreator (const PointCloudCreator &other) | |
deep copy constructor | |
PointCloudCreator & | operator= (const PointCloudCreator &other) |
deep copy assginment operator | |
~PointCloudCreator () | |
Destructor. | |
void | init (const Camera &depthCam, DepthImageMode mode=DistanceToCamPlane) |
initializes with given core::depth camera (no rgbd mapping is available then) | |
void | init (const Camera &depthCam, const Camera &colorCam, DepthImageMode mode=DistanceToCamPlane) |
initializes with given core::depth camera and color camera for rgbd mapping | |
void | create (const core::Img32f &depthImage, PointCloudObjectBase &destination, const core::Img8u *rgbImage=0, float depthScaling=1) |
creates a point cloud | |
const Camera & | getDepthCamera () const |
returns the current core::depth camera | |
const Camera & | getColorCamera () const throw (utils::ICLException) |
returns the current camera camera (if this was not given, an exception is thrown) | |
bool | hasColorCamera () const |
returns whether a color camera was given (and therefore whether RGBD-mapping is supported) | |
void | mapImage (const core::ImgBase *src, core::ImgBase **dst, const core::Img32f *depthImageMM=0) |
maps another given image just like the rgbImage would be mapped | |
void | setUseCL (bool use) |
Enables/disables openCL accelaration. | |
RGBDMapping | getMapping () const throw (utils::ICLException) |
returns the internal mapping | |
Private Attributes | |
Data * | m_data |
Utility class that allows to create 3D (optionally colored) point clouds from given 2D core::depth images.
The PointCloudCreator utility class can be used to two differenct modes. It's basic functionality is to transform a core::depth-image into a 3D point cloud. For this, a Camera instances is needed, which can be obtained from ICL's camera calibration tool icl-cam-calib-2 for real core::depth cameras such as Kinect.
If also a second camera file is provided for the color camera, then the PointCloudCreator class can also be used for mapping optionally given RGB-byte images to the contained point's colors.
For VGA point clouds, creation with RGBD mapping takes about 8ms on a 2.5 GHz Core2Duo machine. If RGBD-mapping is not performed, the simple point cloud creation is performed in about 6 ms. For futher speed optimizations, we plan to add openmp optimization in the future.
Representation of the given core::depth images.
Depth image values can either be understood as distance values to the the camera center or as distances from the camera's viewing plane
creates a null instance
icl::geom::PointCloudCreator::PointCloudCreator | ( | const Camera & | depthCam, |
DepthImageMode | mode = DistanceToCamPlane |
||
) |
creates a new instance with given core::depth camera (no rgbd mapping is available then)
icl::geom::PointCloudCreator::PointCloudCreator | ( | const Camera & | depthCam, |
const Camera & | colorCam, | ||
DepthImageMode | mode = DistanceToCamPlane |
||
) |
creates a new instance with given core::depth camera and color camera for rgbd mapping
icl::geom::PointCloudCreator::PointCloudCreator | ( | const PointCloudCreator & | other | ) |
deep copy constructor
Destructor.
void icl::geom::PointCloudCreator::create | ( | const core::Img32f & | depthImage, |
PointCloudObjectBase & | destination, | ||
const core::Img8u * | rgbImage = 0 , |
||
float | depthScaling = 1 |
||
) |
creates a point cloud
const Camera& icl::geom::PointCloudCreator::getColorCamera | ( | ) | const throw (utils::ICLException) |
returns the current camera camera (if this was not given, an exception is thrown)
const Camera& icl::geom::PointCloudCreator::getDepthCamera | ( | ) | const |
returns the current core::depth camera
RGBDMapping icl::geom::PointCloudCreator::getMapping | ( | ) | const throw (utils::ICLException) |
returns the internal mapping
Only if both- depth and camera camera parameters are available. Please note, that the returned shallowly copies the internal depth camera viewray array
bool icl::geom::PointCloudCreator::hasColorCamera | ( | ) | const |
returns whether a color camera was given (and therefore whether RGBD-mapping is supported)
void icl::geom::PointCloudCreator::init | ( | const Camera & | depthCam, |
DepthImageMode | mode = DistanceToCamPlane |
||
) |
initializes with given core::depth camera (no rgbd mapping is available then)
void icl::geom::PointCloudCreator::init | ( | const Camera & | depthCam, |
const Camera & | colorCam, | ||
DepthImageMode | mode = DistanceToCamPlane |
||
) |
initializes with given core::depth camera and color camera for rgbd mapping
void icl::geom::PointCloudCreator::mapImage | ( | const core::ImgBase * | src, |
core::ImgBase ** | dst, | ||
const core::Img32f * | depthImageMM = 0 |
||
) |
maps another given image just like the rgbImage would be mapped
src | image assumed to be captured from the perspective of the color camera |
dst | destimation image (automatically adapted) |
depthImageMM | optionally given depth image (if NULL, then the last depthImage passed to the "create"-is used, which should usually be the right one) |
PointCloudCreator& icl::geom::PointCloudCreator::operator= | ( | const PointCloudCreator & | other | ) |
deep copy assginment operator
void icl::geom::PointCloudCreator::setUseCL | ( | bool | use | ) |
Enables/disables openCL accelaration.
In case of having no opencl support, this function does nothing
Data* icl::geom::PointCloudCreator::m_data [private] |