Point Cloud Library (PCL)  1.9.1-dev
List of all members | Public Types | Public Member Functions | Protected Attributes
pcl::io::DepthImage Class Reference

This class provides methods to fill a depth or disparity image. More...

#include <pcl/io/image_depth.h>

Public Types

typedef boost::shared_ptr< DepthImagePtr
 
typedef boost::shared_ptr< const DepthImageConstPtr
 
typedef boost::chrono::high_resolution_clock Clock
 
typedef boost::chrono::high_resolution_clock::time_point Timestamp
 

Public Member Functions

 DepthImage (FrameWrapper::Ptr depth_metadata, float baseline, float focal_length, pcl::uint64_t shadow_value, pcl::uint64_t no_sample_value)
 Constructor. More...
 
 DepthImage (FrameWrapper::Ptr depth_metadata, float baseline, float focal_length, pcl::uint64_t shadow_value, pcl::uint64_t no_sample_value, Timestamp time)
 
 ~DepthImage ()
 Destructor. More...
 
const FrameWrapper::Ptr getMetaData () const
 method to access the internal data structure from OpenNI. More...
 
void fillDisparityImage (unsigned width, unsigned height, float *disparity_buffer, unsigned line_step=0) const
 fills a user given block of memory with the disparity values with additional nearest-neighbor down-scaling. More...
 
void fillDepthImage (unsigned width, unsigned height, float *depth_buffer, unsigned line_step=0) const
 fills a user given block of memory with the disparity values with additional nearest-neighbor down-scaling. More...
 
void fillDepthImageRaw (unsigned width, unsigned height, unsigned short *depth_buffer, unsigned line_step=0) const
 fills a user given block of memory with the raw values with additional nearest-neighbor down-scaling. More...
 
float getBaseline () const
 method to access the baseline of the "stereo" frame that was used to retrieve the depth image. More...
 
float getFocalLength () const
 method to access the focal length of the "stereo" frame that was used to retrieve the depth image. More...
 
pcl::uint64_t getShadowValue () const
 method to access the shadow value, that indicates pixels lying in shadow in the depth image. More...
 
pcl::uint64_t getNoSampleValue () const
 method to access the no-sample value, that indicates pixels where no disparity could be determined for the depth image. More...
 
unsigned getWidth () const
 
unsigned getHeight () const
 
unsigned getFrameID () const
 
pcl::uint64_t getTimestamp () const
 
Timestamp getSystemTimestamp () const
 
const unsigned short * getData ()
 
int getDataSize () const
 
unsigned getStep () const
 

Protected Attributes

pcl::io::FrameWrapper::Ptr wrapper_
 
float baseline_
 
float focal_length_
 
pcl::uint64_t shadow_value_
 
pcl::uint64_t no_sample_value_
 
Timestamp timestamp_
 

Detailed Description

This class provides methods to fill a depth or disparity image.

Definition at line 55 of file image_depth.h.

Member Typedef Documentation

typedef boost::chrono::high_resolution_clock pcl::io::DepthImage::Clock

Definition at line 61 of file image_depth.h.

typedef boost::shared_ptr<const DepthImage> pcl::io::DepthImage::ConstPtr

Definition at line 59 of file image_depth.h.

typedef boost::shared_ptr<DepthImage> pcl::io::DepthImage::Ptr

Definition at line 58 of file image_depth.h.

typedef boost::chrono::high_resolution_clock::time_point pcl::io::DepthImage::Timestamp

Definition at line 62 of file image_depth.h.

Constructor & Destructor Documentation

pcl::io::DepthImage::DepthImage ( FrameWrapper::Ptr  depth_metadata,
float  baseline,
float  focal_length,
pcl::uint64_t  shadow_value,
pcl::uint64_t  no_sample_value 
)

Constructor.

Parameters
[in]depth_metadatathe actual data from the OpenNI library
[in]baselinethe baseline of the "stereo" camera, i.e. the distance between the projector and the IR camera for Primesense like cameras. e.g. 7.5cm for PSDK5 and PSDK6 reference design.
[in]focal_lengthfocal length of the "stereo" frame.
[in]shadow_valuedefines which values in the depth data are indicating shadow (resulting from the parallax between projector and IR camera)
[in]no_sample_valuedefines which values in the depth data are indicating that no depth (disparity) could be determined .
Attention
The focal length may change, depending whether the depth stream is registered/mapped to the RGB stream or not.
pcl::io::DepthImage::DepthImage ( FrameWrapper::Ptr  depth_metadata,
float  baseline,
float  focal_length,
pcl::uint64_t  shadow_value,
pcl::uint64_t  no_sample_value,
Timestamp  time 
)
pcl::io::DepthImage::~DepthImage ( )

