38 #include <pcl/pcl_config.h>
41 #ifndef __OPENNI_DEPTH_IMAGE__
42 #define __OPENNI_DEPTH_IMAGE__
47 #include <pcl/pcl_exports.h>
48 #include "openni_exception.h"
49 #include <pcl/io/boost.h>
59 typedef boost::shared_ptr<DepthImage>
Ptr;
60 typedef boost::shared_ptr<const DepthImage>
ConstPtr;
71 inline DepthImage (boost::shared_ptr<xn::DepthMetaData> depth_meta_data,
float baseline,
float focal_length, XnUInt64 shadow_value, XnUInt64 no_sample_value)
throw ();
79 inline const xn::DepthMetaData&
80 getDepthMetaData () const throw ();
90 fillDisparityImage (
unsigned width,
unsigned height,
float* disparity_buffer,
unsigned line_step = 0) const;
100 fillDepthImage (
unsigned width,
unsigned height,
float* depth_buffer,
unsigned line_step = 0) const;
110 fillDepthImageRaw (
unsigned width,
unsigned height,
unsigned short* depth_buffer,
unsigned line_step = 0) const;
116 getBaseline () const throw ();
122 getFocalLength () const throw ();
128 getShadowValue () const throw ();
134 getNoSampleValue () const throw ();
138 getWidth () const throw ();
142 getHeight () const throw ();
148 getFrameID () const throw ();
155 getTimeStamp () const throw ();
158 boost::shared_ptr<xn::DepthMetaData> depth_md_;
161 XnUInt64 shadow_value_;
162 XnUInt64 no_sample_value_;
165 DepthImage::
DepthImage (
boost::shared_ptr<xn::DepthMetaData> depth_meta_data,
float baseline,
float focal_length, XnUInt64 shadow_value, XnUInt64 no_sample_value) throw ()
166 : depth_md_ (depth_meta_data)
167 , baseline_ (baseline)
168 , focal_length_ (focal_length)
169 , shadow_value_ (shadow_value)
170 , no_sample_value_ (no_sample_value) { }
174 const xn::DepthMetaData&
189 return focal_length_;
195 return shadow_value_;
201 return no_sample_value_;
207 return depth_md_->XRes ();
213 return depth_md_->YRes ();
219 return depth_md_->FrameID ();
225 return static_cast<unsigned long> (depth_md_->Timestamp ());
229 #endif //__OPENNI_DEPTH_IMAGE
XnUInt64 getNoSampleValue() const
method to access the no-sample value, that indicates pixels where no disparity could be determined fo...
float getBaseline() const
method to access the baseline of the "stereo" frame that was used to retrieve the depth image...
boost::shared_ptr< const DepthImage > ConstPtr
float getFocalLength() const
method to access the focal length of the "stereo" frame that was used to retrieve the depth image...
unsigned getFrameID() const
This class provides methods to fill a depth or disparity image.
unsigned getWidth() const
unsigned long getTimeStamp() const
boost::shared_ptr< DepthImage > Ptr
virtual ~DepthImage()
Destructor.
const xn::DepthMetaData & getDepthMetaData() const
method to access the internal data structure from OpenNI.
unsigned getHeight() const
XnUInt64 getShadowValue() const
method to access the shadow value, that indicates pixels lying in shadow in the depth image...