pcl::io::openni2::OpenNI2Device Class Reference

`#include <pcl/io/openni2/openni2_device.h>`

## Public Types

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
typedef boost::function< void(openni::VideoStream &stream)> | StreamCallbackFunction

## Public Member Functions

| OpenNI2Device (const std::string &device_URI)
virtual | ~OpenNI2Device ()
const std::string | getUri () const
const std::string | getVendor () const
const std::string | getName () const
uint16_t | getUsbVendorId () const
uint16_t | getUsbProductId () const
const std::string | getStringID () const
bool | isValid () const
bool | hasIRSensor () const
bool | hasColorSensor () const
bool | hasDepthSensor () const
void | startIRStream ()
void | startColorStream ()
void | startDepthStream ()
void | stopAllStreams ()
void | stopIRStream ()
void | stopColorStream ()
void | stopDepthStream ()
bool | isIRStreamStarted ()
bool | isColorStreamStarted ()
bool | isDepthStreamStarted ()
bool | isImageRegistrationModeSupported () const
void | setImageRegistrationMode (bool enabled)
bool | isDepthRegistered () const
const OpenNI2VideoMode | getIRVideoMode ()
const OpenNI2VideoMode | getColorVideoMode ()
const OpenNI2VideoMode | getDepthVideoMode ()
const std::vector< OpenNI2VideoMode > & | getSupportedIRVideoModes () const
const std::vector< OpenNI2VideoMode > & | getSupportedColorVideoModes () const
const std::vector< OpenNI2VideoMode > & | getSupportedDepthVideoModes () const
bool | isIRVideoModeSupported (const OpenNI2VideoMode &video_mode) const
bool | isColorVideoModeSupported (const OpenNI2VideoMode &video_mode) const
bool | isDepthVideoModeSupported (const OpenNI2VideoMode &video_mode) const
bool | findCompatibleIRMode (const OpenNI2VideoMode &requested_mode, OpenNI2VideoMode &actual_mode) const
bool | findCompatibleColorMode (const OpenNI2VideoMode &requested_mode, OpenNI2VideoMode &actual_mode) const
bool | findCompatibleDepthMode (const OpenNI2VideoMode &requested_mode, OpenNI2VideoMode &actual_mode) const
void | setIRVideoMode (const OpenNI2VideoMode &video_mode)
void | setColorVideoMode (const OpenNI2VideoMode &video_mode)
void | setDepthVideoMode (const OpenNI2VideoMode &video_mode)
OpenNI2VideoMode | getDefaultIRMode () const
OpenNI2VideoMode | getDefaultColorMode () const
OpenNI2VideoMode | getDefaultDepthMode () const
float | getIRFocalLength () const
float | getColorFocalLength () const
float | getDepthFocalLength () const
float | getBaseline ()
uint64_t | getShadowValue ()
void | setAutoExposure (bool enable)
void | setAutoWhiteBalance (bool enable)
bool | isSynchronized ()
bool | isSynchronizationSupported ()
bool | isFile ()
void | setSynchronization (bool enableSync)
bool | getAutoExposure () const
bool | getAutoWhiteBalance () const
void | setUseDeviceTimer (bool enable)
int | getDepthFrameCount ()
| Get absolut number of depth frames in the current stream. More...
int | getColorFrameCount ()
| Get absolut number of color frames in the current stream. More...
int | getIRFrameCount ()
| Get absolut number of ir frames in the current stream. More...
bool | setPlaybackSpeed (double speed)
| Set the playback speed if the device is an recorded stream. More...
void | setColorCallback (StreamCallbackFunction color_callback)
void | setDepthCallback (StreamCallbackFunction depth_callback)
void | setIRCallback (StreamCallbackFunction ir_callback)

## Protected Member Functions

