Loading...
Searching...
No Matches
openni_wrapper::OpenNIDevice Class Referenceabstract
Module io

Class representing an astract device for OpenNI devices: Primesense PSDK, Microsoft Kinect, Asus Xtion Pro/Live. More...

`#include <pcl/io/openni_camera/openni_device.h>`

Inheritance diagram for openni_wrapper::OpenNIDevice:

## Classes

struct | ShiftConversion

## Public Types

enum | DepthMode { OpenNI_shift_values = 0 , OpenNI_12_bit_depth = 1 }
using | Ptr = pcl::shared_ptr<OpenNIDevice>
using | ConstPtr = pcl::shared_ptr<const OpenNIDevice>
using | ImageCallbackFunction = std::function<void(Image::Ptr, void* cookie) >
using | DepthImageCallbackFunction = std::function<void(DepthImage::Ptr, void* cookie) >
using | IRImageCallbackFunction = std::function<void(IRImage::Ptr, void* cookie) >
using | CallbackHandle = unsigned

## Public Member Functions

virtual | ~OpenNIDevice () noexcept
| virtual destructor.
bool | findCompatibleImageMode (const XnMapOutputMode &output_mode, XnMapOutputMode &mode) const noexcept
| finds an image output mode that can be used to retrieve images in desired output mode.
bool | findCompatibleDepthMode (const XnMapOutputMode &output_mode, XnMapOutputMode &mode) const noexcept
| finds a depth output mode that can be used to retrieve depth images in desired output mode.
bool | isImageModeSupported (const XnMapOutputMode &output_mode) const noexcept
| returns whether a given mode is natively supported by the device or not
bool | isDepthModeSupported (const XnMapOutputMode &output_mode) const noexcept
| returns whether a given mode is natively supported by the device or not
const XnMapOutputMode & | getDefaultImageMode () const noexcept
| returns the default image mode, which is simply the first entry in the list of modes
const XnMapOutputMode & | getDefaultDepthMode () const noexcept
| returns the default depth mode, which is simply the first entry in the list of modes
const XnMapOutputMode & | getDefaultIRMode () const noexcept
| returns the default IR mode, which is simply the first entry in the list of modes
void | setImageOutputMode (const XnMapOutputMode &output_mode)
| sets the output mode of the image stream
void | setDepthOutputMode (const XnMapOutputMode &output_mode)
| sets the output mode of the depth stream
void | setIROutputMode (const XnMapOutputMode &output_mode)
| sets the output mode of the IR stream
XnMapOutputMode | getImageOutputMode () const
XnMapOutputMode | getDepthOutputMode () const
XnMapOutputMode | getIROutputMode () const
void | setDepthRegistration (bool on_off)
| set the depth stream registration on or off
bool | isDepthRegistered () const noexcept
bool | isDepthRegistrationSupported () const noexcept
void | setSynchronization (bool on_off)
| set the hardware synchronization between Depth and RGB stream on or off.
bool | isSynchronized () const noexcept
virtual bool | isSynchronizationSupported () const noexcept
bool | isDepthCropped () const
void | setDepthCropping (unsigned x, unsigned y, unsigned width, unsigned height)
| turn on cropping for the depth stream.
bool | isDepthCroppingSupported () const noexcept
float | getImageFocalLength (int output_x_resolution=0) const noexcept
| returns the focal length for the color camera in pixels.
float | getDepthFocalLength (int output_x_resolution=0) const noexcept
| returns the focal length for the IR camera in pixels.
float | getBaseline () const noexcept
virtual void | startImageStream ()
| starts the image stream.
virtual void | stopImageStream ()
| stops the image stream.
virtual void | startDepthStream ()
| starts the depth stream.
virtual void | stopDepthStream ()
| stops the depth stream.
virtual void | startIRStream ()
| starts the IR stream.
virtual void | stopIRStream ()
| stops the IR stream.
bool | hasImageStream () const noexcept
bool | hasDepthStream () const noexcept
bool | hasIRStream () const noexcept
virtual bool | isImageStreamRunning () const noexcept
virtual bool | isDepthStreamRunning () const noexcept
virtual bool | isIRStreamRunning () const noexcept
CallbackHandle | registerImageCallback (const ImageCallbackFunction &callback, void *cookie=nullptr) noexcept
| registers a callback function of std::function type for the image stream with an optional user defined parameter.
template<typename T>
CallbackHandle | registerImageCallback (void(T::*callback)(Image::Ptr, void *cookie), T &instance, void *cookie=nullptr) noexcept
| registers a callback function for the image stream with an optional user defined parameter.
bool | unregisterImageCallback (const CallbackHandle &callbackHandle) noexcept
| unregisters a callback function.
CallbackHandle | registerDepthCallback (const DepthImageCallbackFunction &callback, void *cookie=nullptr) noexcept
| registers a callback function of std::function type for the depth stream with an optional user defined parameter.
template<typename T>
CallbackHandle | registerDepthCallback (void(T::*callback)(DepthImage::Ptr, void *cookie), T &instance, void *cookie=nullptr) noexcept
| registers a callback function for the depth stream with an optional user defined parameter.
bool | unregisterDepthCallback (const CallbackHandle &callbackHandle) noexcept
| unregisters a callback function.
CallbackHandle | registerIRCallback (const IRImageCallbackFunction &callback, void *cookie=nullptr) noexcept
| registers a callback function of std::function type for the IR stream with an optional user defined parameter.
template<typename T>
CallbackHandle | registerIRCallback (void(T::*callback)(IRImage::Ptr, void *cookie), T &instance, void *cookie=nullptr) noexcept
| registers a callback function for the IR stream with an optional user defined parameter.
bool | unregisterIRCallback (const CallbackHandle &callbackHandle) noexcept
| unregisters a callback function.
const char * | getSerialNumber () const noexcept
| returns the serial number for device.
const char * | getConnectionString () const noexcept
| returns the connection string for current device, which has following format vendorID/productID@BusID/DeviceID.
const char * | getVendorName () const noexcept
const char * | getProductName () const noexcept
unsigned short | getVendorID () const noexcept
unsigned short | getProductID () const noexcept
unsigned char | getBus () const noexcept
unsigned char | getAddress () const noexcept
void | setRGBFocalLength (float focal_length)
| Set the RGB image focal length.
void | setDepthFocalLength (float focal_length)
| Set the depth image focal length.
void | setDepthOutputFormat (const DepthMode &depth_mode=OpenNI_12_bit_depth)
| Set the depth output format.
XnUInt64 | getDepthOutputFormat () const
| Get the depth output format as set by the user.
std::uint16_t | shiftToDepth (std::uint16_t shift_value) const
| Convert shift to depth value.

