Public Types | Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes
openni_wrapper::OpenNIDevice Class Reference

Class representing an astract device for Primesense or MS Kinect devices. More...

#include <openni_device.h>

Inheritance diagram for openni_wrapper::OpenNIDevice:
Inheritance graph
[legend]

List of all members.

Public Types

typedef unsigned CallbackHandle
typedef boost::function< void(boost::shared_ptr
< DepthImage >, void *cookie) 
DepthImageCallbackFunction )
typedef boost::function< void(boost::shared_ptr
< Image >, void *cookie) 
ImageCallbackFunction )
typedef boost::function< void(boost::shared_ptr
< IRImage >, void *cookie) 
IRImageCallbackFunction )

Public Member Functions

virtual bool findCompatibleDepthMode (const XnMapOutputMode &output_mode, XnMapOutputMode &mode) const throw (OpenNIException)
virtual bool findCompatibleImageMode (const XnMapOutputMode &output_mode, XnMapOutputMode &mode) const throw (OpenNIException)
unsigned char getAddress () const throw ()
float getBaseline () const throw ()
unsigned char getBus () const throw ()
const char * getConnectionString () const throw ()
 returns the connectionstring for current device, which has following format vendorID/productID@BusID/DeviceID
virtual const XnMapOutputMode & getDefaultDepthMode () const throw ()
virtual const XnMapOutputMode & getDefaultImageMode () const throw ()
virtual const XnMapOutputMode & getDefaultIRMode () const throw ()
float getDepthFocalLength (int output_x_resolution=0) const throw ()
 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.
XnMapOutputMode getDepthOutputMode () const throw (OpenNIException)
float getImageFocalLength (int output_x_resolution=0) const throw ()
 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.
XnMapOutputMode getImageOutputMode () const throw (OpenNIException)
XnMapOutputMode getIROutputMode () const throw (OpenNIException)
unsigned short getProductID () const throw ()
const char * getProductName () const throw ()
const char * getSerialNumber () throw ()
 returns the serial number for device.
unsigned short getVendorID () const throw ()
const char * getVendorName () const throw ()
bool hasDepthStream () const throw ()
bool hasImageStream () const throw ()
bool hasIRStream () const throw ()
virtual bool isDepthCropped () const throw (OpenNIException)
virtual bool isDepthCroppingSupported () const throw ()
virtual bool isDepthModeSupported (const XnMapOutputMode &output_mode) const throw (OpenNIException)
bool isDepthRegistered () const throw (OpenNIException)
virtual bool isDepthRegistrationSupported () const throw (OpenNIException)
virtual bool isDepthStreamRunning () const throw (OpenNIException)
virtual bool isImageModeSupported (const XnMapOutputMode &output_mode) const throw (OpenNIException)
virtual bool isImageStreamRunning () const throw (OpenNIException)
virtual bool isIRStreamRunning () const throw (OpenNIException)
virtual bool isSynchronizationSupported () const throw ()
virtual bool isSynchronized () const throw (OpenNIException)
CallbackHandle registerDepthCallback (const DepthImageCallbackFunction &callback, void *cookie=NULL) throw ()
template<typename T >
CallbackHandle registerDepthCallback (void(T::*callback)(boost::shared_ptr< DepthImage >, void *cookie), T &instance, void *cookie=NULL) throw ()
CallbackHandle registerImageCallback (const ImageCallbackFunction &callback, void *cookie=NULL) throw ()
template<typename T >
CallbackHandle registerImageCallback (void(T::*callback)(boost::shared_ptr< Image >, void *cookie), T &instance, void *cookie=NULL) throw ()
CallbackHandle registerIRCallback (const IRImageCallbackFunction &callback, void *cookie=NULL) throw ()
template<typename T >
CallbackHandle registerIRCallback (void(T::*callback)(boost::shared_ptr< IRImage >, void *cookie), T &instance, void *cookie=NULL) throw ()
virtual void setDepthCropping (unsigned x, unsigned y, unsigned width, unsigned height) throw (OpenNIException)
virtual void setDepthOutputMode (const XnMapOutputMode &output_mode) throw (OpenNIException)
virtual void setDepthRegistration (bool on_off) throw (OpenNIException)
virtual void setImageOutputMode (const XnMapOutputMode &output_mode) throw (OpenNIException)
virtual void setIROutputMode (const XnMapOutputMode &output_mode) throw (OpenNIException)
virtual void setSynchronization (bool on_off) throw (OpenNIException)
void shutdown ()
virtual void startDepthStream () throw (OpenNIException)
virtual void startImageStream () throw (OpenNIException)
virtual void startIRStream () throw (OpenNIException)
virtual void stopDepthStream () throw (OpenNIException)
virtual void stopImageStream () throw (OpenNIException)
virtual void stopIRStream () throw (OpenNIException)
bool unregisterDepthCallback (const CallbackHandle &callbackHandle) throw ()
bool unregisterImageCallback (const CallbackHandle &callbackHandle) throw ()
bool unregisterIRCallback (const CallbackHandle &callbackHandle) throw ()
virtual ~OpenNIDevice () throw ()

