Image Component Library (ICL)
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
icl::geom::DepthCameraPointCloudGrabber Class Reference

PointCloudGrabber implementation for 2D core::depth-image based creation of point clouds. More...

#include <DepthCameraPointCloudGrabber.h>

Inheritance diagram for icl::geom::DepthCameraPointCloudGrabber:
icl::geom::PointCloudGrabber icl::utils::Configurable

Public Member Functions

 DepthCameraPointCloudGrabber (const Camera &depthCam=get_default_depth_cam(), const Camera &colorCam=get_null_color_cam(), const std::string &depthDeviceType="kinectd", const std::string &depthDeviceID="0", const std::string &colorDeviceType="kinectc", const std::string &colorDeviceID="0", bool needsKinectRawDepthInput=false)
 constructor with a set of given parameters More...
 
 ~DepthCameraPointCloudGrabber ()
 Destructor. More...
 
void setColorImageMask (const core::Img8u *mask, bool passOwnerShip=true)
 sets a mask, that is applied to the color image before creatig the point cloud More...
 
void setDepthImageMask (const core::Img8u *mask, bool passOwnerShip=true)
 sets a mask, that is applied to the depth image before creatig the point cloud More...
 
virtual void grab (PointCloudObjectBase &dst)
 virtual grab implementation More...
 
const core::Img32fgetLastDepthImage () const
 returns the last grabbed core::depth image More...
 
const core::Img8ugetLastColorImage () const
 returns the last grabbed color image More...
 
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 More...
 
void setUseCL (bool enable)
 defines whether opencl is to be used More...
 
PointCloudCreatorgetCreator ()
 returns the internal point cloud creator instance More...
 
const PointCloudCreatorgetCreator () const
 returns the internal point cloud creator instance (const) More...
 
RGBDMapping getMapping () const
 returns the internal RGBDMapping More...
 
void reinit (const std::string &description)
 reinitisize the backend (here, only new camera parameters can be given) More...
 
virtual const core::Img32fgetDepthImage () const
 returns the last grabbed point cloud's underlying depth image More...
 
virtual const core::Img8ugetColorImage () const
 returns the last grabbed point cloud's underlying color image (if available) More...
 
virtual Camera getDepthCamera () const
 returns current depth camera More...
 
virtual Camera getColorCamera () const
 returns current color camera More...
 
virtual void setCameraWorldFrame (const math::FixedMatrix< float, 4, 4 > &T)
 sets up the cameras world frame More...
 
- Public Member Functions inherited from icl::geom::PointCloudGrabber
virtual ~PointCloudGrabber ()
 virtual, but empty destructor More...
 
- Public Member Functions inherited from icl::utils::Configurable
virtual ~Configurable ()
 virtual destructor More...
 
 Configurable (const Configurable &other)
 Copy constructor. More...
 
Configurableoperator= (const Configurable &other)
 Assignment operator. More...
 
void setConfigurableID (const std::string &ID)
 sets the ID of this configurable More...
 
const std::string & getConfigurableID () const
 returns the configurables static ID More...
 
bool isOrderedFlagSet () const
 returns whether the ordered flag is set More...
 
void deactivateProperty (const std::string &pattern)
 adds an additional deativation pattern More...
 
void deleteDeactivationPattern (const std::string &pattern)
 removed a formerly added deactivation pattern More...
 
std::vector< std::string > getPropertyListWithoutDeactivated () const
 this returns a filtered list of properties (using all filters added by deactivateProperty) More...
 
virtual void adaptProperty (const std::string &name, const std::string &newType, const std::string &newInfo, const std::string &newToolTip)
 this function can be used to adapt a specific property afterwards More...
 
void registerCallback (const Callback &cb)
 add a callback for changed properties More...
 
void removedCallback (const Callback &cb)
 removes a callback that was registered before More...
 
void syncChangesTo (Configurable *others, int num=1)
 this can be used to let this instance also apply property changes to others More...
 
virtual void setPropertyValue (const std::string &propertyName, const Any &value)
 sets a property value More...
 
virtual std::vector< std::string > getPropertyList () const
 returns a list of All properties, that can be set using setProperty More...
 
virtual bool supportsProperty (const std::string &propertyName) const
 base implementation for property check (seaches in the property list) More...
 
virtual void saveProperties (const std::string &filename, const std::vector< std::string > &propertiesToSkip=EMPTY_VEC) const
 writes all available properties into a file More...
 
virtual void loadProperties (const std::string &filename, const std::vector< std::string > &propertiesToSkip=EMPTY_VEC)
 reads a camera config file from disc More...
 
virtual std::string getPropertyType (const std::string &propertyName) const
 get type of property More...
 