## Protected Types

using | ActualImageCallbackFunction = std::function<void(Image::Ptr) >
using | ActualDepthImageCallbackFunction = std::function<void(DepthImage::Ptr) >
using | ActualIRImageCallbackFunction = std::function<void(IRImage::Ptr) >

## Protected Member Functions

| OpenNIDevice (xn::Context &context, const xn::NodeInfo &device_node, const xn::NodeInfo &image_node, const xn::NodeInfo &depth_node, const xn::NodeInfo &ir_node)
| OpenNIDevice (xn::Context &context, const xn::NodeInfo &device_node, const xn::NodeInfo &depth_node, const xn::NodeInfo &ir_node)
| OpenNIDevice (xn::Context &context)
void | ImageDataThreadFunction ()
void | DepthDataThreadFunction ()
void | IRDataThreadFunction ()
virtual bool | isImageResizeSupported (unsigned input_width, unsigned input_height, unsigned output_width, unsigned output_height) const noexcept=0
void | setRegistration (bool on_off)
virtual Image::Ptr | getCurrentImage (pcl::shared_ptr< xn::ImageMetaData > image_data) const noexcept=0
void | Init ()
void | InitShiftToDepthConversion ()
void | ReadDeviceParametersFromSensorNode ()

## Static Protected Member Functions

static void __stdcall | NewDepthDataAvailable (xn::ProductionNode &node, void *cookie) noexcept
static void __stdcall | NewImageDataAvailable (xn::ProductionNode &node, void *cookie) noexcept
static void __stdcall | NewIRDataAvailable (xn::ProductionNode &node, void *cookie) noexcept

## Protected Attributes

struct openni_wrapper::OpenNIDevice::ShiftConversion | shift_conversion_parameters_
std::vector< std::uint16_t > | shift_to_depth_table_
std::map< CallbackHandle, ActualImageCallbackFunction > | image_callback_
std::map< CallbackHandle, ActualDepthImageCallbackFunction > | depth_callback_
std::map< CallbackHandle, ActualIRImageCallbackFunction > | ir_callback_
std::vector< XnMapOutputMode > | available_image_modes_
std::vector< XnMapOutputMode > | available_depth_modes_
xn::Context & | context_
| context to OpenNI driver
xn::NodeInfo | device_node_info_
| node object for current device
xn::DepthGenerator | depth_generator_
| Depth generator object.
xn::ImageGenerator | image_generator_
| Image generator object.
xn::IRGenerator | ir_generator_
| IR generator object.
XnCallbackHandle | depth_callback_handle_
XnCallbackHandle | image_callback_handle_
XnCallbackHandle | ir_callback_handle_
float | depth_focal_length_SXGA_
| focal length for IR camera producing depth information in native SXGA mode
float | baseline_
| distance between the projector and the IR camera
float | rgb_focal_length_SXGA_
| focal length for regular camera producing color images in native SXGA mode
XnUInt64 | shadow_value_
| the value for shadow (occluded pixels)
XnUInt64 | no_sample_value_
| the value for pixels without a valid disparity measurement
OpenNIDevice::CallbackHandle | image_callback_handle_counter_
OpenNIDevice::CallbackHandle | depth_callback_handle_counter_
OpenNIDevice::CallbackHandle | ir_callback_handle_counter_
bool | quit_
std::mutex | image_mutex_
std::mutex | depth_mutex_
std::mutex | ir_mutex_
std::condition_variable | image_condition_
std::condition_variable | depth_condition_
std::condition_variable | ir_condition_
std::thread | image_thread_
std::thread | depth_thread_
std::thread | ir_thread_

## Detailed Description

Class representing an astract device for OpenNI devices: Primesense PSDK, Microsoft Kinect, Asus Xtion Pro/Live.

Author
  Suat Gedikli

Definition at line 71 of file openni_device.h.

## Member Typedef Documentation

## ActualDepthImageCallbackFunction

using openni_wrapper::OpenNIDevice::ActualDepthImageCallbackFunction = std::function<void(DepthImage::Ptr) >

protected

Definition at line 450 of file openni_device.h.

## ActualImageCallbackFunction

using openni_wrapper::OpenNIDevice::ActualImageCallbackFunction = std::function<void(Image::Ptr) >

protected

Definition at line 449 of file openni_device.h.

