Class representing an astract device for Primesense or MS Kinect devices. More...
#include <openni_device.h>
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 ) |
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 () |
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) |
unsigned short | getProductID () const throw () |
const char * | getProductName () const throw () |
const char * | getSerialNumber () const throw () |
returns the serial number for device. | |
unsigned short | getVendorID () const throw () |
const char * | getVendorName () 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) |
bool | isDepthStreamRunning () const throw (OpenNIException) |
virtual bool | isImageModeSupported (const XnMapOutputMode &output_mode) const throw (OpenNIException) |
bool | isImageStreamRunning () const throw (OpenNIException) |
virtual bool | isSynchronizationSupported () const throw () |
virtual bool | isSynchronized () const throw (OpenNIException) |
template<typename T > | |
CallbackHandle | registerDepthCallback (void(T::*callback)(boost::shared_ptr< DepthImage >, void *cookie), T &instance, void *cookie=NULL) throw () |
CallbackHandle | registerDepthCallback (const DepthImageCallbackFunction &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 | registerImageCallback (const ImageCallbackFunction &callback, 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) |
void | setDepthRegistration (bool on_off) throw (OpenNIException) |
virtual void | setImageOutputMode (const XnMapOutputMode &output_mode) throw (OpenNIException) |
virtual void | setSynchronization (bool on_off) throw (OpenNIException) |
virtual void | startDepthStream () throw (OpenNIException) |
virtual void | startImageStream () throw (OpenNIException) |
virtual void | stopDepthStream () throw (OpenNIException) |
virtual void | stopImageStream () throw (OpenNIException) |
bool | unregisterDepthCallback (const CallbackHandle &callbackHandle) throw () |
bool | unregisterImageCallback (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 |
Protected Member Functions | |
void | DepthDataThreadFunction () throw (OpenNIException) |
virtual void | getAvailableModes () throw (OpenNIException) |
virtual boost::shared_ptr< Image > | getCurrentImage (boost::shared_ptr< xn::ImageMetaData > image_data) const =0 throw () |
void | ImageDataThreadFunction () throw (OpenNIException) |
void | Init () 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) 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 () |
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_ |
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_ |
boost::thread | depth_thread_ |
const 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_ |
boost::thread | image_thread_ |
XnUInt64 | no_sample_value_ |
bool | running_ |
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 |
Class representing an astract device for Primesense or MS Kinect devices.
Definition at line 65 of file openni_device.h.
typedef boost::function<void(boost::shared_ptr<DepthImage>) > openni_wrapper::OpenNIDevice::ActualDepthImageCallbackFunction [protected] |
Definition at line 145 of file openni_device.h.
typedef boost::function<void(boost::shared_ptr<Image>) > openni_wrapper::OpenNIDevice::ActualImageCallbackFunction [protected] |
Definition at line 144 of file openni_device.h.
typedef unsigned openni_wrapper::OpenNIDevice::CallbackHandle |
Definition at line 70 of file openni_device.h.
typedef boost::function<void(boost::shared_ptr<DepthImage>, void* cookie) openni_wrapper::OpenNIDevice::DepthImageCallbackFunction) |
Definition at line 69 of file openni_device.h.
typedef boost::function<void(boost::shared_ptr<Image>, void* cookie) openni_wrapper::OpenNIDevice::ImageCallbackFunction) |
Definition at line 68 of file openni_device.h.
openni_wrapper::OpenNIDevice::~OpenNIDevice | ( | ) | throw () [virtual] |
Definition at line 80 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 | |||
) | throw (OpenNIException) [protected] |
Definition at line 51 of file openni_device.cpp.
void openni_wrapper::OpenNIDevice::DepthDataThreadFunction | ( | ) | throw (OpenNIException) [protected] |
Definition at line 338 of file openni_device.cpp.
bool openni_wrapper::OpenNIDevice::findCompatibleDepthMode | ( | const XnMapOutputMode & | output_mode, | |
XnMapOutputMode & | mode | |||
) | const throw (OpenNIException) [virtual] |
Definition at line 495 of file openni_device.cpp.
bool openni_wrapper::OpenNIDevice::findCompatibleImageMode | ( | const XnMapOutputMode & | output_mode, | |
XnMapOutputMode & | mode | |||
) | const throw (OpenNIException) [virtual] |
Definition at line 465 of file openni_device.cpp.
unsigned char openni_wrapper::OpenNIDevice::getAddress | ( | ) | const throw () |
Definition at line 442 of file openni_device.cpp.
void openni_wrapper::OpenNIDevice::getAvailableModes | ( | ) | throw (OpenNIException) [protected, virtual] |
Reimplemented in openni_wrapper::DeviceKinect, and openni_wrapper::DevicePrimesense.
Definition at line 525 of file openni_device.cpp.
float openni_wrapper::OpenNIDevice::getBaseline | ( | ) | const throw () [inline] |
Definition at line 229 of file openni_device.h.
unsigned char openni_wrapper::OpenNIDevice::getBus | ( | ) | const throw () |
Definition at line 431 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 404 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] |
Implemented in openni_wrapper::DeviceKinect, and openni_wrapper::DevicePrimesense.
const XnMapOutputMode & openni_wrapper::OpenNIDevice::getDefaultDepthMode | ( | ) | const throw () [virtual] |
Definition at line 585 of file openni_device.cpp.
const XnMapOutputMode & openni_wrapper::OpenNIDevice::getDefaultImageMode | ( | ) | const throw () [virtual] |
Definition at line 580 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 217 of file openni_device.h.
XnMapOutputMode openni_wrapper::OpenNIDevice::getDepthOutputMode | ( | ) | const throw (OpenNIException) |
Definition at line 617 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 208 of file openni_device.h.
XnMapOutputMode openni_wrapper::OpenNIDevice::getImageOutputMode | ( | ) | const throw (OpenNIException) |
Definition at line 606 of file openni_device.cpp.
unsigned short openni_wrapper::OpenNIDevice::getProductID | ( | ) | const throw () |
Definition at line 420 of file openni_device.cpp.
const char * openni_wrapper::OpenNIDevice::getProductName | ( | ) | const throw () |
Definition at line 459 of file openni_device.cpp.
const char * openni_wrapper::OpenNIDevice::getSerialNumber | ( | ) | const throw () |
returns the serial number for device.
Definition at line 399 of file openni_device.cpp.
unsigned short openni_wrapper::OpenNIDevice::getVendorID | ( | ) | const throw () |
Definition at line 409 of file openni_device.cpp.
const char * openni_wrapper::OpenNIDevice::getVendorName | ( | ) | const throw () |
Definition at line 453 of file openni_device.cpp.
void openni_wrapper::OpenNIDevice::ImageDataThreadFunction | ( | ) | throw (OpenNIException) [protected] |
Definition at line 311 of file openni_device.cpp.
void openni_wrapper::OpenNIDevice::Init | ( | ) | throw (OpenNIException) [protected] |
Definition at line 103 of file openni_device.cpp.
bool openni_wrapper::OpenNIDevice::isDepthCropped | ( | ) | const throw (OpenNIException) [virtual] |
Reimplemented in openni_wrapper::DeviceKinect.
Definition at line 284 of file openni_device.cpp.
bool openni_wrapper::OpenNIDevice::isDepthCroppingSupported | ( | ) | const throw () [virtual] |
Reimplemented in openni_wrapper::DeviceKinect.
Definition at line 278 of file openni_device.cpp.
bool openni_wrapper::OpenNIDevice::isDepthModeSupported | ( | const XnMapOutputMode & | output_mode | ) | const throw (OpenNIException) [virtual] |
Definition at line 570 of file openni_device.cpp.
bool openni_wrapper::OpenNIDevice::isDepthRegistered | ( | ) | const throw (OpenNIException) |
Definition at line 233 of file openni_device.cpp.
bool openni_wrapper::OpenNIDevice::isDepthStreamRunning | ( | ) | const throw (OpenNIException) |
Definition at line 203 of file openni_device.cpp.
bool openni_wrapper::OpenNIDevice::isImageModeSupported | ( | const XnMapOutputMode & | output_mode | ) | const throw (OpenNIException) [virtual] |
Definition at line 560 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] |
Implemented in openni_wrapper::DeviceKinect, and openni_wrapper::DevicePrimesense.
bool openni_wrapper::OpenNIDevice::isImageStreamRunning | ( | ) | const throw (OpenNIException) |
Definition at line 197 of file openni_device.cpp.
bool openni_wrapper::OpenNIDevice::isSynchronizationSupported | ( | ) | const throw () [virtual] |
Reimplemented in openni_wrapper::DeviceKinect.
Definition at line 243 of file openni_device.cpp.
bool openni_wrapper::OpenNIDevice::isSynchronized | ( | ) | const throw (OpenNIException) [virtual] |
Reimplemented in openni_wrapper::DeviceKinect.
Definition at line 269 of file openni_device.cpp.
void __stdcall openni_wrapper::OpenNIDevice::NewDepthDataAvailable | ( | xn::ProductionNode & | node, | |
void * | cookie | |||
) | throw () [static, protected] |
Definition at line 365 of file openni_device.cpp.
void __stdcall openni_wrapper::OpenNIDevice::NewImageDataAvailable | ( | xn::ProductionNode & | node, | |
void * | cookie | |||
) | throw () [static, protected] |
Definition at line 371 of file openni_device.cpp.
OpenNIDevice::CallbackHandle openni_wrapper::OpenNIDevice::registerDepthCallback | ( | void(T::*)(boost::shared_ptr< DepthImage >, void *cookie) | callback, | |
T & | instance, | |||
void * | cookie = NULL | |||
) | throw () [inline] |
Definition at line 240 of file openni_device.h.
OpenNIDevice::CallbackHandle openni_wrapper::OpenNIDevice::registerDepthCallback | ( | const DepthImageCallbackFunction & | callback, | |
void * | cookie = NULL | |||
) | throw () |
Definition at line 388 of file openni_device.cpp.
OpenNIDevice::CallbackHandle openni_wrapper::OpenNIDevice::registerImageCallback | ( | void(T::*)(boost::shared_ptr< Image >, void *cookie) | callback, | |
T & | instance, | |||
void * | cookie = NULL | |||
) | throw () [inline] |
Definition at line 234 of file openni_device.h.
OpenNIDevice::CallbackHandle openni_wrapper::OpenNIDevice::registerImageCallback | ( | const ImageCallbackFunction & | callback, | |
void * | cookie = NULL | |||
) | throw () |
Definition at line 377 of file openni_device.cpp.
void openni_wrapper::OpenNIDevice::setDepthCropping | ( | unsigned | x, | |
unsigned | y, | |||
unsigned | width, | |||
unsigned | height | |||
) | throw (OpenNIException) [virtual] |
Reimplemented in openni_wrapper::DeviceKinect.
Definition at line 296 of file openni_device.cpp.
void openni_wrapper::OpenNIDevice::setDepthOutputMode | ( | const XnMapOutputMode & | output_mode | ) | throw (OpenNIException) [virtual] |
Definition at line 598 of file openni_device.cpp.
void openni_wrapper::OpenNIDevice::setDepthRegistration | ( | bool | on_off | ) | throw (OpenNIException) |
Definition at line 209 of file openni_device.cpp.
void openni_wrapper::OpenNIDevice::setImageOutputMode | ( | const XnMapOutputMode & | output_mode | ) | throw (OpenNIException) [virtual] |
Definition at line 590 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 249 of file openni_device.cpp.
void openni_wrapper::OpenNIDevice::startDepthStream | ( | ) | throw (OpenNIException) [virtual] |
Reimplemented in openni_wrapper::DevicePrimesense.
Definition at line 173 of file openni_device.cpp.
void openni_wrapper::OpenNIDevice::startImageStream | ( | ) | throw (OpenNIException) [virtual] |
Reimplemented in openni_wrapper::DevicePrimesense.
Definition at line 151 of file openni_device.cpp.
void openni_wrapper::OpenNIDevice::stopDepthStream | ( | ) | throw (OpenNIException) [virtual] |
Definition at line 185 of file openni_device.cpp.
void openni_wrapper::OpenNIDevice::stopImageStream | ( | ) | throw (OpenNIException) [virtual] |
Definition at line 162 of file openni_device.cpp.
bool openni_wrapper::OpenNIDevice::unregisterDepthCallback | ( | const CallbackHandle & | callbackHandle | ) | throw () |
Definition at line 394 of file openni_device.cpp.
bool openni_wrapper::OpenNIDevice::unregisterImageCallback | ( | const CallbackHandle & | callbackHandle | ) | throw () |
Definition at line 383 of file openni_device.cpp.
std::vector<XnMapOutputMode> openni_wrapper::OpenNIDevice::available_depth_modes_ [protected] |
Definition at line 171 of file openni_device.h.
std::vector<XnMapOutputMode> openni_wrapper::OpenNIDevice::available_image_modes_ [protected] |
Definition at line 170 of file openni_device.h.
float openni_wrapper::OpenNIDevice::baseline_ [protected] |
distance between the projector and the IR camera
Definition at line 186 of file openni_device.h.
xn::Context& openni_wrapper::OpenNIDevice::context_ [protected] |
Definition at line 190 of file openni_device.h.
std::map< CallbackHandle, ActualDepthImageCallbackFunction > openni_wrapper::OpenNIDevice::depth_callback_ [protected] |
Definition at line 168 of file openni_device.h.
XnCallbackHandle openni_wrapper::OpenNIDevice::depth_callback_handle_ [protected] |
Definition at line 180 of file openni_device.h.
OpenNIDevice::CallbackHandle openni_wrapper::OpenNIDevice::depth_callback_handle_counter_ [protected] |
Definition at line 197 of file openni_device.h.
boost::condition_variable openni_wrapper::OpenNIDevice::depth_condition_ [protected] |
Definition at line 203 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 184 of file openni_device.h.
xn::DepthGenerator openni_wrapper::OpenNIDevice::depth_generator_ [protected] |
Depth generator object.
Definition at line 176 of file openni_device.h.
boost::mutex openni_wrapper::OpenNIDevice::depth_mutex_ [mutable, protected] |
Definition at line 201 of file openni_device.h.
boost::thread openni_wrapper::OpenNIDevice::depth_thread_ [protected] |
Definition at line 205 of file openni_device.h.
const xn::NodeInfo& openni_wrapper::OpenNIDevice::device_node_info_ [protected] |
node object for current device
Definition at line 174 of file openni_device.h.
std::map< CallbackHandle, ActualImageCallbackFunction > openni_wrapper::OpenNIDevice::image_callback_ [protected] |
Definition at line 167 of file openni_device.h.
XnCallbackHandle openni_wrapper::OpenNIDevice::image_callback_handle_ [protected] |
Definition at line 181 of file openni_device.h.
OpenNIDevice::CallbackHandle openni_wrapper::OpenNIDevice::image_callback_handle_counter_ [protected] |
Definition at line 196 of file openni_device.h.
boost::condition_variable openni_wrapper::OpenNIDevice::image_condition_ [protected] |
Definition at line 202 of file openni_device.h.
xn::ImageGenerator openni_wrapper::OpenNIDevice::image_generator_ [protected] |
Image generator object.
Definition at line 178 of file openni_device.h.
boost::mutex openni_wrapper::OpenNIDevice::image_mutex_ [mutable, protected] |
Definition at line 200 of file openni_device.h.
boost::thread openni_wrapper::OpenNIDevice::image_thread_ [protected] |
Definition at line 204 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 194 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 188 of file openni_device.h.
bool openni_wrapper::OpenNIDevice::running_ [protected] |
Definition at line 199 of file openni_device.h.
XnUInt64 openni_wrapper::OpenNIDevice::shadow_value_ [protected] |
the value for shadow (occluded pixels)
Definition at line 192 of file openni_device.h.