Loading...
Searching...
No Matches
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

using | Ptr = shared_ptr< DepthImage >
using | ConstPtr = shared_ptr< const DepthImage >
using | Clock = std::chrono::high_resolution_clock
using | Timestamp = std::chrono::high_resolution_clock::time_point

## Public Member Functions

| DepthImage (FrameWrapper::Ptr depth_metadata, float baseline, float focal_length, std::uint64_t shadow_value, std::uint64_t no_sample_value)
| Constructor.
| DepthImage (FrameWrapper::Ptr depth_metadata, float baseline, float focal_length, std::uint64_t shadow_value, std::uint64_t no_sample_value, Timestamp time)
| ~DepthImage ()
| Destructor.
const FrameWrapper::Ptr | getMetaData () const
| method to access the internal data structure from OpenNI.
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.
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.
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.
float | getBaseline () const
| method to access the baseline of the "stereo" frame that was used to retrieve the depth image.
float | getFocalLength () const
| method to access the focal length of the "stereo" frame that was used to retrieve the depth image.
std::uint64_t | getShadowValue () const
| method to access the shadow value, that indicates pixels lying in shadow in the depth image.
std::uint64_t | getNoSampleValue () const
| method to access the no-sample value, that indicates pixels where no disparity could be determined for the depth image.
unsigned | getWidth () const
unsigned | getHeight () const
unsigned | getFrameID () const
std::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_
std::uint64_t | shadow_value_
std::uint64_t | no_sample_value_
Timestamp | timestamp_

## Detailed Description

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

Definition at line 54 of file image_depth.h.

## Member Typedef Documentation

## Clock

using pcl::io::DepthImage::Clock = std::chrono::high_resolution_clock

Definition at line 60 of file image_depth.h.

## ConstPtr

using pcl::io::DepthImage::ConstPtr = shared_ptr<const DepthImage>

Definition at line 58 of file image_depth.h.

## Ptr

using pcl::io::DepthImage::Ptr = shared_ptr<DepthImage>

Definition at line 57 of file image_depth.h.

## Timestamp

using pcl::io::DepthImage::Timestamp = std::chrono::high_resolution_clock::time_point

Definition at line 61 of file image_depth.h.

## Constructor & Destructor Documentation

## DepthImage() [1/2]

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

Constructor.

Parameters

  [in] | depth_metadata | 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.

## DepthImage() [2/2]

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

## ~DepthImage()

pcl::io::DepthImage::~DepthImage | ( |  | ) |

Destructor.

Never throws an exception.

## Member Function Documentation

## fillDepthImage()

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.

## fillDepthImageRaw()

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.

## fillDisparityImage()

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.

## getBaseline()

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

## getData()

const unsigned short * pcl::io::DepthImage::getData | ( |  | ) |

## getDataSize()

int pcl::io::DepthImage::getDataSize | ( |  | ) | const

## getFocalLength()

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

## getFrameID()

unsigned pcl::io::DepthImage::getFrameID | ( |  | ) | const

Returns
  an ascending id for the depth frame

Attention
  not necessarily synchronized with other streams

## getHeight()

unsigned pcl::io::DepthImage::getHeight | ( |  | ) | const

Returns
  the height of the depth image

## getMetaData()

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.

## getNoSampleValue()

std::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

## getShadowValue()

std::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

## getStep()

unsigned pcl::io::DepthImage::getStep | ( |  | ) | const

inline

Definition at line 172 of file image_depth.h.

## getSystemTimestamp()

Timestamp pcl::io::DepthImage::getSystemTimestamp | ( |  | ) | const

## getTimestamp()

std::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

## getWidth()

unsigned pcl::io::DepthImage::getWidth | ( |  | ) | const

Returns
  the width of the depth image

## Member Data Documentation

## baseline_

float pcl::io::DepthImage::baseline_

protected

Definition at line 180 of file image_depth.h.

## focal_length_

float pcl::io::DepthImage::focal_length_

protected

Definition at line 181 of file image_depth.h.

## no_sample_value_

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

protected

Definition at line 183 of file image_depth.h.

## shadow_value_

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

protected

Definition at line 182 of file image_depth.h.

## timestamp_

Timestamp pcl::io::DepthImage::timestamp_

protected

Definition at line 184 of file image_depth.h.

## wrapper_

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

protected

Definition at line 178 of file image_depth.h.

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

- pcl/io/image_depth.h