## ActualIRImageCallbackFunction

using openni_wrapper::OpenNIDevice::ActualIRImageCallbackFunction = std::function<void(IRImage::Ptr) >

protected

Definition at line 451 of file openni_device.h.

## CallbackHandle

using openni_wrapper::OpenNIDevice::CallbackHandle = unsigned

Definition at line 86 of file openni_device.h.

## ConstPtr

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

Definition at line 81 of file openni_device.h.

## DepthImageCallbackFunction

using openni_wrapper::OpenNIDevice::DepthImageCallbackFunction = std::function<void(DepthImage::Ptr, void* cookie) >

Definition at line 84 of file openni_device.h.

## ImageCallbackFunction

using openni_wrapper::OpenNIDevice::ImageCallbackFunction = std::function<void(Image::Ptr, void* cookie) >

Definition at line 83 of file openni_device.h.

## IRImageCallbackFunction

using openni_wrapper::OpenNIDevice::IRImageCallbackFunction = std::function<void(IRImage::Ptr, void* cookie) >

Definition at line 85 of file openni_device.h.

## Ptr

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

Definition at line 80 of file openni_device.h.

## Member Enumeration Documentation

## DepthMode

enum openni_wrapper::OpenNIDevice::DepthMode

Enumerator
OpenNI_shift_values |
OpenNI_12_bit_depth |

Definition at line 74 of file openni_device.h.

## Constructor & Destructor Documentation

## ~OpenNIDevice()

virtual openni_wrapper::OpenNIDevice::~OpenNIDevice | ( |  | ) |

virtual noexcept

virtual destructor.

Never throws an exception.

## OpenNIDevice() [1/3]

openni_wrapper::OpenNIDevice::OpenNIDevice | ( | xn::Context & | context,
|  | const xn::NodeInfo & | device_node,
|  | const xn::NodeInfo & | image_node,
|  | const xn::NodeInfo & | depth_node,
|  | const xn::NodeInfo & | ir_node )

protected

## OpenNIDevice() [2/3]

openni_wrapper::OpenNIDevice::OpenNIDevice | ( | xn::Context & | context,
|  | const xn::NodeInfo & | device_node,
|  | const xn::NodeInfo & | depth_node,
|  | const xn::NodeInfo & | ir_node )

protected

## OpenNIDevice() [3/3]

openni_wrapper::OpenNIDevice::OpenNIDevice | ( | xn::Context & | context | ) |

protected

## Member Function Documentation

## DepthDataThreadFunction()

void openni_wrapper::OpenNIDevice::DepthDataThreadFunction | ( |  | ) |

protected

## findCompatibleDepthMode()

bool openni_wrapper::OpenNIDevice::findCompatibleDepthMode | ( | const XnMapOutputMode & | output_mode,
|  | XnMapOutputMode & | mode ) const

noexcept

finds a depth output mode that can be used to retrieve depth images in desired output mode.

e.g If device just supports VGA at 30Hz, then a desired mode of QVGA at 30Hz would be possible by downsampling, but the modes VGA at 25Hz and SXGA at 30Hz would not be compatible.

Parameters

  [in] | output_mode | the desired output mode
  [out] | mode | the compatible mode that the device natively supports.

Returns
  true, if a compatible mode could be found, false otherwise.

References findCompatibleDepthMode().

Referenced by findCompatibleDepthMode().

## findCompatibleImageMode()

bool openni_wrapper::OpenNIDevice::findCompatibleImageMode | ( | const XnMapOutputMode & | output_mode,
|  | XnMapOutputMode & | mode ) const

noexcept

finds an image output mode that can be used to retrieve images in desired output mode.

e.g If device just supports VGA at 30Hz, then the desired mode QVGA at 30Hz would be possible by down sampling, but the modes VGA at 25Hz and SXGA at 30Hz would not be compatible.

Parameters

  [in] | output_mode | the desired output mode
  [out] | mode | the compatible mode that the device natively supports.

Returns
  true, if a compatible mode could be found, false otherwise.

References findCompatibleImageMode().

Referenced by findCompatibleImageMode().

## getAddress()

unsigned char openni_wrapper::OpenNIDevice::getAddress | ( |  | ) | const

noexcept

Returns
  the USB Address of the device.

References getAddress().

Referenced by getAddress().

## getBaseline()

float openni_wrapper::OpenNIDevice::getBaseline | ( |  | ) | const

inline noexcept

Returns
  Baseline of the "stereo" frame. i.e. for PSDK compatible devices its the distance between the Projector and the IR camera.

Definition at line 587 of file openni_device.h.

References baseline_.

Referenced by isDepthCroppingSupported().

## getBus()

unsigned char openni_wrapper::OpenNIDevice::getBus | ( |  | ) | const

noexcept

Returns
  the USB bus on which the device is connected.

References getBus().

Referenced by getBus().

## getConnectionString()

const char * openni_wrapper::OpenNIDevice::getConnectionString | ( |  | ) | const

noexcept

returns the connection string for current device, which has following format vendorID/productID@BusID/DeviceID.

References getConnectionString().

Referenced by getConnectionString().

## getCurrentImage()

virtual Image::Ptr openni_wrapper::OpenNIDevice::getCurrentImage | ( | pcl::shared_ptr< xn::ImageMetaData > | image_data | ) | const

protected pure virtual noexcept

Implemented in openni_wrapper::DeviceKinect, openni_wrapper::DeviceONI, openni_wrapper::DevicePrimesense, and openni_wrapper::DeviceXtionPro.