void | shutdown ()
boost::shared_ptr< openni::VideoStream > | getIRVideoStream () const
boost::shared_ptr< openni::VideoStream > | getColorVideoStream () const
boost::shared_ptr< openni::VideoStream > | getDepthVideoStream () const
void | processColorFrame (openni::VideoStream &stream)
void | processDepthFrame (openni::VideoStream &stream)
void | processIRFrame (openni::VideoStream &stream)
bool | findCompatibleVideoMode (const std::vector< OpenNI2VideoMode > supportedModes, const OpenNI2VideoMode &output_mode, OpenNI2VideoMode &mode) const
bool | resizingSupported (size_t input_width, size_t input_height, size_t output_width, size_t output_height) const

## Protected Attributes

boost::shared_ptr< openni::Device > | openni_device_
boost::shared_ptr< openni::DeviceInfo > | device_info_
boost::shared_ptr< OpenNI2FrameListener > | ir_frame_listener
boost::shared_ptr< OpenNI2FrameListener > | color_frame_listener
boost::shared_ptr< OpenNI2FrameListener > | depth_frame_listener
boost::shared_ptr< openni::VideoStream > | ir_video_stream_
boost::shared_ptr< openni::VideoStream > | color_video_stream_
boost::shared_ptr< openni::VideoStream > | depth_video_stream_
std::vector< OpenNI2VideoMode > | ir_video_modes_
std::vector< OpenNI2VideoMode > | color_video_modes_
std::vector< OpenNI2VideoMode > | depth_video_modes_
bool | ir_video_started_
bool | color_video_started_
bool | depth_video_started_
float | baseline_
| distance between the projector and the IR camera in meters More...
uint64_t | shadow_value_
| the value for shadow (occluded pixels) More...
uint64_t | no_sample_value_
| the value for pixels without a valid disparity measurement More...

## Detailed Description

Definition at line 73 of file openni2_device.h.

## Member Typedef Documentation

typedef unsigned pcl::io::openni2::OpenNI2Device::CallbackHandle

Definition at line 80 of file openni2_device.h.

typedef boost::function<void(boost::shared_ptr<DepthImage>, void* cookie) > pcl::io::openni2::OpenNI2Device::DepthImageCallbackFunction

Definition at line 78 of file openni2_device.h.

typedef boost::function<void(boost::shared_ptr<Image>, void* cookie) > pcl::io::openni2::OpenNI2Device::ImageCallbackFunction

Definition at line 77 of file openni2_device.h.

typedef boost::function<void(boost::shared_ptr<IRImage>, void* cookie) > pcl::io::openni2::OpenNI2Device::IRImageCallbackFunction

Definition at line 79 of file openni2_device.h.

typedef boost::function<void(openni::VideoStream& stream)> pcl::io::openni2::OpenNI2Device::StreamCallbackFunction

Definition at line 82 of file openni2_device.h.

## Constructor & Destructor Documentation

pcl::io::openni2::OpenNI2Device::OpenNI2Device | ( | const std::string & | device_URI | ) |

virtual pcl::io::openni2::OpenNI2Device::~OpenNI2Device | ( |  | ) |

virtual

## Member Function Documentation

bool pcl::io::openni2::OpenNI2Device::findCompatibleColorMode | ( | const OpenNI2VideoMode & | requested_mode,
|  | OpenNI2VideoMode & | actual_mode
| ) |  | const

bool pcl::io::openni2::OpenNI2Device::findCompatibleDepthMode | ( | const OpenNI2VideoMode & | requested_mode,
|  | OpenNI2VideoMode & | actual_mode
| ) |  | const

bool pcl::io::openni2::OpenNI2Device::findCompatibleIRMode | ( | const OpenNI2VideoMode & | requested_mode,
|  | OpenNI2VideoMode & | actual_mode
| ) |  | const

bool pcl::io::openni2::OpenNI2Device::findCompatibleVideoMode | ( | const std::vector< OpenNI2VideoMode > | supportedModes,
|  | const OpenNI2VideoMode & | output_mode,
|  | OpenNI2VideoMode & | mode
| ) |  | const