Protected Types

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

Protected Member Functions

void DepthDataThreadFunction () throw (OpenNIException)
virtual void enumAvailableModes () throw (OpenNIException)
virtual boost::shared_ptr< ImagegetCurrentImage (boost::shared_ptr< xn::ImageMetaData > image_data) const =0 throw ()
void ImageDataThreadFunction () throw (OpenNIException)
void Init () throw (OpenNIException)
void IRDataThreadFunction () throw (OpenNIException)
virtual bool isImageResizeSupported (unsigned input_width, unsigned input_height, unsigned output_width, unsigned output_height) const =0 throw ()
 OpenNIDevice (xn::Context &context, const xn::NodeInfo &device_node, const xn::NodeInfo &image_node, const xn::NodeInfo &depth_node, const xn::NodeInfo &ir_node) throw (OpenNIException)
 OpenNIDevice (xn::Context &context, const xn::NodeInfo &device_node, const xn::NodeInfo &depth_node, const xn::NodeInfo &ir_node) throw (OpenNIException)
 OpenNIDevice (xn::Context &context) throw (OpenNIException)
void setRegistration (bool on_off) throw (OpenNIException)

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

std::vector< XnMapOutputMode > available_depth_modes_
std::vector< XnMapOutputMode > available_image_modes_
float baseline_
 distance between the projector and the IR camera
xn::Context & context_
 context to OpenNI driver
boost::thread_group data_threads_
std::map< CallbackHandle,
ActualDepthImageCallbackFunction
depth_callback_
XnCallbackHandle depth_callback_handle_
OpenNIDevice::CallbackHandle depth_callback_handle_counter_
boost::condition_variable depth_condition_
float depth_focal_length_SXGA_
 focal length for IR camera producing depth information in native SXGA mode
xn::DepthGenerator depth_generator_
 Depth generator object.
boost::mutex depth_mutex_
xn::NodeInfo device_node_info_
 node object for current device
std::map< CallbackHandle,
ActualImageCallbackFunction
image_callback_
XnCallbackHandle image_callback_handle_
OpenNIDevice::CallbackHandle image_callback_handle_counter_
boost::condition_variable image_condition_
xn::ImageGenerator image_generator_
 Image generator object.
boost::mutex image_mutex_
std::map< CallbackHandle,
ActualIRImageCallbackFunction
ir_callback_
XnCallbackHandle ir_callback_handle_
OpenNIDevice::CallbackHandle ir_callback_handle_counter_
boost::condition_variable ir_condition_
xn::IRGenerator ir_generator_
 IR generator object.
boost::mutex ir_mutex_
XnUInt64 no_sample_value_
bool quit_
XnUInt64 shadow_value_

Static Protected Attributes

static const float rgb_focal_length_SXGA_ = 1050
 focal length for regular camera producing color images in native SXGA mode

Detailed Description