## getDefaultDepthMode()

const XnMapOutputMode & openni_wrapper::OpenNIDevice::getDefaultDepthMode | ( |  | ) | const

noexcept

returns the default depth mode, which is simply the first entry in the list of modes

Returns
  the default depth mode

References getDefaultDepthMode().

Referenced by getDefaultDepthMode().

## getDefaultImageMode()

const XnMapOutputMode & openni_wrapper::OpenNIDevice::getDefaultImageMode | ( |  | ) | const

noexcept

returns the default image mode, which is simply the first entry in the list of modes

Returns
  the default image mode

References getDefaultImageMode().

Referenced by getDefaultImageMode().

## getDefaultIRMode()

const XnMapOutputMode & openni_wrapper::OpenNIDevice::getDefaultIRMode | ( |  | ) | const

noexcept

returns the default IR mode, which is simply the first entry in the list of modes

Returns
  the default IR mode

References getDefaultIRMode().

Referenced by getDefaultIRMode().

## getDepthFocalLength()

float openni_wrapper::OpenNIDevice::getDepthFocalLength | ( | int | output_x_resolution = 0 | ) | const

inline noexcept

returns the focal length for the IR camera in pixels.

The pixels are assumed to be square. Result depends on the output resolution of the depth image.

Definition at line 574 of file openni_device.h.

References depth_focal_length_SXGA_, getDepthOutputMode(), isDepthRegistered(), and rgb_focal_length_SXGA_.

Referenced by isDepthCroppingSupported().

## getDepthOutputFormat()

XnUInt64 openni_wrapper::OpenNIDevice::getDepthOutputFormat | ( |  | ) | const

Get the depth output format as set by the user.

## getDepthOutputMode()

XnMapOutputMode openni_wrapper::OpenNIDevice::getDepthOutputMode | ( |  | ) | const

Returns
  the current output mode of the depth stream

References getDepthOutputMode().

Referenced by getDepthFocalLength(), and getDepthOutputMode().

## getImageFocalLength()

float openni_wrapper::OpenNIDevice::getImageFocalLength | ( | int | output_x_resolution = 0 | ) | const

inline noexcept

returns the focal length for the color camera in pixels.

The pixels are assumed to be square. Result depends on the output resolution of the image.

Definition at line 563 of file openni_device.h.

References getImageOutputMode(), and rgb_focal_length_SXGA_.

Referenced by isDepthCroppingSupported().

## getImageOutputMode()

XnMapOutputMode openni_wrapper::OpenNIDevice::getImageOutputMode | ( |  | ) | const

Returns
  the current output mode of the image stream

References getImageOutputMode().

Referenced by getImageFocalLength(), and getImageOutputMode().

## getIROutputMode()

XnMapOutputMode openni_wrapper::OpenNIDevice::getIROutputMode | ( |  | ) | const

Returns
  the current output mode of the IR stream

References getIROutputMode().

Referenced by getIROutputMode().

## getProductID()

unsigned short openni_wrapper::OpenNIDevice::getProductID | ( |  | ) | const

noexcept

Returns
  the product ID of the USB device.

References getProductID().

Referenced by getProductID().

## getProductName()

const char * openni_wrapper::OpenNIDevice::getProductName | ( |  | ) | const

noexcept

Returns
  the product name of the USB device.

References getProductName().

Referenced by getProductName().

## getSerialNumber()

const char * openni_wrapper::OpenNIDevice::getSerialNumber | ( |  | ) | const

noexcept

returns the serial number for device.

Attention
  This might be an empty string!!!

References getSerialNumber().

Referenced by getSerialNumber().

## getVendorID()

unsigned short openni_wrapper::OpenNIDevice::getVendorID | ( |  | ) | const

noexcept

Returns
  the vendor ID of the USB device.

References getVendorID().

Referenced by getVendorID().

## getVendorName()

const char * openni_wrapper::OpenNIDevice::getVendorName | ( |  | ) | const

noexcept

Returns
  the Vendor name of the USB device.

References getVendorName().

Referenced by getVendorName().

## hasDepthStream()

bool openni_wrapper::OpenNIDevice::hasDepthStream | ( |  | ) | const

noexcept

Returns
  true if the device supports a depth stream, false otherwise.

References hasDepthStream().

Referenced by hasDepthStream().

## hasImageStream()

bool openni_wrapper::OpenNIDevice::hasImageStream | ( |  | ) | const

noexcept

Returns
  true if the device supports an image stream, false otherwise.

References hasImageStream().

Referenced by hasImageStream().

## hasIRStream()

bool openni_wrapper::OpenNIDevice::hasIRStream | ( |  | ) | const

noexcept

Returns
  true if the device supports an IR stream, false otherwise.

References hasIRStream().

Referenced by hasIRStream().

## ImageDataThreadFunction()

void openni_wrapper::OpenNIDevice::ImageDataThreadFunction | ( |  | ) |

protected

## Init()

void openni_wrapper::OpenNIDevice::Init | ( |  | ) |

protected

## InitShiftToDepthConversion()

void openni_wrapper::OpenNIDevice::InitShiftToDepthConversion | ( |  | ) |

protected

## IRDataThreadFunction()

void openni_wrapper::OpenNIDevice::IRDataThreadFunction | ( |  | ) |

protected

## isDepthCropped()

bool openni_wrapper::OpenNIDevice::isDepthCropped | ( |  | ) | const

Returns
  true if depth stream is a cropped version of the native depth stream, false otherwise.

References isDepthCropped().

Referenced by isDepthCropped().