protected

bool pcl::io::openni2::OpenNI2Device::getAutoExposure | ( |  | ) | const

bool pcl::io::openni2::OpenNI2Device::getAutoWhiteBalance | ( |  | ) | const

float pcl::io::openni2::OpenNI2Device::getBaseline | ( |  | ) |

float pcl::io::openni2::OpenNI2Device::getColorFocalLength | ( |  | ) | const

int pcl::io::openni2::OpenNI2Device::getColorFrameCount | ( |  | ) |

Get absolut number of color frames in the current stream.

This function returns 0 if the current device is not a file stream or if the current mode has no color stream.

const OpenNI2VideoMode pcl::io::openni2::OpenNI2Device::getColorVideoMode | ( |  | ) |

boost::shared_ptr<openni::VideoStream> pcl::io::openni2::OpenNI2Device::getColorVideoStream | ( |  | ) | const

protected

OpenNI2VideoMode pcl::io::openni2::OpenNI2Device::getDefaultColorMode | ( |  | ) | const

OpenNI2VideoMode pcl::io::openni2::OpenNI2Device::getDefaultDepthMode | ( |  | ) | const

OpenNI2VideoMode pcl::io::openni2::OpenNI2Device::getDefaultIRMode | ( |  | ) | const

float pcl::io::openni2::OpenNI2Device::getDepthFocalLength | ( |  | ) | const

int pcl::io::openni2::OpenNI2Device::getDepthFrameCount | ( |  | ) |

Get absolut number of depth frames in the current stream.

This function returns 0 if the current device is not a file stream or if the current mode has no depth stream.

const OpenNI2VideoMode pcl::io::openni2::OpenNI2Device::getDepthVideoMode | ( |  | ) |

boost::shared_ptr<openni::VideoStream> pcl::io::openni2::OpenNI2Device::getDepthVideoStream | ( |  | ) | const

protected

float pcl::io::openni2::OpenNI2Device::getIRFocalLength | ( |  | ) | const

int pcl::io::openni2::OpenNI2Device::getIRFrameCount | ( |  | ) |

Get absolut number of ir frames in the current stream.

This function returns 0 if the current device is not a file stream or if the current mode has no ir stream.

const OpenNI2VideoMode pcl::io::openni2::OpenNI2Device::getIRVideoMode | ( |  | ) |

boost::shared_ptr<openni::VideoStream> pcl::io::openni2::OpenNI2Device::getIRVideoStream | ( |  | ) | const

protected

const std::string pcl::io::openni2::OpenNI2Device::getName | ( |  | ) | const

uint64_t pcl::io::openni2::OpenNI2Device::getShadowValue | ( |  | ) |

const std::string pcl::io::openni2::OpenNI2Device::getStringID | ( |  | ) | const

const std::vector<OpenNI2VideoMode>& pcl::io::openni2::OpenNI2Device::getSupportedColorVideoModes | ( |  | ) | const

const std::vector<OpenNI2VideoMode>& pcl::io::openni2::OpenNI2Device::getSupportedDepthVideoModes | ( |  | ) | const

const std::vector<OpenNI2VideoMode>& pcl::io::openni2::OpenNI2Device::getSupportedIRVideoModes | ( |  | ) | const

const std::string pcl::io::openni2::OpenNI2Device::getUri | ( |  | ) | const

uint16_t pcl::io::openni2::OpenNI2Device::getUsbProductId | ( |  | ) | const

uint16_t pcl::io::openni2::OpenNI2Device::getUsbVendorId | ( |  | ) | const

const std::string pcl::io::openni2::OpenNI2Device::getVendor | ( |  | ) | const

bool pcl::io::openni2::OpenNI2Device::hasColorSensor | ( |  | ) | const

bool pcl::io::openni2::OpenNI2Device::hasDepthSensor | ( |  | ) | const