Class representing an astract device for Primesense or MS Kinect devices.

Author:
Suat Gedikli
Date:
02.january 2011

Definition at line 66 of file openni_device.h.


Member Typedef Documentation

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

Definition at line 164 of file openni_device.h.

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

Definition at line 163 of file openni_device.h.

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

Definition at line 165 of file openni_device.h.

Definition at line 72 of file openni_device.h.

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

Definition at line 70 of file openni_device.h.

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

Definition at line 69 of file openni_device.h.

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

Definition at line 71 of file openni_device.h.


Constructor & Destructor Documentation

Definition at line 128 of file openni_device.cpp.

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 
) throw (OpenNIException) [protected]

Definition at line 54 of file openni_device.cpp.

openni_wrapper::OpenNIDevice::OpenNIDevice ( xn::Context &  context,
const xn::NodeInfo &  device_node,
const xn::NodeInfo &  depth_node,
const xn::NodeInfo &  ir_node 
) throw (OpenNIException) [protected]

Definition at line 92 of file openni_device.cpp.

openni_wrapper::OpenNIDevice::OpenNIDevice ( xn::Context &  context) throw (OpenNIException) [protected]

Definition at line 122 of file openni_device.cpp.


Member Function Documentation

Definition at line 522 of file openni_device.cpp.

bool openni_wrapper::OpenNIDevice::findCompatibleDepthMode ( const XnMapOutputMode &  output_mode,
XnMapOutputMode &  mode 
) const throw (OpenNIException) [virtual]

Definition at line 782 of file openni_device.cpp.

bool openni_wrapper::OpenNIDevice::findCompatibleImageMode ( const XnMapOutputMode &  output_mode,
XnMapOutputMode &  mode 
) const throw (OpenNIException) [virtual]

Definition at line 752 of file openni_device.cpp.

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

Definition at line 728 of file openni_device.cpp.

float openni_wrapper::OpenNIDevice::getBaseline ( ) const throw () [inline]

Definition at line 260 of file openni_device.h.

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

Definition at line 716 of file openni_device.cpp.

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

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

Definition at line 679 of file openni_device.cpp.

virtual boost::shared_ptr<Image> openni_wrapper::OpenNIDevice::getCurrentImage ( boost::shared_ptr< xn::ImageMetaData >  image_data) const throw () [protected, pure virtual]
const XnMapOutputMode & openni_wrapper::OpenNIDevice::getDefaultDepthMode ( ) const throw () [virtual]

Definition at line 875 of file openni_device.cpp.

const XnMapOutputMode & openni_wrapper::OpenNIDevice::getDefaultImageMode ( ) const throw () [virtual]

Definition at line 870 of file openni_device.cpp.

const XnMapOutputMode & openni_wrapper::OpenNIDevice::getDefaultIRMode ( ) const throw () [virtual]
Todo:
Something else here?

Definition at line 880 of file openni_device.cpp.

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

Definition at line 938 of file openni_device.cpp.

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

Definition at line 925 of file openni_device.cpp.

Definition at line 951 of file openni_device.cpp.

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

Definition at line 701 of file openni_device.cpp.

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

Definition at line 746 of file openni_device.cpp.

returns the serial number for device.

Attention:
This might be an empty string!!!

Definition at line 656 of file openni_device.cpp.

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

Definition at line 684 of file openni_device.cpp.

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

Definition at line 740 of file openni_device.cpp.

Definition at line 340 of file openni_device.cpp.

Definition at line 333 of file openni_device.cpp.

Definition at line 347 of file openni_device.cpp.

Definition at line 492 of file openni_device.cpp.

Definition at line 162 of file openni_device.cpp.

Definition at line 554 of file openni_device.cpp.

Reimplemented in openni_wrapper::DeviceKinect.

Definition at line 456 of file openni_device.cpp.

bool openni_wrapper::OpenNIDevice::isDepthCroppingSupported ( ) const throw () [virtual]

Reimplemented in openni_wrapper::DeviceKinect.