## isDepthCroppingSupported()

bool openni_wrapper::OpenNIDevice::isDepthCroppingSupported | ( |  | ) | const

noexcept

Returns
  true if cropping of the depth stream is supported, false otherwise.

References getBaseline(), getDepthFocalLength(), getImageFocalLength(), and isDepthCroppingSupported().

Referenced by isDepthCroppingSupported().

## isDepthModeSupported()

bool openni_wrapper::OpenNIDevice::isDepthModeSupported | ( | const XnMapOutputMode & | output_mode | ) | const

noexcept

returns whether a given mode is natively supported by the device or not

Parameters

  [in] | output_mode | mode to be checked

Returns
  true if mode natively available, false otherwise

References isDepthModeSupported().

Referenced by isDepthModeSupported().

## isDepthRegistered()

bool openni_wrapper::OpenNIDevice::isDepthRegistered | ( |  | ) | const

noexcept

Returns
  whether the depth stream is registered to the RGB camera frame or not.

References isDepthRegistered().

Referenced by getDepthFocalLength(), and isDepthRegistered().

## isDepthRegistrationSupported()

bool openni_wrapper::OpenNIDevice::isDepthRegistrationSupported | ( |  | ) | const

noexcept

Returns
  whether a registration of the depth stream to the RGB camera frame is supported or not.

References isDepthRegistrationSupported().

Referenced by isDepthRegistrationSupported().

## isDepthStreamRunning()

virtual bool openni_wrapper::OpenNIDevice::isDepthStreamRunning | ( |  | ) | const

virtual noexcept

Returns
  true if the depth stream is running / started, false otherwise.

Reimplemented in openni_wrapper::DeviceONI.

References isDepthStreamRunning().

Referenced by isDepthStreamRunning().

## isImageModeSupported()

bool openni_wrapper::OpenNIDevice::isImageModeSupported | ( | const XnMapOutputMode & | output_mode | ) | const

noexcept

returns whether a given mode is natively supported by the device or not

Parameters

  [in] | output_mode | mode to be checked

Returns
  true if mode natively available, false otherwise

References isImageModeSupported().

Referenced by isImageModeSupported().

## isImageResizeSupported()

virtual bool openni_wrapper::OpenNIDevice::isImageResizeSupported | ( | unsigned | input_width,
|  | unsigned | input_height,
|  | unsigned | output_width,
|  | unsigned | output_height ) const

protected pure virtual noexcept

Implemented in openni_wrapper::DeviceKinect, openni_wrapper::DeviceONI, openni_wrapper::DevicePrimesense, and openni_wrapper::DeviceXtionPro.

## isImageStreamRunning()

virtual bool openni_wrapper::OpenNIDevice::isImageStreamRunning | ( |  | ) | const

virtual noexcept

Returns
  true if the image stream is running / started, false otherwise.

Reimplemented in openni_wrapper::DeviceONI.

References isImageStreamRunning().

Referenced by isImageStreamRunning().

## isIRStreamRunning()

virtual bool openni_wrapper::OpenNIDevice::isIRStreamRunning | ( |  | ) | const

virtual noexcept

Returns
  true if the IR stream is running / started, false otherwise.

Reimplemented in openni_wrapper::DeviceONI.

References isIRStreamRunning().

Referenced by isIRStreamRunning().

## isSynchronizationSupported()

virtual bool openni_wrapper::OpenNIDevice::isSynchronizationSupported | ( |  | ) | const

virtual noexcept

Returns
  true if the Device supports hardware synchronization between Depth and RGB streams or not.

Reimplemented in openni_wrapper::DeviceKinect.

References isSynchronizationSupported().

Referenced by isSynchronizationSupported().

## isSynchronized()

bool openni_wrapper::OpenNIDevice::isSynchronized | ( |  | ) | const

noexcept

Returns
  true if Depth stream is synchronized to RGB stream, false otherwise.

References isSynchronized().

Referenced by isSynchronized().

## NewDepthDataAvailable()

void __stdcall openni_wrapper::OpenNIDevice::NewDepthDataAvailable | ( | xn::ProductionNode & | node,
|  | void * | cookie )

static protected noexcept

## NewImageDataAvailable()

void __stdcall openni_wrapper::OpenNIDevice::NewImageDataAvailable | ( | xn::ProductionNode & | node,
|  | void * | cookie )

static protected noexcept

## NewIRDataAvailable()

void __stdcall openni_wrapper::OpenNIDevice::NewIRDataAvailable | ( | xn::ProductionNode & | node,
|  | void * | cookie )

static protected noexcept

## ReadDeviceParametersFromSensorNode()

void openni_wrapper::OpenNIDevice::ReadDeviceParametersFromSensorNode | ( |  | ) |

protected

## registerDepthCallback() [1/2]

CallbackHandle openni_wrapper::OpenNIDevice::registerDepthCallback | ( | const DepthImageCallbackFunction & | callback,
|  | void * | cookie = nullptr )

noexcept

registers a callback function of std::function type for the depth stream with an optional user defined parameter.

The callback will always be called with a new depth image and the user data "cookie".

Parameters

  [in] | callback | the user callback to be called if a new depth image is available
  [in] | cookie | the cookie that needs to be passed to the callback together with the new depth image.

Returns
  a callback handler that can be used to remove the user callback from list of depth-stream callbacks.

References registerDepthCallback().

Referenced by registerDepthCallback().

## registerDepthCallback() [2/2]

template<typename T>

