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

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

#include <pcl/io/openni_camera/openni_depth_image.h>

Public Types

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

Public Member Functions

 DepthImage (pcl::shared_ptr< xn::DepthMetaData > depth_meta_data, float baseline, float focal_length, XnUInt64 shadow_value, XnUInt64 no_sample_value) noexcept
 Constructor. More...
 
virtual ~DepthImage () noexcept
 Destructor. More...
 
const xn::DepthMetaData & getDepthMetaData () const noexcept
 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 noexcept
 method to access the baseline of the "stereo" frame that was used to retrieve the depth image. More...
 
float getFocalLength () const noexcept
 method to access the focal length of the "stereo" frame that was used to retrieve the depth image. More...
 
XnUInt64 getShadowValue () const noexcept
 method to access the shadow value, that indicates pixels lying in shadow in the depth image. More...
 
XnUInt64 getNoSampleValue () const noexcept
 method to access the no-sample value, that indicates pixels where no disparity could be determined for the depth image. More...
 
unsigned getWidth () const noexcept
 
unsigned getHeight () const noexcept
 
unsigned getFrameID () const noexcept
 
unsigned long getTimeStamp () const noexcept
 

Protected Attributes

pcl::shared_ptr< xn::DepthMetaData > depth_md_
 
float baseline_
 
float focal_length_
 
XnUInt64 shadow_value_
 
XnUInt64 no_sample_value_
 

Detailed Description

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

Author
Suat Gedikli

Definition at line 56 of file openni_depth_image.h.

Member Typedef Documentation

◆ ConstPtr

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

Definition at line 60 of file openni_depth_image.h.

◆ Ptr

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

Definition at line 59 of file openni_depth_image.h.

Constructor & Destructor Documentation

◆ DepthImage()

openni_wrapper::DepthImage::DepthImage ( pcl::shared_ptr< xn::DepthMetaData >  depth_meta_data,
float  baseline,
float  focal_length,
XnUInt64  shadow_value,
XnUInt64  no_sample_value 
)
inlinenoexcept

Constructor.

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

Definition at line 165 of file openni_depth_image.h.

◆ ~DepthImage()

openni_wrapper::DepthImage::~DepthImage ( )
inlinevirtualdefaultnoexcept

Destructor.

Never throws an exception.

Member Function Documentation

◆ fillDepthImage()

void openni_wrapper::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.

◆ fillDepthImageRaw()

void openni_wrapper::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.

◆ fillDisparityImage()

void openni_wrapper::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.

◆ getBaseline()

float openni_wrapper::DepthImage::getBaseline ( ) const
inlinenoexcept

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

Returns
baseline in meters

Definition at line 181 of file openni_depth_image.h.

◆ getDepthMetaData()

const xn::DepthMetaData & openni_wrapper::DepthImage::getDepthMetaData ( ) const
inlinenoexcept

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 xn::DepthMetaData.

Definition at line 175 of file openni_depth_image.h.

◆ getFocalLength()

float openni_wrapper::DepthImage::getFocalLength ( ) const
inlinenoexcept

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

Returns
focal length in pixels

Definition at line 187 of file openni_depth_image.h.

◆ getFrameID()

unsigned openni_wrapper::DepthImage::getFrameID ( ) const
inlinenoexcept
Returns
an ascending id for the depth frame
Attention
not necessarily synchronized with other streams

Definition at line 217 of file openni_depth_image.h.

◆ getHeight()

unsigned openni_wrapper::DepthImage::getHeight ( ) const
inlinenoexcept
Returns
the height of the depth image

Definition at line 211 of file openni_depth_image.h.

◆ getNoSampleValue()

XnUInt64 openni_wrapper::DepthImage::getNoSampleValue ( ) const
inlinenoexcept

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

Returns
no-sample value

Definition at line 199 of file openni_depth_image.h.

◆ getShadowValue()

XnUInt64 openni_wrapper::DepthImage::getShadowValue ( ) const
inlinenoexcept

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

Returns
shadow value

Definition at line 193 of file openni_depth_image.h.

◆ getTimeStamp()

unsigned long openni_wrapper::DepthImage::getTimeStamp ( ) const
inlinenoexcept
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

Definition at line 223 of file openni_depth_image.h.

◆ getWidth()

unsigned openni_wrapper::DepthImage::getWidth ( ) const
inlinenoexcept
Returns
the width of the depth image

Definition at line 205 of file openni_depth_image.h.

Member Data Documentation

◆ baseline_

float openni_wrapper::DepthImage::baseline_
protected

Definition at line 159 of file openni_depth_image.h.

◆ depth_md_

pcl::shared_ptr<xn::DepthMetaData> openni_wrapper::DepthImage::depth_md_
protected

Definition at line 158 of file openni_depth_image.h.

◆ focal_length_

float openni_wrapper::DepthImage::focal_length_
protected

Definition at line 160 of file openni_depth_image.h.

◆ no_sample_value_

XnUInt64 openni_wrapper::DepthImage::no_sample_value_
protected

Definition at line 162 of file openni_depth_image.h.

◆ shadow_value_

XnUInt64 openni_wrapper::DepthImage::shadow_value_
protected

Definition at line 161 of file openni_depth_image.h.


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