Point Cloud Library (PCL)  1.9.1-dev
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
pcl::io::openni2::OpenNI2Device Class Reference

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

Public Types

using Ptr = boost::shared_ptr< 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
 
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 absolute number of depth frames in the current stream. More...
 
int getColorFrameCount ()
 Get absolute number of color frames in the current stream. More...
 
int getIRFrameCount ()
 Get absolute 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< OpenNI2FrameListenerir_frame_listener
 
boost::shared_ptr< OpenNI2FrameListenercolor_frame_listener
 
boost::shared_ptr< OpenNI2FrameListenerdepth_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< OpenNI2VideoModeir_video_modes_
 
std::vector< OpenNI2VideoModecolor_video_modes_
 
std::vector< OpenNI2VideoModedepth_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 71 of file openni2_device.h.

Member Typedef Documentation

◆ CallbackHandle

Definition at line 79 of file openni2_device.h.

◆ DepthImageCallbackFunction

Definition at line 77 of file openni2_device.h.

◆ ImageCallbackFunction

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

Definition at line 76 of file openni2_device.h.

◆ IRImageCallbackFunction

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

Definition at line 78 of file openni2_device.h.

◆ Ptr

Definition at line 74 of file openni2_device.h.

◆ StreamCallbackFunction

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

Definition at line 81 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()

boost::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()

boost::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()

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

◆ getName()

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

◆ getShadowValue()

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()

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

◆ getUsbVendorId()

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 216 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 210 of file openni2_device.h.

◆ isSynchronized()

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

Definition at line 204 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 ( size_t  input_width,
size_t  input_height,
size_t  output_width,
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]speedThe 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_
protected

distance between the projector and the IR camera in meters

Definition at line 320 of file openni2_device.h.

◆ color_frame_listener

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

Definition at line 304 of file openni2_device.h.

◆ color_video_modes_

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

Definition at line 312 of file openni2_device.h.

◆ color_video_started_

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

Definition at line 316 of file openni2_device.h.

◆ color_video_stream_

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

Definition at line 308 of file openni2_device.h.

◆ depth_frame_listener

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

Definition at line 305 of file openni2_device.h.

◆ depth_video_modes_

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

Definition at line 313 of file openni2_device.h.

◆ depth_video_started_

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

Definition at line 317 of file openni2_device.h.

◆ depth_video_stream_

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

Definition at line 309 of file openni2_device.h.

◆ device_info_

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

Definition at line 301 of file openni2_device.h.

◆ ir_frame_listener

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

Definition at line 303 of file openni2_device.h.

◆ ir_video_modes_

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

Definition at line 311 of file openni2_device.h.

◆ ir_video_started_

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

Definition at line 315 of file openni2_device.h.

◆ ir_video_stream_

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

Definition at line 307 of file openni2_device.h.

◆ no_sample_value_

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

the value for pixels without a valid disparity measurement

Definition at line 324 of file openni2_device.h.

◆ openni_device_

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

Definition at line 300 of file openni2_device.h.

◆ shadow_value_

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

the value for shadow (occluded pixels)

Definition at line 322 of file openni2_device.h.


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