Definition at line 450 of file openni_device.cpp.

bool openni_wrapper::OpenNIDevice::isDepthModeSupported ( const XnMapOutputMode &  output_mode) const throw (OpenNIException) [virtual]

Definition at line 860 of file openni_device.cpp.

Definition at line 382 of file openni_device.cpp.

Definition at line 396 of file openni_device.cpp.

Reimplemented in openni_wrapper::DeviceONI.

Definition at line 321 of file openni_device.cpp.

bool openni_wrapper::OpenNIDevice::isImageModeSupported ( const XnMapOutputMode &  output_mode) const throw (OpenNIException) [virtual]

Definition at line 850 of file openni_device.cpp.

virtual bool openni_wrapper::OpenNIDevice::isImageResizeSupported ( unsigned  input_width,
unsigned  input_height,
unsigned  output_width,
unsigned  output_height 
) const throw () [protected, pure virtual]

Reimplemented in openni_wrapper::DeviceONI.

Definition at line 315 of file openni_device.cpp.

Reimplemented in openni_wrapper::DeviceONI.

Definition at line 327 of file openni_device.cpp.

Reimplemented in openni_wrapper::DeviceKinect.

Definition at line 404 of file openni_device.cpp.

Reimplemented in openni_wrapper::DeviceKinect.

Definition at line 436 of file openni_device.cpp.

void __stdcall openni_wrapper::OpenNIDevice::NewDepthDataAvailable ( xn::ProductionNode &  node,
void *  cookie 
) throw () [static, protected]

Definition at line 586 of file openni_device.cpp.

void __stdcall openni_wrapper::OpenNIDevice::NewImageDataAvailable ( xn::ProductionNode &  node,
void *  cookie 
) throw () [static, protected]

Definition at line 592 of file openni_device.cpp.

void __stdcall openni_wrapper::OpenNIDevice::NewIRDataAvailable ( xn::ProductionNode &  node,
void *  cookie 
) throw () [static, protected]

Definition at line 598 of file openni_device.cpp.

Definition at line 621 of file openni_device.cpp.

template<typename T >
OpenNIDevice::CallbackHandle openni_wrapper::OpenNIDevice::registerDepthCallback ( void(T::*)(boost::shared_ptr< DepthImage >, void *cookie)  callback,
T instance,
void *  cookie = NULL 
) throw ()

Definition at line 271 of file openni_device.h.

Definition at line 604 of file openni_device.cpp.

template<typename T >
OpenNIDevice::CallbackHandle openni_wrapper::OpenNIDevice::registerImageCallback ( void(T::*)(boost::shared_ptr< Image >, void *cookie)  callback,
T instance,
void *  cookie = NULL 
) throw ()

Definition at line 265 of file openni_device.h.

Definition at line 639 of file openni_device.cpp.

template<typename T >
OpenNIDevice::CallbackHandle openni_wrapper::OpenNIDevice::registerIRCallback ( void(T::*)(boost::shared_ptr< IRImage >, void *cookie)  callback,
T instance,
void *  cookie = NULL 
) throw ()

Definition at line 277 of file openni_device.h.

void openni_wrapper::OpenNIDevice::setDepthCropping ( unsigned  x,
unsigned  y,
unsigned  width,
unsigned  height 
) throw (OpenNIException) [virtual]

Reimplemented in openni_wrapper::DeviceKinect.

Definition at line 472 of file openni_device.cpp.

void openni_wrapper::OpenNIDevice::setDepthOutputMode ( const XnMapOutputMode &  output_mode) throw (OpenNIException) [virtual]

Definition at line 899 of file openni_device.cpp.

Definition at line 353 of file openni_device.cpp.

void openni_wrapper::OpenNIDevice::setImageOutputMode ( const XnMapOutputMode &  output_mode) throw (OpenNIException) [virtual]

Definition at line 886 of file openni_device.cpp.

void openni_wrapper::OpenNIDevice::setIROutputMode ( const XnMapOutputMode &  output_mode) throw (OpenNIException) [virtual]