OpenNIDevice::CallbackHandle openni_wrapper::OpenNIDevice::registerDepthCallback | ( | void(T::* | callback )(DepthImage::Ptr, void *cookie),
|  | T & | instance,
|  | void * | cookie = nullptr )

noexcept

registers a callback function for the depth stream with an optional user defined parameter.

This version is used to register a member function of any class. The callback will always be called with a new depth image and the user data "cookie".

Parameters

  [in] | callback | the user callback to be called if a new depth image is available
  | instance |
  [in] | cookie | the cookie that needs to be passed to the callback together with the new depth image.

Returns
  a callback handler that can be used to remove the user callback from list of depth-stream callbacks.

Definition at line 602 of file openni_device.h.

References depth_callback_, and depth_callback_handle_counter_.

## registerImageCallback() [1/2]

CallbackHandle openni_wrapper::OpenNIDevice::registerImageCallback | ( | const ImageCallbackFunction & | callback,
|  | void * | cookie = nullptr )

noexcept

registers a callback function of std::function type for the image stream with an optional user defined parameter.

The callback will always be called with a new image and the user data "cookie".

Parameters

  [in] | callback | the user callback to be called if a new image is available
  [in] | cookie | the cookie that needs to be passed to the callback together with the new image.

Returns
  a callback handler that can be used to remove the user callback from list of image-stream callbacks.

References registerImageCallback().

Referenced by registerImageCallback().

## registerImageCallback() [2/2]

template<typename T>

OpenNIDevice::CallbackHandle openni_wrapper::OpenNIDevice::registerImageCallback | ( | void(T::* | callback )(Image::Ptr, void *cookie),
|  | T & | instance,
|  | void * | cookie = nullptr )

noexcept

registers a callback function for the image stream with an optional user defined parameter.

This version is used to register a member function of any class. The callback will always be called with a new image and the user data "cookie".

Parameters

  [in] | callback | the user callback to be called if a new image is available
  | instance |
  [in] | cookie | the cookie that needs to be passed to the callback together with the new image.

Returns
  a callback handler that can be used to remove the user callback from list of image-stream callbacks.

Definition at line 594 of file openni_device.h.

References image_callback_, and image_callback_handle_counter_.

## registerIRCallback() [1/2]

CallbackHandle openni_wrapper::OpenNIDevice::registerIRCallback | ( | const IRImageCallbackFunction & | callback,
|  | void * | cookie = nullptr )

noexcept

registers a callback function of std::function type for the IR stream with an optional user defined parameter.

The callback will always be called with a new IR image and the user data "cookie".

Parameters

  [in] | callback | the user callback to be called if a new IR image is available
  [in] | cookie | the cookie that needs to be passed to the callback together with the new IR image.

Returns
  a callback handler that can be used to remove the user callback from list of IR-stream callbacks.

References registerIRCallback().

Referenced by registerIRCallback().

## registerIRCallback() [2/2]

template<typename T>

OpenNIDevice::CallbackHandle openni_wrapper::OpenNIDevice::registerIRCallback | ( | void(T::* | callback )(IRImage::Ptr, void *cookie),
|  | T & | instance,
|  | void * | cookie = nullptr )

noexcept

registers a callback function for the IR stream with an optional user defined parameter.

This version is used to register a member function of any class. The callback will always be called with a new IR image and the user data "cookie".

Parameters

  [in] | callback | the user callback to be called if a new IR image is available
  | instance |
  [in] | cookie | the cookie that needs to be passed to the callback together with the new IR image.

Returns
  a callback handler that can be used to remove the user callback from list of IR-stream callbacks.

Definition at line 610 of file openni_device.h.

References ir_callback_, and ir_callback_handle_counter_.

## setDepthCropping()

void openni_wrapper::OpenNIDevice::setDepthCropping | ( | unsigned | x,
|  | unsigned | y,
|  | unsigned | width,
|  | unsigned | height )

turn on cropping for the depth stream.

Parameters

  [in] | x | x-position of the rectangular subregion.
  [in] | y | y-position of the rectangular subregion.
  [in] | width | width of the rectangular subregion.
  [in] | height | height of the rectangular subregion.

References setDepthCropping().

Referenced by setDepthCropping().

## setDepthFocalLength()

void openni_wrapper::OpenNIDevice::setDepthFocalLength | ( | float | focal_length | ) |

inline

Set the depth image focal length.

Parameters

  [in] | focal_length | the depth image focal length

Definition at line 413 of file openni_device.h.

References depth_focal_length_SXGA_.

## setDepthOutputFormat()

void openni_wrapper::OpenNIDevice::setDepthOutputFormat | ( | const DepthMode & | depth_mode = OpenNI_12_bit_depth | ) |

Set the depth output format.

Use 12bit depth values or shift values.

Parameters

  [in] | depth_mode | the depth output format

References OpenNI_12_bit_depth.

## setDepthOutputMode()

void openni_wrapper::OpenNIDevice::setDepthOutputMode | ( | const XnMapOutputMode & | output_mode | ) |

sets the output mode of the depth stream

Parameters

  [in] | output_mode | the desired output mode

References setDepthOutputMode().

Referenced by setDepthOutputMode().

## setDepthRegistration()

void openni_wrapper::OpenNIDevice::setDepthRegistration | ( | bool | on_off | ) |

set the depth stream registration on or off

Parameters

  [in] | on_off |

References setDepthRegistration().

Referenced by setDepthRegistration().

## setImageOutputMode()

void openni_wrapper::OpenNIDevice::setImageOutputMode | ( | const XnMapOutputMode & | output_mode | ) |