virtual std::string getPropertyInfo (const std::string &propertyName) const
 get information of a properties valid values More...
 
virtual Any getPropertyValue (const std::string &propertyName) const
 returns the current value of a property or a parameter More...
 
virtual std::string getPropertyToolTip (const std::string &propertyName) const
 returns the tooltip description for a given property More...
 
virtual int getPropertyVolatileness (const std::string &propertyName) const
 Returns whether this property may be changed internally. More...
 

Static Public Member Functions

static const Cameraget_default_depth_cam ()
 creates the defautl VGA core::depth camera More...
 
static const Cameraget_null_color_cam ()
 creates the defautl null color camera More...
 
- Static Public Member Functions inherited from icl::utils::Configurable
static std::string create_default_ID (const std::string &prefix)
 this function can be used in subclasses to create a default ID More...
 
static Configurableget (const std::string &id)
 returns configurable by given ID More...
 
static void register_configurable_type (const std::string &classname, Function< Configurable * > creator)
 registers a configurable type More...
 
static std::vector< std::string > get_registered_configurables ()
 returns a list of all registered configurable classnames More...
 
static Configurablecreate_configurable (const std::string &classname)
 creates a configurable by given name More...
 

Private Attributes

Data * m_data
 pimpl type More...
 

Additional Inherited Members

- Public Types inherited from icl::utils::Configurable
typedef Function< void, const Property & > Callback
 Function type for changed properties. More...
 
- Static Public Attributes inherited from icl::utils::Configurable
static const std::vector< std::string > EMPTY_VEC
 used as shortcut – just an empty vector of std::strings More...
 
- Protected Member Functions inherited from icl::utils::Configurable
void addProperty (const std::string &name, const std::string &type, const std::string &info, const Any &value=Any(), const int volatileness=0, const std::string &tooltip=std::string())
 This can be used by derived classes to store supported properties in the internal list. More...
 
void addChildConfigurable (Configurable *configurable, const std::string &childPrefix="")
 This adds another configurable as child. More...
 
void removeChildConfigurable (Configurable *configurable)
 removes the given child configurable More...
 
Propertyprop (const std::string &propertyName)
 this CAN be used e.g. to store a property value in internal property-list More...
 
const Propertyprop (const std::string &propertyName) const
 this CAN be used e.g. to store a property value in internal property-list More...
 
 Configurable (const std::string &ID="", bool ordered=true)
 create this configurable with given ID More...
 
void call_callbacks (const std::string &propertyName, const Configurable *caller) const
 calls all registered callbacks More...
 
- Protected Attributes inherited from icl::utils::Configurable
std::vector< Callbackcallbacks
 internally managed list of callbacks More...
 

Detailed Description

PointCloudGrabber implementation for 2D core::depth-image based creation of point clouds.

This Grabber implementation can be used for all point-cloud sources, where the point cloud must still be created from a given core::depth images. Internally an instance of PointCloudCreator is used.

Constructor & Destructor Documentation

◆ DepthCameraPointCloudGrabber()

icl::geom::DepthCameraPointCloudGrabber::DepthCameraPointCloudGrabber ( const Camera depthCam = get_default_depth_cam(),
const Camera colorCam = get_null_color_cam(),
const std::string &  depthDeviceType = "kinectd",
const std::string &  depthDeviceID = "0",
const std::string &  colorDeviceType = "kinectc",
const std::string &  colorDeviceID = "0",
bool  needsKinectRawDepthInput = false 
)

constructor with a set of given parameters

Parameters
depthCamcore::depth camera parameters (if nothing is passed, a simple VGA camera is used automatically)
colorCamcolor camera parameters. If get_null_color_cam() is passed, then no color camera information will be available, no color images will be grabbed and only xyz point cloud data is created (all other fiels are just left untouched)
depthDeviceType,depthDeviceIDdevice type (e.g. kinectd for Kinect source of file filepattern for using a list of source files that contained core::depth images) Analogously for colorDeviceType and colorDeviceID, however the latter two are ignored if not colorCam was passed.
colorDeviceType,colorDeviceID(See depthDeviceType and depthDeviceID)

◆ ~DepthCameraPointCloudGrabber()

icl::geom::DepthCameraPointCloudGrabber::~DepthCameraPointCloudGrabber ( )

Destructor.

Member Function Documentation

◆ get_default_depth_cam()

static const Camera& icl::geom::DepthCameraPointCloudGrabber::get_default_depth_cam ( )
static

creates the defautl VGA core::depth camera

◆ get_null_color_cam()

static const Camera& icl::geom::DepthCameraPointCloudGrabber::get_null_color_cam ( )
static

creates the defautl null color camera

