Go to the documentation of this file.
38 #ifndef __OPENNI_IDEVICE_H__
39 #define __OPENNI_IDEVICE_H__
44 #include <XnCppWrapper.h>
45 #include <boost/noncopyable.hpp>
46 #include <boost/function.hpp>
47 #include <boost/thread.hpp>
48 #include <boost/thread/condition.hpp>
160 unsigned char getBus () const throw ();
167 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);
168 OpenNIDevice (xn::Context& context, const xn::NodeInfo& device_node, const xn::NodeInfo& depth_node, const xn::NodeInfo& ir_node) throw (
OpenNIException);
180 virtual
bool isImageResizeSupported (
unsigned input_width,
unsigned input_height,
unsigned output_width,
unsigned output_height) const throw () = 0;
241 if (output_x_resolution == 0)
244 float scale = output_x_resolution / (float)XN_SXGA_X_RES;
250 if (output_x_resolution == 0)
253 float scale = output_x_resolution / (float)XN_SXGA_X_RES;
284 #endif // __OPENNI_IDEVICE_H__
static void __stdcall NewIRDataAvailable(xn::ProductionNode &node, void *cookie)
bool hasImageStream() const
boost::function< void(boost::shared_ptr< IRImage >) > ActualIRImageCallbackFunction
boost::function< void(boost::shared_ptr< DepthImage >, void *cookie) > DepthImageCallbackFunction
CallbackHandle registerIRCallback(const IRImageCallbackFunction &callback, void *cookie=NULL)
Class representing an astract device for Primesense or MS Kinect devices.
bool hasDepthStream() const
virtual const XnMapOutputMode & getDefaultIRMode() const
virtual void startImageStream()
std::vector< XnMapOutputMode > available_depth_modes_
bool unregisterDepthCallback(const CallbackHandle &callbackHandle)
boost::function< void(boost::shared_ptr< IRImage >, void *cookie) > IRImageCallbackFunction
virtual void stopImageStream()
xn::NodeInfo device_node_info_
node object for current device
XnCallbackHandle image_callback_handle_
static void __stdcall NewDepthDataAvailable(xn::ProductionNode &node, void *cookie)
void DepthDataThreadFunction()
virtual bool isImageModeSupported(const XnMapOutputMode &output_mode) const
XnMapOutputMode getImageOutputMode() const
virtual void enumAvailableModes()
boost::thread_group data_threads_
virtual void setDepthRegistration(bool on_off)
virtual void setImageOutputMode(const XnMapOutputMode &output_mode)
XnUInt64 no_sample_value_
bool unregisterIRCallback(const CallbackHandle &callbackHandle)
virtual const XnMapOutputMode & getDefaultImageMode() const
xn::IRGenerator ir_generator_
IR generator object.
virtual void stopDepthStream()
std::map< CallbackHandle, ActualImageCallbackFunction > image_callback_
virtual const XnMapOutputMode & getDefaultDepthMode() const
Class containing just a reference to IR meta data.
boost::function< void(boost::shared_ptr< Image >, void *cookie) > ImageCallbackFunction
virtual void startIRStream()
virtual bool isIRStreamRunning() const
float getDepthFocalLength(int output_x_resolution=0) const
returns the focal length for the IR camera in pixels. The pixels are assumed to be square....
unsigned short getVendorID() const
Image class containing just a reference to image meta data. Thus this class just provides an interfac...
float getBaseline() const
virtual void startDepthStream()
std::map< CallbackHandle, ActualDepthImageCallbackFunction > depth_callback_
CallbackHandle registerDepthCallback(const DepthImageCallbackFunction &callback, void *cookie=NULL)
OpenNIDevice::CallbackHandle depth_callback_handle_counter_
unsigned char getBus() const
XnCallbackHandle ir_callback_handle_
float depth_focal_length_SXGA_
focal length for IR camera producing depth information in native SXGA mode
virtual bool isImageResizeSupported(unsigned input_width, unsigned input_height, unsigned output_width, unsigned output_height) const =0
static const float rgb_focal_length_SXGA_
focal length for regular camera producing color images in native SXGA mode
virtual void setDepthCropping(unsigned x, unsigned y, unsigned width, unsigned height)
unsigned char getAddress() const
const char * getConnectionString() const
returns the connectionstring for current device, which has following format vendorID/productID@BusID/...
XnMapOutputMode getIROutputMode() const
void setRegistration(bool on_off)
bool isDepthRegistered() const
xn::ImageGenerator image_generator_
Image generator object.
virtual void setDepthOutputMode(const XnMapOutputMode &output_mode)
virtual void setIROutputMode(const XnMapOutputMode &output_mode)
const char * getVendorName() const
virtual bool isSynchronized() const
boost::function< void(boost::shared_ptr< DepthImage >) > ActualDepthImageCallbackFunction
OpenNIDevice::CallbackHandle ir_callback_handle_counter_
virtual void stopIRStream()
virtual boost::shared_ptr< Image > getCurrentImage(boost::shared_ptr< xn::ImageMetaData > image_data) const =0
xn::Context & context_
context to OpenNI driver
boost::function< void(boost::shared_ptr< Image >) > ActualImageCallbackFunction
boost::mutex depth_mutex_
boost::condition_variable depth_condition_
boost::mutex image_mutex_
float baseline_
distance between the projector and the IR camera
std::map< CallbackHandle, ActualIRImageCallbackFunction > ir_callback_
std::vector< XnMapOutputMode > available_image_modes_
virtual bool findCompatibleDepthMode(const XnMapOutputMode &output_mode, XnMapOutputMode &mode) const
void ImageDataThreadFunction()
boost::condition_variable image_condition_
void IRDataThreadFunction()
virtual bool findCompatibleImageMode(const XnMapOutputMode &output_mode, XnMapOutputMode &mode) const
boost::condition_variable ir_condition_
virtual bool isSynchronizationSupported() const
static void __stdcall NewImageDataAvailable(xn::ProductionNode &node, void *cookie)
virtual bool isImageStreamRunning() const
XnCallbackHandle depth_callback_handle_
virtual bool isDepthStreamRunning() const
virtual bool isDepthRegistrationSupported() const
CallbackHandle registerImageCallback(const ImageCallbackFunction &callback, void *cookie=NULL)
XnMapOutputMode getDepthOutputMode() const
virtual bool isDepthModeSupported(const XnMapOutputMode &output_mode) const
unsigned short getProductID() const
bool unregisterImageCallback(const CallbackHandle &callbackHandle)
virtual void setSynchronization(bool on_off)
This class provides methods to fill a depth or disparity image.
const char * getSerialNumber()
returns the serial number for device.
xn::DepthGenerator depth_generator_
Depth generator object.
const char * getProductName() const
virtual bool isDepthCropped() const
float getImageFocalLength(int output_x_resolution=0) const
returns the focal length for the color camera in pixels. The pixels are assumed to be square....
virtual bool isDepthCroppingSupported() const
OpenNIDevice::CallbackHandle image_callback_handle_counter_
openni_camera
Author(s): Patrick Mihelich, Suat Gedikli, Radu Bogdan Rusu
autogenerated on Thu Apr 21 2022 02:37:23