sets the output mode of the image stream

Parameters

  [in] | output_mode | the desired output mode

References setImageOutputMode().

Referenced by setImageOutputMode().

## setIROutputMode()

void openni_wrapper::OpenNIDevice::setIROutputMode | ( | const XnMapOutputMode & | output_mode | ) |

sets the output mode of the IR stream

Parameters

  [in] | output_mode | the desired output mode

References setIROutputMode().

Referenced by setIROutputMode().

## setRegistration()

void openni_wrapper::OpenNIDevice::setRegistration | ( | bool | on_off | ) |

protected

## setRGBFocalLength()

void openni_wrapper::OpenNIDevice::setRGBFocalLength | ( | float | focal_length | ) |

inline

Set the RGB image focal length.

Parameters

  [in] | focal_length | the RGB image focal length

Definition at line 404 of file openni_device.h.

References rgb_focal_length_SXGA_, and setRGBFocalLength().

Referenced by setRGBFocalLength().

## setSynchronization()

void openni_wrapper::OpenNIDevice::setSynchronization | ( | bool | on_off | ) |

set the hardware synchronization between Depth and RGB stream on or off.

Parameters

  [in] | on_off |

References setSynchronization().

Referenced by setSynchronization().

## shiftToDepth()

std::uint16_t openni_wrapper::OpenNIDevice::shiftToDepth | ( | std::uint16_t | shift_value | ) | const

inline

Convert shift to depth value.

Definition at line 431 of file openni_device.h.

References shift_conversion_parameters_, and shift_to_depth_table_.

## startDepthStream()

virtual void openni_wrapper::OpenNIDevice::startDepthStream | ( |  | ) |

virtual

starts the depth stream.

Reimplemented in openni_wrapper::DeviceONI, openni_wrapper::DevicePrimesense, and openni_wrapper::DeviceXtionPro.

References startDepthStream().

Referenced by startDepthStream().

## startImageStream()

virtual void openni_wrapper::OpenNIDevice::startImageStream | ( |  | ) |

virtual

starts the image stream.

Reimplemented in openni_wrapper::DeviceONI, and openni_wrapper::DevicePrimesense.

References startImageStream().

Referenced by startImageStream().

## startIRStream()

virtual void openni_wrapper::OpenNIDevice::startIRStream | ( |  | ) |

virtual

starts the IR stream.

Reimplemented in openni_wrapper::DeviceONI.

References startIRStream().

Referenced by startIRStream().

## stopDepthStream()

virtual void openni_wrapper::OpenNIDevice::stopDepthStream | ( |  | ) |

virtual

stops the depth stream.

Reimplemented in openni_wrapper::DeviceONI.

References stopDepthStream().

Referenced by stopDepthStream().

## stopImageStream()

virtual void openni_wrapper::OpenNIDevice::stopImageStream | ( |  | ) |

virtual

stops the image stream.

Reimplemented in openni_wrapper::DeviceONI.

References stopImageStream().

Referenced by stopImageStream().

## stopIRStream()

virtual void openni_wrapper::OpenNIDevice::stopIRStream | ( |  | ) |

virtual

stops the IR stream.

Reimplemented in openni_wrapper::DeviceONI.

References stopIRStream().

Referenced by stopIRStream().

## unregisterDepthCallback()

bool openni_wrapper::OpenNIDevice::unregisterDepthCallback | ( | const CallbackHandle & | callbackHandle | ) |

noexcept

unregisters a callback function.

i.e. removes that function from the list of depth stream callbacks.

Parameters

  [in] | callbackHandle | the handle of the callback to unregister.

Returns
  true, if callback was in list and could be unregistered, false otherwise.

References unregisterDepthCallback().

Referenced by unregisterDepthCallback().

## unregisterImageCallback()

bool openni_wrapper::OpenNIDevice::unregisterImageCallback | ( | const CallbackHandle & | callbackHandle | ) |

noexcept

unregisters a callback function.

i.e. removes that function from the list of image stream callbacks.

Parameters

  [in] | callbackHandle | the handle of the callback to unregister.

Returns
  true, if callback was in list and could be unregistered, false otherwise.

References unregisterImageCallback().

Referenced by unregisterImageCallback().

## unregisterIRCallback()

bool openni_wrapper::OpenNIDevice::unregisterIRCallback | ( | const CallbackHandle & | callbackHandle | ) |

noexcept

unregisters a callback function.

i.e. removes that function from the list of IR stream callbacks.

Parameters

  [in] | callbackHandle | the handle of the callback to unregister.

Returns
  true, if callback was in list and could be unregistered, false otherwise.

References unregisterIRCallback().

Referenced by unregisterIRCallback().

## Member Data Documentation

## available_depth_modes_

std::vector<XnMapOutputMode> openni_wrapper::OpenNIDevice::available_depth_modes_

protected

Definition at line 515 of file openni_device.h.

## available_image_modes_

std::vector<XnMapOutputMode> openni_wrapper::OpenNIDevice::available_image_modes_

protected

Definition at line 514 of file openni_device.h.

## baseline_

float openni_wrapper::OpenNIDevice::baseline_

protected

distance between the projector and the IR camera

Definition at line 536 of file openni_device.h.

Referenced by getBaseline().

## context_

xn::Context& openni_wrapper::OpenNIDevice::context_

protected

context to OpenNI driver

Definition at line 518 of file openni_device.h.

## depth_callback_

