Image Component Library (ICL)
DepthCameraPointCloudGrabber.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLGeom/src/ICLGeom/DepthCameraPointCloudGrabber.h **
10 ** Module : ICLGeom **
11 ** Authors: Christof Elbrechter, Patrick Nobou **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <ICLUtils/CompatMacros.h>
35 #include <ICLGeom/RGBDMapping.h>
36 #include <ICLGeom/Camera.h>
37 
38 namespace icl{
39  namespace geom{
40 
42  class PointCloudCreator;
45 
50  struct Data;
51  Data *m_data;
52 
53  public:
55 
68  DepthCameraPointCloudGrabber(const Camera &depthCam=get_default_depth_cam(),
69  const Camera &colorCam=get_null_color_cam(),
70  const std::string &depthDeviceType="kinectd",
71  const std::string &depthDeviceID="0",
72  const std::string &colorDeviceType="kinectc",
73  const std::string &colorDeviceID="0",
74  bool needsKinectRawDepthInput=false);
75 
78 
80 
81  void setColorImageMask(const core::Img8u *mask, bool passOwnerShip=true);
82 
84 
85  void setDepthImageMask(const core::Img8u *mask, bool passOwnerShip=true);
86 
88  virtual void grab(PointCloudObjectBase &dst);
89 
91  const core::Img32f &getLastDepthImage() const;
92 
94 
96  const core::Img8u &getLastColorImage() const ;
97 
99  static const Camera &get_default_depth_cam();
100 
102 
104  static const Camera &get_null_color_cam();
105 
107 
111  void mapImage(const core::ImgBase *src, core::ImgBase **dst, const core::Img32f *depthImageMM=0);
112 
114 
119  void setUseCL(bool enable);
120 
122  PointCloudCreator &getCreator();
123 
125  const PointCloudCreator &getCreator() const;
126 
128 
129  RGBDMapping getMapping() const ;
130 
132 
134  void reinit(const std::string &description) ;
135 
137  virtual const core::Img32f *getDepthImage() const;
138 
140  virtual const core::Img8u *getColorImage() const;
141 
143  virtual Camera getDepthCamera() const ;
144 
146 
147  virtual Camera getColorCamera() const ;
148 
150 
154  virtual void setCameraWorldFrame(const math::FixedMatrix<float,4,4> &T) ;
155 
156  };
157  } // namespace geom
158 }
159 
PointCloudGrabber implementation for 2D core::depth-image based creation of point clouds.
Definition: DepthCameraPointCloudGrabber.h:49
Powerful and highly flexible matrix class implementation.
Definition: FixedMatrix.h:172
undocument this line if you encounter any issues!
Definition: Any.h:37
Base class for point cloud data types.
Definition: PointCloudObjectBase.h:98
#define ICLGeom_API
Definition: CompatMacros.h:179
Utility class that allows to create 3D (optionally colored) point clouds from given 2D core::depth im...
Definition: PointCloudCreator.h:56
Camera class.
Definition: Camera.h:132
Utility class for RGBDMapping.
Definition: RGBDMapping.h:46
Data * m_data
pimpl type
Definition: DepthCameraPointCloudGrabber.h:50
ICLQt_API core::Img< T > grab(const std::string &dev, const std::string &devSpec, const utils::Size &size=utils::Size::null, core::format fmt=core::formatRGB, bool releaseGrabber=false)
grabs a new image from given device (affinity for floats)
Generic interface for PointCloud sources.
Definition: PointCloudGrabber.h:45
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131