bool pcl::io::openni2::OpenNI2Device::hasIRSensor | ( |  | ) | const

bool pcl::io::openni2::OpenNI2Device::isColorStreamStarted | ( |  | ) |

bool pcl::io::openni2::OpenNI2Device::isColorVideoModeSupported | ( | const OpenNI2VideoMode & | video_mode | ) | const

bool pcl::io::openni2::OpenNI2Device::isDepthRegistered | ( |  | ) | const

bool pcl::io::openni2::OpenNI2Device::isDepthStreamStarted | ( |  | ) |

bool pcl::io::openni2::OpenNI2Device::isDepthVideoModeSupported | ( | const OpenNI2VideoMode & | video_mode | ) | const

bool pcl::io::openni2::OpenNI2Device::isFile | ( |  | ) |

inline

Definition at line 217 of file openni2_device.h.

bool pcl::io::openni2::OpenNI2Device::isImageRegistrationModeSupported | ( |  | ) | const

bool pcl::io::openni2::OpenNI2Device::isIRStreamStarted | ( |  | ) |

bool pcl::io::openni2::OpenNI2Device::isIRVideoModeSupported | ( | const OpenNI2VideoMode & | video_mode | ) | const

bool pcl::io::openni2::OpenNI2Device::isSynchronizationSupported | ( |  | ) |

inline

Definition at line 211 of file openni2_device.h.

bool pcl::io::openni2::OpenNI2Device::isSynchronized | ( |  | ) |

inline

Definition at line 205 of file openni2_device.h.

bool pcl::io::openni2::OpenNI2Device::isValid | ( |  | ) | const

void pcl::io::openni2::OpenNI2Device::processColorFrame | ( | openni::VideoStream & | stream | ) |

protected

void pcl::io::openni2::OpenNI2Device::processDepthFrame | ( | openni::VideoStream & | stream | ) |

protected

void pcl::io::openni2::OpenNI2Device::processIRFrame | ( | openni::VideoStream & | stream | ) |

protected

bool pcl::io::openni2::OpenNI2Device::resizingSupported | ( | size_t | input_width,
|  | size_t | input_height,
|  | size_t | output_width,
|  | size_t | output_height
| ) |  | const

protected

void pcl::io::openni2::OpenNI2Device::setAutoExposure | ( | bool | enable | ) |

void pcl::io::openni2::OpenNI2Device::setAutoWhiteBalance | ( | bool | enable | ) |

void pcl::io::openni2::OpenNI2Device::setColorCallback | ( | StreamCallbackFunction | color_callback | ) |

void pcl::io::openni2::OpenNI2Device::setColorVideoMode | ( | const OpenNI2VideoMode & | video_mode | ) |

void pcl::io::openni2::OpenNI2Device::setDepthCallback | ( | StreamCallbackFunction | depth_callback | ) |

void pcl::io::openni2::OpenNI2Device::setDepthVideoMode | ( | const OpenNI2VideoMode & | video_mode | ) |

void pcl::io::openni2::OpenNI2Device::setImageRegistrationMode | ( | bool | enabled | ) |

void pcl::io::openni2::OpenNI2Device::setIRCallback | ( | StreamCallbackFunction | ir_callback | ) |

void pcl::io::openni2::OpenNI2Device::setIRVideoMode | ( | const OpenNI2VideoMode & | video_mode | ) |

bool pcl::io::openni2::OpenNI2Device::setPlaybackSpeed | ( | double | speed | ) |

Set the playback speed if the device is an recorded stream.

If setting the device playback speed fails, because the device is no recorded stream or any other reason this function returns false. Otherwise true is returned.

Parameters

  [in] | speed | The playback speed factor 1.0 means the same speed as recorded, 0.5 half the speed, 2.0 double speed and so on.

Returns
  True on success, false otherwise.