std::map<CallbackHandle, ActualDepthImageCallbackFunction> openni_wrapper::OpenNIDevice::depth_callback_

protected

Definition at line 511 of file openni_device.h.

Referenced by registerDepthCallback().

## depth_callback_handle_

XnCallbackHandle openni_wrapper::OpenNIDevice::depth_callback_handle_

protected

Definition at line 529 of file openni_device.h.

## depth_callback_handle_counter_

OpenNIDevice::CallbackHandle openni_wrapper::OpenNIDevice::depth_callback_handle_counter_

protected

Definition at line 546 of file openni_device.h.

Referenced by registerDepthCallback().

## depth_condition_

std::condition_variable openni_wrapper::OpenNIDevice::depth_condition_

protected

Definition at line 554 of file openni_device.h.

## depth_focal_length_SXGA_

float openni_wrapper::OpenNIDevice::depth_focal_length_SXGA_

protected

focal length for IR camera producing depth information in native SXGA mode

Definition at line 534 of file openni_device.h.

Referenced by getDepthFocalLength(), and setDepthFocalLength().

## depth_generator_

xn::DepthGenerator openni_wrapper::OpenNIDevice::depth_generator_

protected

Depth generator object.

Definition at line 523 of file openni_device.h.

## depth_mutex_

std::mutex openni_wrapper::OpenNIDevice::depth_mutex_

mutable protected

Definition at line 551 of file openni_device.h.

## depth_thread_

std::thread openni_wrapper::OpenNIDevice::depth_thread_

protected

Definition at line 557 of file openni_device.h.

## device_node_info_

xn::NodeInfo openni_wrapper::OpenNIDevice::device_node_info_

protected

node object for current device

Definition at line 520 of file openni_device.h.

## image_callback_

std::map<CallbackHandle, ActualImageCallbackFunction> openni_wrapper::OpenNIDevice::image_callback_

protected

Definition at line 510 of file openni_device.h.

Referenced by registerImageCallback().

## image_callback_handle_

XnCallbackHandle openni_wrapper::OpenNIDevice::image_callback_handle_

protected

Definition at line 530 of file openni_device.h.

## image_callback_handle_counter_

OpenNIDevice::CallbackHandle openni_wrapper::OpenNIDevice::image_callback_handle_counter_

protected

Definition at line 545 of file openni_device.h.

Referenced by registerImageCallback().

## image_condition_

std::condition_variable openni_wrapper::OpenNIDevice::image_condition_

protected

Definition at line 553 of file openni_device.h.

## image_generator_

xn::ImageGenerator openni_wrapper::OpenNIDevice::image_generator_

protected

Image generator object.

Definition at line 525 of file openni_device.h.

## image_mutex_

std::mutex openni_wrapper::OpenNIDevice::image_mutex_

mutable protected

Definition at line 550 of file openni_device.h.

## image_thread_

std::thread openni_wrapper::OpenNIDevice::image_thread_

protected

Definition at line 556 of file openni_device.h.

## ir_callback_

std::map<CallbackHandle, ActualIRImageCallbackFunction> openni_wrapper::OpenNIDevice::ir_callback_

protected

Definition at line 512 of file openni_device.h.

Referenced by registerIRCallback().

## ir_callback_handle_

XnCallbackHandle openni_wrapper::OpenNIDevice::ir_callback_handle_

protected

Definition at line 531 of file openni_device.h.

## ir_callback_handle_counter_

OpenNIDevice::CallbackHandle openni_wrapper::OpenNIDevice::ir_callback_handle_counter_

protected

Definition at line 547 of file openni_device.h.

Referenced by registerIRCallback().

## ir_condition_

std::condition_variable openni_wrapper::OpenNIDevice::ir_condition_

protected

Definition at line 555 of file openni_device.h.

## ir_generator_

xn::IRGenerator openni_wrapper::OpenNIDevice::ir_generator_

protected

IR generator object.

Definition at line 527 of file openni_device.h.

## ir_mutex_

std::mutex openni_wrapper::OpenNIDevice::ir_mutex_

mutable protected

Definition at line 552 of file openni_device.h.

## ir_thread_

std::thread openni_wrapper::OpenNIDevice::ir_thread_

protected

Definition at line 558 of file openni_device.h.

## no_sample_value_

XnUInt64 openni_wrapper::OpenNIDevice::no_sample_value_

protected

the value for pixels without a valid disparity measurement

Definition at line 543 of file openni_device.h.

## quit_

bool openni_wrapper::OpenNIDevice::quit_

protected

Definition at line 549 of file openni_device.h.

## rgb_focal_length_SXGA_

float openni_wrapper::OpenNIDevice::rgb_focal_length_SXGA_

protected

focal length for regular camera producing color images in native SXGA mode

Definition at line 538 of file openni_device.h.

Referenced by getDepthFocalLength(), getImageFocalLength(), and setRGBFocalLength().

## shadow_value_

XnUInt64 openni_wrapper::OpenNIDevice::shadow_value_

protected

the value for shadow (occluded pixels)

Definition at line 541 of file openni_device.h.

## shift_conversion_parameters_

struct openni_wrapper::OpenNIDevice::ShiftConversion openni_wrapper::OpenNIDevice::shift_conversion_parameters_

protected

Referenced by shiftToDepth().

## shift_to_depth_table_

std::vector<std::uint16_t> openni_wrapper::OpenNIDevice::shift_to_depth_table_

protected

Definition at line 505 of file openni_device.h.

Referenced by shiftToDepth().

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

- pcl/io/openni_camera/openni_device.h