40 #include <boost/thread/mutex.hpp> 42 using namespace boost;
47 DeviceXtionPro::DeviceXtionPro (xn::Context& context,
const xn::NodeInfo& device_node,
const xn::NodeInfo& depth_node,
const xn::NodeInfo& ir_node)
throw (
OpenNIException)
48 :
OpenNIDevice (context, device_node, depth_node, ir_node)
51 enumAvailableModes ();
52 setDepthOutputMode (getDefaultDepthMode ());
53 setIROutputMode (getDefaultIRMode ());
55 lock_guard<mutex> depth_lock(depth_mutex_);
56 XnStatus
status = depth_generator_.SetIntProperty (
"RegistrationType", 1);
57 if (status != XN_STATUS_OK)
61 DeviceXtionPro::~DeviceXtionPro () throw ()
64 depth_generator_.UnregisterFromNewDataAvailable (depth_callback_handle_);
65 depth_mutex_.unlock ();
68 bool DeviceXtionPro::isImageResizeSupported (
unsigned input_width,
unsigned input_height,
unsigned output_width,
unsigned output_height)
const throw ()
75 XnMapOutputMode output_mode;
76 available_image_modes_.clear();
77 available_depth_modes_.clear();
80 output_mode.nFPS = 30;
81 output_mode.nXRes = XN_VGA_X_RES;
82 output_mode.nYRes = XN_VGA_Y_RES;
83 available_depth_modes_.push_back (output_mode);
85 output_mode.nFPS = 25;
86 output_mode.nXRes = XN_VGA_X_RES;
87 output_mode.nYRes = XN_VGA_Y_RES;
88 available_depth_modes_.push_back (output_mode);
90 output_mode.nFPS = 25;
91 output_mode.nXRes = XN_QVGA_X_RES;
92 output_mode.nYRes = XN_QVGA_Y_RES;
93 available_depth_modes_.push_back (output_mode);
95 output_mode.nFPS = 30;
96 output_mode.nXRes = XN_QVGA_X_RES;
97 output_mode.nYRes = XN_QVGA_Y_RES;
98 available_depth_modes_.push_back (output_mode);
100 output_mode.nFPS = 60;
101 output_mode.nXRes = XN_QVGA_X_RES;
102 output_mode.nYRes = XN_QVGA_Y_RES;
103 available_depth_modes_.push_back (output_mode);
113 if (isDepthRegistered ())
116 setDepthRegistration (
false);
119 OpenNIDevice::startDepthStream ();
122 setDepthRegistration (
true);
126 OpenNIDevice::startDepthStream ();
#define THROW_OPENNI_EXCEPTION(format,...)
Image class containing just a reference to image meta data. Thus this class just provides an interfac...
Class representing an astract device for Primesense or MS Kinect devices.