Definition at line 912 of file openni_device.cpp.

void openni_wrapper::OpenNIDevice::setRegistration ( bool  on_off) throw (OpenNIException) [protected]
void openni_wrapper::OpenNIDevice::setSynchronization ( bool  on_off) throw (OpenNIException) [virtual]

Reimplemented in openni_wrapper::DeviceKinect.

Definition at line 411 of file openni_device.cpp.

Definition at line 133 of file openni_device.cpp.

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

Definition at line 215 of file openni_device.cpp.

Reimplemented in openni_wrapper::DeviceONI.

Definition at line 281 of file openni_device.cpp.

Reimplemented in openni_wrapper::DeviceONI.

Definition at line 264 of file openni_device.cpp.

Reimplemented in openni_wrapper::DeviceONI.

Definition at line 231 of file openni_device.cpp.

Reimplemented in openni_wrapper::DeviceONI.

Definition at line 298 of file openni_device.cpp.

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

Definition at line 630 of file openni_device.cpp.

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

Definition at line 613 of file openni_device.cpp.

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

Definition at line 648 of file openni_device.cpp.


Member Data Documentation

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

Definition at line 195 of file openni_device.h.

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

Definition at line 194 of file openni_device.h.

distance between the projector and the IR camera

Definition at line 216 of file openni_device.h.

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

context to OpenNI driver

Definition at line 198 of file openni_device.h.

boost::thread_group openni_wrapper::OpenNIDevice::data_threads_ [protected]

Definition at line 236 of file openni_device.h.

Definition at line 191 of file openni_device.h.

Definition at line 209 of file openni_device.h.

Definition at line 226 of file openni_device.h.

boost::condition_variable openni_wrapper::OpenNIDevice::depth_condition_ [protected]

Definition at line 234 of file openni_device.h.

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

Definition at line 214 of file openni_device.h.

xn::DepthGenerator openni_wrapper::OpenNIDevice::depth_generator_ [protected]

Depth generator object.

Definition at line 203 of file openni_device.h.

boost::mutex openni_wrapper::OpenNIDevice::depth_mutex_ [mutable, protected]

Definition at line 231 of file openni_device.h.

node object for current device

Definition at line 200 of file openni_device.h.

Definition at line 190 of file openni_device.h.

Definition at line 210 of file openni_device.h.

Definition at line 225 of file openni_device.h.

boost::condition_variable openni_wrapper::OpenNIDevice::image_condition_ [protected]

Definition at line 233 of file openni_device.h.

xn::ImageGenerator openni_wrapper::OpenNIDevice::image_generator_ [protected]

Image generator object.

Definition at line 205 of file openni_device.h.

boost::mutex openni_wrapper::OpenNIDevice::image_mutex_ [mutable, protected]

Definition at line 230 of file openni_device.h.

Definition at line 192 of file openni_device.h.

Definition at line 211 of file openni_device.h.

Definition at line 227 of file openni_device.h.

boost::condition_variable openni_wrapper::OpenNIDevice::ir_condition_ [protected]

Definition at line 235 of file openni_device.h.

xn::IRGenerator openni_wrapper::OpenNIDevice::ir_generator_ [protected]

IR generator object.

Definition at line 207 of file openni_device.h.

boost::mutex openni_wrapper::OpenNIDevice::ir_mutex_ [mutable, protected]

Definition at line 232 of file openni_device.h.

the value for pixels without a valid disparity measurement

Definition at line 223 of file openni_device.h.

Definition at line 229 of file openni_device.h.

const float openni_wrapper::OpenNIDevice::rgb_focal_length_SXGA_ = 1050 [static, protected]

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

Definition at line 218 of file openni_device.h.

the value for shadow (occluded pixels)

Definition at line 221 of file openni_device.h.


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


openni_camera
Author(s): Patrick Mihelich, Suat Gedikli, Radu Bogdan Rusu
autogenerated on Thu Jun 6 2019 20:16:13