Destructor.

Never throws an exception.

Member Function Documentation

void pcl::io::DepthImage::fillDepthImage ( unsigned  width,
unsigned  height,
float *  depth_buffer,
unsigned  line_step = 0 
) const

fills a user given block of memory with the disparity values with additional nearest-neighbor down-scaling.

Parameters
[in]widthwidth the width of the desired depth image.
[in]heightheight the height of the desired depth image.
[in,out]depth_bufferthe float pointer to the actual memory buffer to be filled with the depth values.
[in]line_stepif only a rectangular sub region of the buffer needs to be filled, then line_step is the width in bytes (not floats) of the original width of the depth buffer.
void pcl::io::DepthImage::fillDepthImageRaw ( unsigned  width,
unsigned  height,
unsigned short *  depth_buffer,
unsigned  line_step = 0 
) const

fills a user given block of memory with the raw values with additional nearest-neighbor down-scaling.

Parameters
[in]widthwidth the width of the desired raw image.
[in]heightheight the height of the desired raw image.
[in,out]depth_bufferthe unsigned short pointer to the actual memory buffer to be filled with the raw values.
[in]line_stepif only a rectangular sub region of the buffer needs to be filled, then line_step is the width in bytes (not floats) of the original width of the depth buffer.
void pcl::io::DepthImage::fillDisparityImage ( unsigned  width,
unsigned  height,
float *  disparity_buffer,
unsigned  line_step = 0 
) const

fills a user given block of memory with the disparity values with additional nearest-neighbor down-scaling.

Parameters
[in]widththe width of the desired disparity image.
[in]heightthe height of the desired disparity image.
[in,out]disparity_bufferthe float pointer to the actual memory buffer to be filled with the disparity values.
[in]line_stepif only a rectangular sub region of the buffer needs to be filled, then line_step is the width in bytes (not floats) of the original width of the depth buffer.
float pcl::io::DepthImage::getBaseline ( ) const

method to access the baseline of the "stereo" frame that was used to retrieve the depth image.

Returns
baseline in meters
const unsigned short* pcl::io::DepthImage::getData ( )
int pcl::io::DepthImage::getDataSize ( ) const
float pcl::io::DepthImage::getFocalLength ( ) const

method to access the focal length of the "stereo" frame that was used to retrieve the depth image.

Returns
focal length in pixels
unsigned pcl::io::DepthImage::getFrameID ( ) const
Returns
an ascending id for the depth frame
Attention
not necessarily synchronized with other streams
unsigned pcl::io::DepthImage::getHeight ( ) const
Returns
the height of the depth image
const FrameWrapper::Ptr pcl::io::DepthImage::getMetaData ( ) const

method to access the internal data structure from OpenNI.

If the data is accessed just read-only, then this method is faster than a fillXXX method

Returns
the actual depth data of type openni::VideoFrameRef.
pcl::uint64_t pcl::io::DepthImage::getNoSampleValue ( ) const

method to access the no-sample value, that indicates pixels where no disparity could be determined for the depth image.

Returns
no-sample value
pcl::uint64_t pcl::io::DepthImage::getShadowValue ( ) const

method to access the shadow value, that indicates pixels lying in shadow in the depth image.

Returns
shadow value
unsigned pcl::io::DepthImage::getStep ( ) const
inline

Definition at line 173 of file image_depth.h.

Timestamp pcl::io::DepthImage::getSystemTimestamp ( ) const
pcl::uint64_t pcl::io::DepthImage::getTimestamp ( ) const
Returns
a ascending timestamp for the depth frame
Attention
its not the system time, thus can not be used directly to synchronize different sensors. But definitely synchronized with other streams
unsigned pcl::io::DepthImage::getWidth ( ) const
Returns
the width of the depth image

Member Data Documentation

float pcl::io::DepthImage::baseline_
protected

Definition at line 181 of file image_depth.h.

float pcl::io::DepthImage::focal_length_
protected

Definition at line 182 of file image_depth.h.

pcl::uint64_t pcl::io::DepthImage::no_sample_value_
protected

Definition at line 184 of file image_depth.h.

pcl::uint64_t pcl::io::DepthImage::shadow_value_
protected

Definition at line 183 of file image_depth.h.

Timestamp pcl::io::DepthImage::timestamp_
protected

Definition at line 185 of file image_depth.h.

pcl::io::FrameWrapper::Ptr pcl::io::DepthImage::wrapper_
protected

Definition at line 179 of file image_depth.h.


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