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< DepthImage > | Ptr
typedef boost::shared_ptr< const DepthImage > | ConstPtr
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 56 of file image_depth.h.

## Member Typedef Documentation

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

Definition at line 62 of file image_depth.h.

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

Definition at line 60 of file image_depth.h.

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

Definition at line 59 of file image_depth.h.

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

Definition at line 63 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_meta_data | the actual data from the OpenNI library
  [in] | baseline | the 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_length | focal length of the "stereo" frame.
  [in] | shadow_value | defines which values in the depth data are indicating shadow (resulting from the parallax between projector and IR camera)
  [in] | no_sample_value | defines 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] | width | width the width of the desired depth image.
  [in] | height | height the height of the desired depth image.
  [in,out] | depth_buffer | the float pointer to the actual memory buffer to be filled with the depth values.
  [in] | line_step | if 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] | width | width the width of the desired raw image.
  [in] | height | height the height of the desired raw image.
  [in,out] | depth_buffer | the unsigned short pointer to the actual memory buffer to be filled with the raw values.
  [in] | line_step | if 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] | width | the width of the desired disparity image.
  [in] | height | the height of the desired disparity image.
  [in,out] | disparity_buffer | the float pointer to the actual memory buffer to be filled with the disparity values.
  [in] | line_step | if 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 174 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 182 of file image_depth.h.

float pcl::io::DepthImage::focal_length_

protected

Definition at line 183 of file image_depth.h.

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

protected

Definition at line 185 of file image_depth.h.

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

protected

Definition at line 184 of file image_depth.h.

Timestamp pcl::io::DepthImage::timestamp_

protected

Definition at line 186 of file image_depth.h.

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

protected

Definition at line 180 of file image_depth.h.

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

- /build/pcl-6_P28C/pcl-1.7.2/io/include/pcl/io/image_depth.h