void pcl::io::openni2::OpenNI2Device::setSynchronization | ( | bool | enableSync | ) |

void pcl::io::openni2::OpenNI2Device::setUseDeviceTimer | ( | bool | enable | ) |

void pcl::io::openni2::OpenNI2Device::shutdown | ( |  | ) |

protected

void pcl::io::openni2::OpenNI2Device::startColorStream | ( |  | ) |

void pcl::io::openni2::OpenNI2Device::startDepthStream | ( |  | ) |

void pcl::io::openni2::OpenNI2Device::startIRStream | ( |  | ) |

void pcl::io::openni2::OpenNI2Device::stopAllStreams | ( |  | ) |

void pcl::io::openni2::OpenNI2Device::stopColorStream | ( |  | ) |

void pcl::io::openni2::OpenNI2Device::stopDepthStream | ( |  | ) |

void pcl::io::openni2::OpenNI2Device::stopIRStream | ( |  | ) |

## Member Data Documentation

float pcl::io::openni2::OpenNI2Device::baseline_

protected

distance between the projector and the IR camera in meters

Definition at line 321 of file openni2_device.h.

boost::shared_ptr<OpenNI2FrameListener> pcl::io::openni2::OpenNI2Device::color_frame_listener

protected

Definition at line 305 of file openni2_device.h.

std::vector<OpenNI2VideoMode> pcl::io::openni2::OpenNI2Device::color_video_modes_

mutable protected

Definition at line 313 of file openni2_device.h.

bool pcl::io::openni2::OpenNI2Device::color_video_started_

protected

Definition at line 317 of file openni2_device.h.

boost::shared_ptr<openni::VideoStream> pcl::io::openni2::OpenNI2Device::color_video_stream_

mutable protected

Definition at line 309 of file openni2_device.h.

boost::shared_ptr<OpenNI2FrameListener> pcl::io::openni2::OpenNI2Device::depth_frame_listener

protected

Definition at line 306 of file openni2_device.h.

std::vector<OpenNI2VideoMode> pcl::io::openni2::OpenNI2Device::depth_video_modes_

mutable protected

Definition at line 314 of file openni2_device.h.

bool pcl::io::openni2::OpenNI2Device::depth_video_started_

protected

Definition at line 318 of file openni2_device.h.

boost::shared_ptr<openni::VideoStream> pcl::io::openni2::OpenNI2Device::depth_video_stream_

mutable protected

Definition at line 310 of file openni2_device.h.

boost::shared_ptr<openni::DeviceInfo> pcl::io::openni2::OpenNI2Device::device_info_

protected

Definition at line 302 of file openni2_device.h.

boost::shared_ptr<OpenNI2FrameListener> pcl::io::openni2::OpenNI2Device::ir_frame_listener

protected

Definition at line 304 of file openni2_device.h.

std::vector<OpenNI2VideoMode> pcl::io::openni2::OpenNI2Device::ir_video_modes_

mutable protected

Definition at line 312 of file openni2_device.h.

bool pcl::io::openni2::OpenNI2Device::ir_video_started_

protected

Definition at line 316 of file openni2_device.h.

boost::shared_ptr<openni::VideoStream> pcl::io::openni2::OpenNI2Device::ir_video_stream_

mutable protected

Definition at line 308 of file openni2_device.h.

uint64_t pcl::io::openni2::OpenNI2Device::no_sample_value_

protected

the value for pixels without a valid disparity measurement

Definition at line 325 of file openni2_device.h.

boost::shared_ptr<openni::Device> pcl::io::openni2::OpenNI2Device::openni_device_

protected

Definition at line 301 of file openni2_device.h.

uint64_t pcl::io::openni2::OpenNI2Device::shadow_value_

protected

the value for shadow (occluded pixels)

Definition at line 323 of file openni2_device.h.

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

- /build/pcl-0nnAvv/pcl-1.7.2/io/include/pcl/io/openni2/openni2_device.h