The camera is never really used, only it's address is used to decide whether it is the static null-color-camera or not

◆ getColorCamera()

virtual Camera icl::geom::DepthCameraPointCloudGrabber::getColorCamera ( ) const
virtual

returns current color camera

If no color camera was given, an exception is thrown

Reimplemented from icl::geom::PointCloudGrabber.

◆ getColorImage()

virtual const core::Img8u* icl::geom::DepthCameraPointCloudGrabber::getColorImage ( ) const
virtual

returns the last grabbed point cloud's underlying color image (if available)

Reimplemented from icl::geom::PointCloudGrabber.

◆ getCreator() [1/2]

PointCloudCreator& icl::geom::DepthCameraPointCloudGrabber::getCreator ( )

returns the internal point cloud creator instance

◆ getCreator() [2/2]

const PointCloudCreator& icl::geom::DepthCameraPointCloudGrabber::getCreator ( ) const

returns the internal point cloud creator instance (const)

◆ getDepthCamera()

virtual Camera icl::geom::DepthCameraPointCloudGrabber::getDepthCamera ( ) const
virtual

returns current depth camera

Reimplemented from icl::geom::PointCloudGrabber.

◆ getDepthImage()

virtual const core::Img32f* icl::geom::DepthCameraPointCloudGrabber::getDepthImage ( ) const
virtual

returns the last grabbed point cloud's underlying depth image

Reimplemented from icl::geom::PointCloudGrabber.

◆ getLastColorImage()

const core::Img8u& icl::geom::DepthCameraPointCloudGrabber::getLastColorImage ( ) const

returns the last grabbed color image

Throws an exception if no color camera or not valid color camera device type and ID were passed.

◆ getLastDepthImage()

const core::Img32f& icl::geom::DepthCameraPointCloudGrabber::getLastDepthImage ( ) const

returns the last grabbed core::depth image

◆ getMapping()

RGBDMapping icl::geom::DepthCameraPointCloudGrabber::getMapping ( ) const

returns the internal RGBDMapping

only if both color- and depth camera is available

◆ grab()

virtual void icl::geom::DepthCameraPointCloudGrabber::grab ( PointCloudObjectBase dst)
virtual

virtual grab implementation

Implements icl::geom::PointCloudGrabber.

◆ mapImage()

void icl::geom::DepthCameraPointCloudGrabber::mapImage ( const core::ImgBase src,
core::ImgBase **  dst,
const core::Img32f depthImageMM = 0 
)

maps another given image just like the rgbImage would be mapped

Parameters
srcimage assumed to be captured from the perspective of the color camera
dstdestimation image (automatically adapted)
depthImageMMoptionally given depth image (if NULL, then the last depthImage passed to the "create"-is used, which should usually be the right one)

◆ reinit()

void icl::geom::DepthCameraPointCloudGrabber::reinit ( const std::string &  description)
virtual

reinitisize the backend (here, only new camera parameters can be given)

The syntax is @dcam=depth-cam-filename@ccam=color-cam-filename. It is also possible to pass only one of the @ tokens.

Reimplemented from icl::geom::PointCloudGrabber.

◆ setCameraWorldFrame()

virtual void icl::geom::DepthCameraPointCloudGrabber::setCameraWorldFrame ( const math::FixedMatrix< float, 4, 4 > &  T)
virtual

sets up the cameras world frame

Internally, this will set the depth camera's world frame to T. If a color camera is given, it will be also moved so that the relative transform between the depth camera and the color camera remains the same. Otherwise, the RGBD-mapping would become broken

Reimplemented from icl::geom::PointCloudGrabber.

◆ setColorImageMask()

void icl::geom::DepthCameraPointCloudGrabber::setColorImageMask ( const core::Img8u mask,
bool  passOwnerShip = true 
)

sets a mask, that is applied to the color image before creatig the point cloud

color pixels that correspond to 0-mask pixels are set to black

◆ setDepthImageMask()

void icl::geom::DepthCameraPointCloudGrabber::setDepthImageMask ( const core::Img8u mask,
bool  passOwnerShip = true 
)

sets a mask, that is applied to the depth image before creatig the point cloud

depth image pixels that correspond to 0-mask pixels are set to 0

◆ setUseCL()

void icl::geom::DepthCameraPointCloudGrabber::setUseCL ( bool  enable)

defines whether opencl is to be used

Please note that OpenCL is only used if The graphics card supports OpenCL ICL is build with OpenCL support for the most common point cloud types (i.e. color type is rgba32f) color- and depth-camera size are equal

Member Data Documentation

◆ m_data

Data* icl::geom::DepthCameraPointCloudGrabber::m_data
private

pimpl type

pimpl pointer


The documentation for this class was generated from the following file: