Point Cloud Library (PCL)  1.8.1-dev
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes
openni_wrapper::OpenNIDevice Class Referenceabstract

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 }
 
typedef boost::function< void(boost::shared_ptr
< Image >, void *cookie) > 
ImageCallbackFunction
 
typedef boost::function< void(boost::shared_ptr
< DepthImage >, void *cookie) > 
DepthImageCallbackFunction
 
typedef boost::function< void(boost::shared_ptr
< IRImage >, void *cookie) > 
IRImageCallbackFunction
 
typedef unsigned CallbackHandle
 

Public Member Functions

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

Protected Types

typedef boost::function< void(boost::shared_ptr
< Image >) > 
ActualImageCallbackFunction
 
typedef boost::function< void(boost::shared_ptr
< DepthImage >) > 
ActualDepthImageCallbackFunction
 
typedef boost::function< void(boost::shared_ptr
< IRImage >) > 
ActualIRImageCallbackFunction
 

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 =0 throw ()
 
void setRegistration (bool on_off)
 
virtual boost::shared_ptr< ImagegetCurrentImage (boost::shared_ptr< xn::ImageMetaData > image_data) const =0 throw ()
 
void Init ()
 
void InitShiftToDepthConversion ()
 
void ReadDeviceParametersFromSensorNode ()
 

Static Protected Member Functions

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

Protected Attributes

struct
openni_wrapper::OpenNIDevice::ShiftConversion 
shift_conversion_parameters_
 
std::vector< pcl::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 More...
 
xn::NodeInfo device_node_info_
 node object for current device More...
 
xn::DepthGenerator depth_generator_
 Depth generator object. More...
 
xn::ImageGenerator image_generator_
 Image generator object. More...
 
xn::IRGenerator ir_generator_
 IR generator object. More...
 
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 More...
 
float baseline_
 distance between the projector and the IR camera More...
 
float rgb_focal_length_SXGA_
 focal length for regular camera producing color images in native SXGA mode More...
 
XnUInt64 shadow_value_
 the value for shadow (occluded pixels) More...
 
XnUInt64 no_sample_value_
 the value for pixels without a valid disparity measurement More...
 
OpenNIDevice::CallbackHandle image_callback_handle_counter_
 
OpenNIDevice::CallbackHandle depth_callback_handle_counter_
 
OpenNIDevice::CallbackHandle ir_callback_handle_counter_
 
bool quit_
 
boost::mutex image_mutex_
 
boost::mutex depth_mutex_
 
boost::mutex ir_mutex_
 
boost::condition_variable image_condition_
 
boost::condition_variable depth_condition_
 
boost::condition_variable ir_condition_
 
boost::thread image_thread_
 
boost::thread depth_thread_
 
boost::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 69 of file openni_device.h.

Member Typedef Documentation

typedef boost::function<void(boost::shared_ptr<DepthImage>) > openni_wrapper::OpenNIDevice::ActualDepthImageCallbackFunction
protected

Definition at line 445 of file openni_device.h.

typedef boost::function<void(boost::shared_ptr<Image>) > openni_wrapper::OpenNIDevice::ActualImageCallbackFunction
protected

Definition at line 444 of file openni_device.h.

typedef boost::function<void(boost::shared_ptr<IRImage>) > openni_wrapper::OpenNIDevice::ActualIRImageCallbackFunction
protected

Definition at line 446 of file openni_device.h.

Definition at line 81 of file openni_device.h.

typedef boost::function<void(boost::shared_ptr<DepthImage>, void* cookie) > openni_wrapper::OpenNIDevice::DepthImageCallbackFunction

Definition at line 79 of file openni_device.h.

typedef boost::function<void(boost::shared_ptr<Image>, void* cookie) > openni_wrapper::OpenNIDevice::ImageCallbackFunction

Definition at line 78 of file openni_device.h.

typedef boost::function<void(boost::shared_ptr<IRImage>, void* cookie) > openni_wrapper::OpenNIDevice::IRImageCallbackFunction

Definition at line 80 of file openni_device.h.

Member Enumeration Documentation

Enumerator
OpenNI_shift_values 
OpenNI_12_bit_depth 

Definition at line 72 of file openni_device.h.

Constructor & Destructor Documentation

virtual openni_wrapper::OpenNIDevice::~OpenNIDevice ( )
throw (
)
virtual

virtual destructor.

Never throws an exception.

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
openni_wrapper::OpenNIDevice::OpenNIDevice ( xn::Context &  context,
const xn::NodeInfo &  device_node,
const xn::NodeInfo &  depth_node,
const xn::NodeInfo &  ir_node 
)
protected
openni_wrapper::OpenNIDevice::OpenNIDevice ( xn::Context &  context)
protected

Member Function Documentation

void openni_wrapper::OpenNIDevice::DepthDataThreadFunction ( )
protected
bool openni_wrapper::OpenNIDevice::findCompatibleDepthMode ( const XnMapOutputMode &  output_mode,
XnMapOutputMode &  mode 
) const
throw (
)

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 possbile by downsampling, but the modes VGA at 25Hz and SXGA at 30Hz would not be compatible.

Parameters
[in]output_modethe desired output mode
[out]modethe compatible mode that the device natively supports.
Returns
true, if a compatible mode could be found, false otherwise.
bool openni_wrapper::OpenNIDevice::findCompatibleImageMode ( const XnMapOutputMode &  output_mode,
XnMapOutputMode &  mode 
) const
throw (
)

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_modethe desired output mode
[out]modethe compatible mode that the device natively supports.
Returns
true, if a compatible mode could be found, false otherwise.
unsigned char openni_wrapper::OpenNIDevice::getAddress ( ) const
throw (
)
Returns
the USB Address of the device.
float openni_wrapper::OpenNIDevice::getBaseline ( ) const
throw (
)
inline
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 583 of file openni_device.h.

References baseline_.

unsigned char openni_wrapper::OpenNIDevice::getBus ( ) const
throw (
)
Returns
the USB bus on which the device is connected.
const char* openni_wrapper::OpenNIDevice::getConnectionString ( ) const
throw (
)

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

virtual boost::shared_ptr<Image> openni_wrapper::OpenNIDevice::getCurrentImage ( boost::shared_ptr< xn::ImageMetaData >  image_data) const
throw (
)
protectedpure virtual
const XnMapOutputMode& openni_wrapper::OpenNIDevice::getDefaultDepthMode ( ) const
throw (
)

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

Returns
the default depth mode
const XnMapOutputMode& openni_wrapper::OpenNIDevice::getDefaultImageMode ( ) const
throw (
)

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

Returns
the default image mode
const XnMapOutputMode& openni_wrapper::OpenNIDevice::getDefaultIRMode ( ) const
throw (
)

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

Returns
the default IR mode
float openni_wrapper::OpenNIDevice::getDepthFocalLength ( int  output_x_resolution = 0) const
throw (
)
inline

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 569 of file openni_device.h.

XnUInt64 openni_wrapper::OpenNIDevice::getDepthOutputFormat ( ) const

Get the depth output format as set by the user.

XnMapOutputMode openni_wrapper::OpenNIDevice::getDepthOutputMode ( ) const
Returns
the current output mode of the depth stream
float openni_wrapper::OpenNIDevice::getImageFocalLength ( int  output_x_resolution = 0) const
throw (
)
inline

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 558 of file openni_device.h.

XnMapOutputMode openni_wrapper::OpenNIDevice::getImageOutputMode ( ) const
Returns
the current output mode of the image stream
XnMapOutputMode openni_wrapper::OpenNIDevice::getIROutputMode ( ) const
Returns
the current output mode of the IR stream
unsigned short openni_wrapper::OpenNIDevice::getProductID ( ) const
throw (
)
Returns
the product ID of the USB device.
const char* openni_wrapper::OpenNIDevice::getProductName ( ) const
throw (
)
Returns
the product name of the USB device.
const char* openni_wrapper::OpenNIDevice::getSerialNumber ( ) const
throw (
)

returns the serial number for device.

Attention
This might be an empty string!!!
unsigned short openni_wrapper::OpenNIDevice::getVendorID ( ) const
throw (
)
Returns
the vendor ID of the USB device.
const char* openni_wrapper::OpenNIDevice::getVendorName ( ) const
throw (
)
Returns
the Vendor name of the USB device.
bool openni_wrapper::OpenNIDevice::hasDepthStream ( ) const
throw (
)
Returns
true if the device supports a depth stream, false otherwise.
bool openni_wrapper::OpenNIDevice::hasImageStream ( ) const
throw (
)
Returns
true if the device supports an image stream, false otherwise.
bool openni_wrapper::OpenNIDevice::hasIRStream ( ) const
throw (
)
Returns
true if the device supports an IR stream, false otherwise.
void openni_wrapper::OpenNIDevice::ImageDataThreadFunction ( )
protected
void openni_wrapper::OpenNIDevice::Init ( )
protected
void openni_wrapper::OpenNIDevice::InitShiftToDepthConversion ( )
protected
void openni_wrapper::OpenNIDevice::IRDataThreadFunction ( )
protected
bool openni_wrapper::OpenNIDevice::isDepthCropped ( ) const
Returns
true if depth stream is a cropped version of the native depth stream, false otherwise.
bool openni_wrapper::OpenNIDevice::isDepthCroppingSupported ( ) const
throw (
)
Returns
true if cropping of the depth stream is supported, false otherwise.
bool openni_wrapper::OpenNIDevice::isDepthModeSupported ( const XnMapOutputMode &  output_mode) const
throw (
)

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

Parameters
[in]output_modemode to be checked
Returns
true if mode natively available, false otherwise
bool openni_wrapper::OpenNIDevice::isDepthRegistered ( ) const
throw (
)
Returns
whether the depth stream is registered to the RGB camera fram or not.
bool openni_wrapper::OpenNIDevice::isDepthRegistrationSupported ( ) const
throw (
)
Returns
whether a registration of the depth stream to the RGB camera frame is supported or not.
virtual bool openni_wrapper::OpenNIDevice::isDepthStreamRunning ( ) const
throw (
)
virtual
Returns
true if the depth stream is running / started, false otherwise.

Reimplemented in openni_wrapper::DeviceONI.

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

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

Parameters
[in]output_modemode to be checked
Returns
true if mode natively available, false otherwise
virtual bool openni_wrapper::OpenNIDevice::isImageResizeSupported ( unsigned  input_width,
unsigned  input_height,
unsigned  output_width,
unsigned  output_height 
) const
throw (
)
protectedpure virtual
virtual bool openni_wrapper::OpenNIDevice::isImageStreamRunning ( ) const
throw (
)
virtual
Returns
true if the image stream is running / started, false otherwise.

Reimplemented in openni_wrapper::DeviceONI.

virtual bool openni_wrapper::OpenNIDevice::isIRStreamRunning ( ) const
throw (
)
virtual
Returns
true if the IR stream is running / started, false otherwise.

Reimplemented in openni_wrapper::DeviceONI.

virtual bool openni_wrapper::OpenNIDevice::isSynchronizationSupported ( ) const
throw (
)
virtual
Returns
true if the Device supports hardware synchronization between Depth and RGB streams or not.

Reimplemented in openni_wrapper::DeviceKinect.

bool openni_wrapper::OpenNIDevice::isSynchronized ( ) const
throw (
)
Returns
true if Depth stream is synchronized to RGB stream, false otherwise.
static void __stdcall openni_wrapper::OpenNIDevice::NewDepthDataAvailable ( xn::ProductionNode &  node,
void *  cookie 
)
throw (
)
staticprotected
static void __stdcall openni_wrapper::OpenNIDevice::NewImageDataAvailable ( xn::ProductionNode &  node,
void *  cookie 
)
throw (
)
staticprotected
static void __stdcall openni_wrapper::OpenNIDevice::NewIRDataAvailable ( xn::ProductionNode &  node,
void *  cookie 
)
throw (
)
staticprotected
void openni_wrapper::OpenNIDevice::ReadDeviceParametersFromSensorNode ( )
protected
CallbackHandle openni_wrapper::OpenNIDevice::registerDepthCallback ( const DepthImageCallbackFunction callback,
void *  cookie = NULL 
)
throw (
)

registers a callback function of boost::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]callbackthe user callback to be called if a new depth image is available
[in]cookiethe 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.
template<typename T >
OpenNIDevice::CallbackHandle openni_wrapper::OpenNIDevice::registerDepthCallback ( void(T::*)(boost::shared_ptr< DepthImage >, void *cookie)  callback,
T &  instance,
void *  cookie = NULL 
)
throw (
)

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]callbackthe user callback to be called if a new depth image is available
instance
[in]cookiethe 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 598 of file openni_device.h.

