Loading...
Searching...
No Matches
pcl::io::openni2::OpenNI2Device Class Reference

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

## Public Types

using | Ptr = shared_ptr< OpenNI2Device >
using | ConstPtr = shared_ptr< const OpenNI2Device >
using | ImageCallbackFunction = std::function< void(Image::Ptr, void *cookie) >
using | DepthImageCallbackFunction = std::function< void(DepthImage::Ptr, void *cookie) >
using | IRImageCallbackFunction = std::function< void(IRImage::Ptr, void *cookie) >
using | CallbackHandle = unsigned
using | StreamCallbackFunction = std::function< void(openni::VideoStream &stream)>

## 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
std::uint16_t | getUsbVendorId () const
std::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 ()
std::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 absolute number of depth frames in the current stream.
int | getColorFrameCount ()
| Get absolute number of color frames in the current stream.
int | getIRFrameCount ()
| Get absolute number of ir frames in the current stream.
bool | setPlaybackSpeed (double speed)
| Set the playback speed if the device is an recorded stream.
void | setColorCallback (StreamCallbackFunction color_callback)
void | setDepthCallback (StreamCallbackFunction depth_callback)
void | setIRCallback (StreamCallbackFunction ir_callback)

## Protected Member Functions

void | shutdown ()
std::shared_ptr< openni::VideoStream > | getIRVideoStream () const
std::shared_ptr< openni::VideoStream > | getColorVideoStream () const
std::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 (std::size_t input_width, std::size_t input_height, std::size_t output_width, std::size_t output_height) const

## Protected Attributes

std::shared_ptr< openni::Device > | openni_device_
std::shared_ptr< openni::DeviceInfo > | device_info_
std::shared_ptr< OpenNI2FrameListener > | ir_frame_listener
std::shared_ptr< OpenNI2FrameListener > | color_frame_listener
std::shared_ptr< OpenNI2FrameListener > | depth_frame_listener
std::shared_ptr< openni::VideoStream > | ir_video_stream_
std::shared_ptr< openni::VideoStream > | color_video_stream_
std::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_ {false}
bool | color_video_started_ {false}
bool | depth_video_started_ {false}
float | baseline_ {0.0f}
| distance between the projector and the IR camera in meters
std::uint64_t | shadow_value_ {0}
| the value for shadow (occluded pixels)
std::uint64_t | no_sample_value_ {0}
| the value for pixels without a valid disparity measurement

## Detailed Description

Definition at line 73 of file openni2_device.h.

## Member Typedef Documentation

## CallbackHandle

using pcl::io::openni2::OpenNI2Device::CallbackHandle = unsigned

Definition at line 82 of file openni2_device.h.

## ConstPtr

using pcl::io::openni2::OpenNI2Device::ConstPtr = shared_ptr<const OpenNI2Device>

Definition at line 77 of file openni2_device.h.

## DepthImageCallbackFunction

using pcl::io::openni2::OpenNI2Device::DepthImageCallbackFunction = std::function<void(DepthImage::Ptr, void* cookie) >

Definition at line 80 of file openni2_device.h.

## ImageCallbackFunction

using pcl::io::openni2::OpenNI2Device::ImageCallbackFunction = std::function<void(Image::Ptr, void* cookie) >

Definition at line 79 of file openni2_device.h.

## IRImageCallbackFunction

using pcl::io::openni2::OpenNI2Device::IRImageCallbackFunction = std::function<void(IRImage::Ptr, void* cookie) >

Definition at line 81 of file openni2_device.h.

## Ptr

using pcl::io::openni2::OpenNI2Device::Ptr = shared_ptr<OpenNI2Device>

Definition at line 76 of file openni2_device.h.

## StreamCallbackFunction

using pcl::io::openni2::OpenNI2Device::StreamCallbackFunction = std::function<void(openni::VideoStream& stream)>

Definition at line 84 of file openni2_device.h.

## Constructor & Destructor Documentation

## OpenNI2Device()

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

## ~OpenNI2Device()

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

virtual

## Member Function Documentation

## findCompatibleColorMode()

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

## findCompatibleDepthMode()

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

## findCompatibleIRMode()

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

## findCompatibleVideoMode()

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

protected

## getAutoExposure()

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

## getAutoWhiteBalance()

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

## getBaseline()

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

## getColorFocalLength()

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

## getColorFrameCount()

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

Get absolute 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.