CallbackHandle openni_wrapper::OpenNIDevice::registerImageCallback ( const ImageCallbackFunction callback,
void *  cookie = NULL 
)
throw (
)

registers a callback function of boost::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]callbackthe user callback to be called if a new image is available
[in]cookiethe 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.
template<typename T >
OpenNIDevice::CallbackHandle openni_wrapper::OpenNIDevice::registerImageCallback ( void(T::*)(boost::shared_ptr< Image >, void *cookie)  callback,
T &  instance,
void *  cookie = NULL 
)
throw (
)

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]callbackthe user callback to be called if a new image is available
instance
[in]cookiethe 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 590 of file openni_device.h.

CallbackHandle openni_wrapper::OpenNIDevice::registerIRCallback ( const IRImageCallbackFunction callback,
void *  cookie = NULL 
)
throw (
)

registers a callback function of boost::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]callbackthe user callback to be called if a new IR image is available
[in]cookiethe 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.
template<typename T >
OpenNIDevice::CallbackHandle openni_wrapper::OpenNIDevice::registerIRCallback ( void(T::*)(boost::shared_ptr< IRImage >, void *cookie)  callback,
T &  instance,
void *  cookie = NULL 
)
throw (
)

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]callbackthe user callback to be called if a new IR image is available
instance
[in]cookiethe 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 606 of file openni_device.h.

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

turn on cropping for the depth stream.

Parameters
[in]xx-position of the rectangular subregion.
[in]yy-position of the rectangular subregion.
[in]widthwidth of the rectangular subregion.
[in]heightheight of the rectangular subregion.
void openni_wrapper::OpenNIDevice::setDepthFocalLength ( float  focal_length)
inline

Set the depth image focal length.

Parameters
[in]focal_lengththe depth image focal length

Definition at line 408 of file openni_device.h.

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_modethe depth output format
void openni_wrapper::OpenNIDevice::setDepthOutputMode ( const XnMapOutputMode &  output_mode)

sets the output mode of the depth stream

Parameters
[in]output_modethe desired output mode
void openni_wrapper::OpenNIDevice::setDepthRegistration ( bool  on_off)

set the depth stream registration on or off

Parameters
[in]on_off
void openni_wrapper::OpenNIDevice::setImageOutputMode ( const XnMapOutputMode &  output_mode)

sets the output mode of the image stream

Parameters
[in]output_modethe desired output mode
void openni_wrapper::OpenNIDevice::setIROutputMode ( const XnMapOutputMode &  output_mode)

sets the output mode of the IR stream

Parameters
[in]output_modethe desired output mode
void openni_wrapper::OpenNIDevice::setRegistration ( bool  on_off)
protected
void openni_wrapper::OpenNIDevice::setRGBFocalLength ( float  focal_length)
inline

Set the RGB image focal length.

Parameters
[in]focal_lengththe RGB image focal length

Definition at line 399 of file openni_device.h.

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

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

Parameters
[in]on_off
pcl::uint16_t openni_wrapper::OpenNIDevice::shiftToDepth ( pcl::uint16_t  shift_value) const
inline

Convert shift to depth value.

Definition at line 426 of file openni_device.h.

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

starts the image stream.

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

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

starts the IR stream.

Reimplemented in openni_wrapper::DeviceONI.

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

stops the depth stream.

Reimplemented in openni_wrapper::DeviceONI.

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

stops the image stream.

Reimplemented in openni_wrapper::DeviceONI.

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

stops the IR stream.

Reimplemented in openni_wrapper::DeviceONI.

bool openni_wrapper::OpenNIDevice::unregisterDepthCallback ( const CallbackHandle callbackHandle)
throw (
)

unregisters a callback function.

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

Parameters
[in]callbackHandlethe handle of the callback to unregister.
Returns
true, if callback was in list and could be unregistered, false otherwise.
bool openni_wrapper::OpenNIDevice::unregisterImageCallback ( const CallbackHandle callbackHandle)
throw (
)

unregisters a callback function.

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

Parameters
[in]callbackHandlethe handle of the callback to unregister.
Returns
true, if callback was in list and could be unregistered, false otherwise.
bool openni_wrapper::OpenNIDevice::unregisterIRCallback ( const CallbackHandle callbackHandle)
throw (
)

unregisters a callback function.

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

Parameters
[in]callbackHandlethe handle of the callback to unregister.
Returns
true, if callback was in list and could be unregistered, false otherwise.

Member Data Documentation

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

Definition at line 510 of file openni_device.h.

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

Definition at line 509 of file openni_device.h.

float openni_wrapper::OpenNIDevice::baseline_
protected

distance between the projector and the IR camera

Definition at line 531 of file openni_device.h.

Referenced by getBaseline().

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

context to OpenNI driver

Definition at line 513 of file openni_device.h.

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

Definition at line 506 of file openni_device.h.

XnCallbackHandle openni_wrapper::OpenNIDevice::depth_callback_handle_
protected

Definition at line 524 of file openni_device.h.

OpenNIDevice::CallbackHandle openni_wrapper::OpenNIDevice::depth_callback_handle_counter_
protected

Definition at line 541 of file openni_device.h.

boost::condition_variable openni_wrapper::OpenNIDevice::depth_condition_
protected

Definition at line 549 of file openni_device.h.

float openni_wrapper::OpenNIDevice::depth_focal_length_SXGA_
protected

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

Definition at line 529 of file openni_device.h.

xn::DepthGenerator openni_wrapper::OpenNIDevice::depth_generator_
protected

Depth generator object.

Definition at line 518 of file openni_device.h.

boost::mutex openni_wrapper::OpenNIDevice::depth_mutex_
mutableprotected

Definition at line 546 of file openni_device.h.

boost::thread openni_wrapper::OpenNIDevice::depth_thread_
protected

Definition at line 552 of file openni_device.h.

xn::NodeInfo openni_wrapper::OpenNIDevice::device_node_info_
protected

node object for current device

Definition at line 515 of file openni_device.h.

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

Definition at line 505 of file openni_device.h.

XnCallbackHandle openni_wrapper::OpenNIDevice::image_callback_handle_
protected

Definition at line 525 of file openni_device.h.

OpenNIDevice::CallbackHandle openni_wrapper::OpenNIDevice::image_callback_handle_counter_
protected

Definition at line 540 of file openni_device.h.

boost::condition_variable openni_wrapper::OpenNIDevice::image_condition_
protected

Definition at line 548 of file openni_device.h.

xn::ImageGenerator openni_wrapper::OpenNIDevice::image_generator_
protected

Image generator object.

Definition at line 520 of file openni_device.h.

boost::mutex openni_wrapper::OpenNIDevice::image_mutex_
mutableprotected

Definition at line 545 of file openni_device.h.

boost::thread openni_wrapper::OpenNIDevice::image_thread_
protected

Definition at line 551 of file openni_device.h.

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

Definition at line 507 of file openni_device.h.

XnCallbackHandle openni_wrapper::OpenNIDevice::ir_callback_handle_
protected

Definition at line 526 of file openni_device.h.

OpenNIDevice::CallbackHandle openni_wrapper::OpenNIDevice::ir_callback_handle_counter_
protected

Definition at line 542 of file openni_device.h.

boost::condition_variable openni_wrapper::OpenNIDevice::ir_condition_
protected

Definition at line 550 of file openni_device.h.

xn::IRGenerator openni_wrapper::OpenNIDevice::ir_generator_
protected

IR generator object.

Definition at line 522 of file openni_device.h.

boost::mutex openni_wrapper::OpenNIDevice::ir_mutex_
mutableprotected

Definition at line 547 of file openni_device.h.

boost::thread openni_wrapper::OpenNIDevice::ir_thread_
protected

Definition at line 553 of file openni_device.h.

XnUInt64 openni_wrapper::OpenNIDevice::no_sample_value_
protected

the value for pixels without a valid disparity measurement

Definition at line 538 of file openni_device.h.

bool openni_wrapper::OpenNIDevice::quit_
protected

Definition at line 544 of file openni_device.h.

float openni_wrapper::OpenNIDevice::rgb_focal_length_SXGA_
protected

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

Definition at line 533 of file openni_device.h.

XnUInt64 openni_wrapper::OpenNIDevice::shadow_value_
protected

the value for shadow (occluded pixels)

Definition at line 536 of file openni_device.h.

struct openni_wrapper::OpenNIDevice::ShiftConversion openni_wrapper::OpenNIDevice::shift_conversion_parameters_
protected
std::vector<pcl::uint16_t> openni_wrapper::OpenNIDevice::shift_to_depth_table_
protected

Definition at line 500 of file openni_device.h.


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