## getColorVideoMode()

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

## getColorVideoStream()

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

protected

## getDefaultColorMode()

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

## getDefaultDepthMode()

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

## getDefaultIRMode()

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

## getDepthFocalLength()

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

## getDepthFrameCount()

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

Get absolute 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.

## getDepthVideoMode()

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

## getDepthVideoStream()

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

protected

## getIRFocalLength()

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

## getIRFrameCount()

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

Get absolute 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.

## getIRVideoMode()

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

## getIRVideoStream()

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

protected

## getName()

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

## getShadowValue()

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

## getStringID()

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

## getSupportedColorVideoModes()

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

## getSupportedDepthVideoModes()

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

## getSupportedIRVideoModes()

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

## getUri()

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

## getUsbProductId()

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

## getUsbVendorId()

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

## getVendor()

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

## hasColorSensor()

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

## hasDepthSensor()

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

## hasIRSensor()

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

## isColorStreamStarted()

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

## isColorVideoModeSupported()

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

## isDepthRegistered()

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

## isDepthStreamStarted()

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

## isDepthVideoModeSupported()

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

## isFile()

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

inline

Definition at line 219 of file openni2_device.h.

## isImageRegistrationModeSupported()

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

## isIRStreamStarted()

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

## isIRVideoModeSupported()

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

## isSynchronizationSupported()

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

inline

Definition at line 213 of file openni2_device.h.

## isSynchronized()

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

inline

Definition at line 207 of file openni2_device.h.

## isValid()

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

## processColorFrame()

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

protected

## processDepthFrame()

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

protected

## processIRFrame()

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

protected

## resizingSupported()

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

protected

## setAutoExposure()

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

## setAutoWhiteBalance()

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

## setColorCallback()

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

## setColorVideoMode()

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

## setDepthCallback()

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

## setDepthVideoMode()

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

## setImageRegistrationMode()

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

## setIRCallback()

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

## setIRVideoMode()

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

## setPlaybackSpeed()

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.

## setSynchronization()

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

## setUseDeviceTimer()

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

## shutdown()

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

protected

## startColorStream()

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

## startDepthStream()

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

## startIRStream()

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

## stopAllStreams()

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

## stopColorStream()

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

## stopDepthStream()

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

## stopIRStream()

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

## Member Data Documentation

## baseline_

float pcl::io::openni2::OpenNI2Device::baseline_ {0.0f}

protected

distance between the projector and the IR camera in meters

Definition at line 323 of file openni2_device.h.

## color_frame_listener

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

protected

Definition at line 307 of file openni2_device.h.

## color_video_modes_

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

mutable protected

Definition at line 315 of file openni2_device.h.

## color_video_started_

bool pcl::io::openni2::OpenNI2Device::color_video_started_ {false}

protected

Definition at line 319 of file openni2_device.h.

## color_video_stream_

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

mutable protected

Definition at line 311 of file openni2_device.h.

## depth_frame_listener

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

protected

Definition at line 308 of file openni2_device.h.

## depth_video_modes_

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

mutable protected

Definition at line 316 of file openni2_device.h.

## depth_video_started_

bool pcl::io::openni2::OpenNI2Device::depth_video_started_ {false}

protected

Definition at line 320 of file openni2_device.h.

## depth_video_stream_

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

mutable protected

Definition at line 312 of file openni2_device.h.

## device_info_

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

protected

Definition at line 304 of file openni2_device.h.

## ir_frame_listener

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

protected

Definition at line 306 of file openni2_device.h.

## ir_video_modes_

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

mutable protected

Definition at line 314 of file openni2_device.h.

## ir_video_started_

bool pcl::io::openni2::OpenNI2Device::ir_video_started_ {false}

protected

Definition at line 318 of file openni2_device.h.

## ir_video_stream_

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

mutable protected

Definition at line 310 of file openni2_device.h.

## no_sample_value_

std::uint64_t pcl::io::openni2::OpenNI2Device::no_sample_value_ {0}

protected

the value for pixels without a valid disparity measurement

Definition at line 327 of file openni2_device.h.

## openni_device_

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

protected

Definition at line 303 of file openni2_device.h.

## shadow_value_

std::uint64_t pcl::io::openni2::OpenNI2Device::shadow_value_ {0}

protected

the value for shadow (occluded pixels)

Definition at line 325 of file openni2_device.h.

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

- pcl/io/openni2/openni2_device.h