ImFusion SDK 4.3
OpenNI2RGBDStream Class Reference

#include <RGBD/Include/ImFusion/RGBD/OpenNI2RGBDStream.h>

Provides a stream interface for RGB-D sensors using the OpenNI2 framework. More...

+ Inheritance diagram for OpenNI2RGBDStream:

Detailed Description

Provides a stream interface for RGB-D sensors using the OpenNI2 framework.

This class enables device enumeration, configuration, calibration management, and frame acquisition for a wide range of OpenNI2-compatible devices.

Typical usage involves enumerating available devices, opening a stream, configuring parameters, and acquiring synchronized depth and color frames.

if (!streams.empty())
{
auto& stream = streams.front();
stream->open();
// Acquire images, configure parameters, etc.
stream->close();
}
static std::vector< std::unique_ptr< OpenNI2RGBDStream > > enumerate()
Enumerates available OpenNI2 RGB-D streams and returns them as unique pointers.
Note
  • Supports multiple sensor types (Astra, Xtion, Primesense, etc.)
  • Calibration can be loaded from firmware, XML, or workspace.
  • Not thread-safe.
See also
RGBDStream

Public Types

enum  DistParamLayout { Auto = 0 , NewLayout , OldLayout }
 Sensor distortion parameter layout.
 
enum  SensorType {
  XtionProLive , Primesense , Kinect , Astra ,
  AstraS , AstraPlusS , AstraPro , AstraProS ,
  AstraMini , AstraMiniS , StructureSensor
}
 Sensor type enumeration.
 
- Public Types inherited from RGBDStream
enum  PixelFormat {
  Rgb24 , Rgb32 , Depth16 , Gray8 ,
  Gray16 , Yuv422
}
 Pixel format enumeration for RGB-D frames. More...
 
- Public Types inherited from Stream
enum class  ThreadingMode { BaseClassRunsWorkerThread , DerivedClassHandlesThreading }
 This flag represents the two supported threading modes of a Stream. More...
 
enum class  State {
  Closed , Opening , Open , Starting ,
  Running , Pausing , Paused , Resuming ,
  Stopping , Closing
}
 
- Public Types inherited from Data
enum  Kind {
  UNKNOWN = 0 , IMAGE = 1 , VOLUME = 2 , IMAGESET = 3 ,
  VOLUMESET = 4 , IMAGESTREAM = 5 , VOLUMESTREAM = 6 , POINTSET = 7 ,
  SURFACE = 8 , TRACKINGSTREAM = 9 , LIVETRACKINGSTREAM = TRACKINGSTREAM , TRACKINGDATA = 10 ,
  TREE = 11 , TENSOR = 12 , POLYDATASTREAM = 13 , STEREOIMAGESET = 14 ,
  STEREOIMAGESTREAM = 15 , VOLUMETRICMESH = 16
}
 Kind of data. More...
 
enum  Modality {
  NA = 0 , XRAY = 1 , CT = 2 , MRI = 3 ,
  ULTRASOUND = 4 , VIDEO = 5 , NM = 6 , OCT = 7 ,
  LABEL = 8 , DISTANCE = 9
}
 Image modality of the data. More...
 

Public Member Functions

 OpenNI2RGBDStream (const std::string &uri)
 Constructs a stream for the specified device URI.
 
 ~OpenNI2RGBDStream () override
 Destroys the stream and releases resources.
 
bool depthFormats (std::vector< FrameInfo > &formats) override
 Returns supported depth formats for the device.
 
bool colorFormats (std::vector< FrameInfo > &formats) override
 Returns supported color formats for the device.
 
bool depthFormat (FrameInfo &format) const override
 Returns the current depth format.
 
bool colorFormat (FrameInfo &format) const override
 Returns the current color format.
 
bool setDepthFormat (const FrameInfo &format) override
 Sets the depth format.
 
bool setColorFormat (const FrameInfo &format) override
 Sets the color format.
 
bool supportsColor () const override
 Returns true if the device supports color images.
 
std::string name () const override
 Returns the device name.
 
std::string uuid () override
 Returns the device UUID.
 
std::string serialNumber () const override
 Returns the device serial number.
 
bool supportsAutoWhiteBalance () const override
 Returns true if auto white balance is supported.
 
bool setAutoWhiteBalanceEnabled (bool enable) override
 Enables or disables auto white balance.
 
bool isAutoWhiteBalanceEnabled () const override
 Returns true if auto white balance is enabled.
 
bool supportsAutoExposure () const override
 Returns true if auto exposure is supported.
 
bool setAutoExposureEnabled (bool enable) override
 Enables or disables auto exposure.
 
bool isAutoExposureEnabled () const override
 Returns true if auto exposure is enabled.
 
bool supportsIRAutoExposure () const
 Returns true if IR auto exposure is supported.
 
bool setIRAutoExposureEnabled (bool enable)
 Enables or disables IR auto exposure.
 
bool isIRAutoExposureEnabled () const
 Returns true if IR auto exposure is enabled.
 
bool isGainSupported () const override
 Returns true if gain is supported.
 
bool setGain (int value) override
 Sets the gain value.
 
int gain () const override
 Returns the current gain value.
 
std::pair< int, int > gainRange () const
 Returns the supported gain range.
 
bool isExposureSupported () const override
 Returns true if exposure is supported.
 
bool setExposure (int value) override
 Sets the exposure value.
 
int exposure () const override
 Returns the current exposure value.
 
std::pair< int, int > exposureRange () const
 Returns the supported exposure range.
 
bool isIrExposureSupported () const
 Returns true if IR exposure is supported.
 
bool setIrExposure (int value)
 Sets the IR exposure value.
 
int irExposure () const
 Returns the current IR exposure value.
 
std::pair< int, int > irExposureRange () const
 Returns the supported IR exposure range.
 
bool isIrGainSupported () const
 Returns true if IR gain is supported.
 
bool setIrGain (int value)
 Sets the IR gain value.
 
int irGain () const
 Returns the current IR gain value.
 
std::pair< int, int > irGainRange () const
 Returns the supported IR gain range.
 
bool usingFactoryCalibration () const override
 Returns true if factory calibration is used.
 
bool depthK (mat3 &K) const override
 Returns the depth camera intrinsic matrix.
 
bool depthDist (Eigen::Matrix< double, 5, 1 > &dist) const override
 Returns the depth camera distortion coefficients.
 
bool dropCorruptDepthData (bool &drop) const
 Returns whether corrupt depth data is dropped.
 
bool corruptDepthRange (vec2 &range) const
 Returns the range for corrupt depth data.
 
bool colorK (mat3 &K) const override
 Returns the color camera intrinsic matrix.
 
bool colorDist (Eigen::Matrix< double, 5, 1 > &dist) const override
 Returns the color camera distortion coefficients.
 
bool depthToColorT (mat4 &T) const override
 Returns the transformation from depth to color camera.
 
bool setDepthK (const mat3 &K) override
 Sets the depth camera intrinsic matrix.
 
bool setDepthDist (const Eigen::Matrix< double, 5, 1 > &dist) override
 Sets the depth camera distortion coefficients.
 
bool setDropCorruptDepthData (bool drop)
 Sets whether to drop corrupt depth data.
 
bool setCorruptDepthRange (const vec2 &range)
 Sets the range for corrupt depth data.
 
bool setColorK (const mat3 &K) override
 Sets the color camera intrinsic matrix.
 
bool setColorDist (const Eigen::Matrix< double, 5, 1 > &dist) override
 Sets the color camera distortion coefficients.
 
bool setDepthToColorT (const mat4 &T) override
 Sets the transformation from depth to color camera.
 
void setEnableRadialDistortionCorrection (bool enable)
 Enables or disables radial distortion correction.
 
bool enableRadialDistortionCorrection () const
 Returns true if radial distortion correction is enabled.
 
int irToDepthVerticalShift () const
 Returns the vertical pixel shift between IR and depth images.
 
bool loadCalibration (const Properties *p) override
 Loads calibration from a Properties object.
 
bool saveCalibration (Properties *p) const override
 Saves calibration to a Properties object.
 
bool overwriteFirmwareCalibration (const mat3 &depthK, const vec5 &depthDist, const mat3 &colorK, const vec5 &colorDist, const mat4 &depthToColorT)
 Overwrites the firmware calibration (Astra Mini S/Plus S only).
 
bool readFirmwareCalibration (mat3 &depthK, vec5 &depthDist, mat3 &colorK, vec5 &colorDist, mat4 &depthToColorT) const
 Reads the firmware calibration (Astra Mini S/Plus S only).
 
int depthImageWidth () const override
 Returns the width of the depth image.
 
int depthImageHeight () const override
 Returns the height of the depth image.
 
int colorImageWidth () const override
 Returns the width of the color image.
 
int colorImageHeight () const override
 Returns the height of the color image.
 
bool grabImage (float *depthData, unsigned char *colorData, int timeOut=500) override
 Grabs a synchronized depth and color image.
 
void setDisparity (bool use)
 Enables or disables disparity mode.
 
bool disparity () const
 Returns true if disparity mode is enabled.
 
bool isIRSupported () const
 Returns true if IR is supported.
 
void setIR (bool use)
 Enables or disables IR mode.
 
bool IR () const
 Returns true if IR mode is enabled.
 
bool isLaserStateChangeSupported ()
 Returns true if laser state change is supported.
 
bool setLaserState (bool enable) override
 Enables or disables the laser.
 
bool laserState () const override
 Returns true if the laser is enabled.
 
bool isDepthColorSyncSupported () const
 Returns true if depth-color synchronization is supported.
 
void setDepthColorSyncEnabled (bool value)
 Enables or disables depth-color synchronization.
 
bool depthColorSyncEnabled () const
 Returns true if depth-color synchronization is enabled.
 
bool isMaxFrameDelaySupported () const
 Returns true if maximum frame delay is supported.
 
void setMaximumFrameDelay (int maxDelay)
 Sets the maximum frame delay for synchronization.
 
int maximumFrameDelay () const
 Returns the maximum frame delay for synchronization.
 
void configure (const Properties *p) override
 Configures the stream from a Properties object.
 
void configuration (Properties *p) const override
 Writes the current configuration to a Properties object.
 
bool isAstra (bool withPro=true) const
 Returns true if the device is an Astra (optionally with Pro).
 
bool isAstraMini () const
 Returns true if the device is an Astra Mini.
 
bool isAstraMiniRev2 () const
 Returns true if the device is an Astra Mini Rev2.
 
bool isAsus () const
 Returns true if the device is an Asus sensor.
 
bool hasXMLBasedCalibration () const
 Returns true if XML-based calibration is available.
 
bool hasWorkspaceBasedCalibration () const
 Returns true if workspace-based calibration is available.
 
void setWorkspaceBasedCalibration (bool value)
 Enables or disables workspace-based calibration.
 
void setNoColor (bool noColor)
 Enables or disables color stream.
 
uint16_t vid () const
 Returns the USB vendor ID.
 
uint16_t pid () const
 Returns the USB product ID.
 
std::string uri () const
 Returns the device URI.
 
bool isDepthWorkModeSupported () const
 Returns true if depth work mode is supported.
 
void setDepthWorkMode (const std::string &value)
 Sets the depth work mode.
 
std::string depthWorkMode () const
 Returns the current depth work mode.
 
std::vector< std::stringdepthWorkModes () const
 Returns the list of supported depth work modes.
 
bool distortionLayoutChangeSupported () const
 Returns true if distortion layout change is supported.
 
bool setDistortionParamLayout (DistParamLayout layout)
 Sets the distortion parameter layout.
 
DistParamLayout distortionParamLayout () const
 Returns the current distortion parameter layout.
 
SensorType sensorType () const
 Returns the sensor type.
 
- Public Member Functions inherited from RGBDStream
virtual bool grabSingleFrame ()
 Grabs a single RGBD frame.
 
virtual bool isOpen () const
 
virtual std::string firmwareVersion () const
 
 RGBDStream (const std::string &name="")
 
virtual bool supportsSingleFrameGrab () const
 Returns if the stream supports single frame capture model; set false by default.
 
virtual bool startOnImport () const
 Returns if the stream shall be started on import; set true by default.
 
virtual bool selectDefaultFrameFormat ()
 
virtual bool createDefaultStreamController () override final
 Indicates whether a StreamController should be created for the stream.
 
std::unique_ptr< RGBDDataComponentgetRGBDDataComponentCopy ()
 Returns the copy of the RGBDDataComponent. If it wasn't present before, it is added and updated.
 
- Public Member Functions inherited from ImageStream
 ImageStream (const std::string &name="")
 
Data::Kind kind () const override final
 Returns the kind (typically IMAGESTREAM or VOLUMESTREAM)
 
void setModality (Modality m)
 Set the modality descriptor of this stream.
 
Modality modality () const override final
 Return the modality of this stream.
 
virtual bool topDown () const
 Specify whether the first line of the image data is to be displayed on top.
 
int size () const override
 Returns the number of images of the image stream per emission.
 
std::string describe () const override
 Short description of the stream including latest state and update rate information.
 
- Public Member Functions inherited from Stream
 Stream (const std::string &name="")
 Constructor with the name for this stream.
 
virtual ThreadingMode threadingMode () const
 Configures threading mode of stream.
 
virtual bool supportsAsyncOperation ()
 Returns true if xxxAsync() methods support execution in a background thread.
 
std::shared_future< bool > openAsync ()
 Open stream in an asynchronous fashion (wait on the returned future before taking further actions). Returns whether the operation was successful.
 
std::shared_future< bool > closeAsync ()
 Close stream in an asynchronous fashion (wait on the returned future before taking further actions). Returns whether the operation was successful.
 
std::shared_future< bool > startAsync ()
 Start stream in an asynchronous fashion (wait on the returned future before taking further actions). Returns whether the operation was successful.
 
std::shared_future< bool > stopAsync ()
 Stop stream in an asynchronous fashion (wait on the returned future before taking further actions). Returns whether the operation was successful.
 
std::shared_future< bool > pauseAsync ()
 Pause stream in an asynchronous fashion (wait on the returned future before taking further actions). Returns whether the operation was successful.
 
std::shared_future< bool > resumeAsync ()
 Resume stream in an asynchronous fashion (wait on the returned future before taking further actions). Returns whether the operation was successful.
 
bool open ()
 Open stream and wait for the operation to complete. Returns whether the operation was successful.
 
bool close ()
 Close stream and wait for the operation to complete. Returns whether the operation was successful.
 
bool start ()
 Start stream and wait for the operation to complete. Returns whether the operation was successful.
 
bool stop ()
 Stop stream and wait for the operation to complete. Returns whether the operation was successful.
 
bool pause ()
 Pause stream and wait for the operation to complete. Returns whether the operation was successful.
 
bool resume ()
 Resume stream and wait for the operation to complete. Returns whether the operation was successful.
 
virtual bool supportsPausing () const
 Override and return true if this stream implements the pausing and resume operations.
 
bool restart ()
 Stops, closes, opens and starts the stream. Returns whether the operation was successful.
 
virtual bool reset ()
 Reverts stream to first frame, if possible. Returns whether the operation was successful.
 
virtual bool isRunning () const
 Return whether stream is currently running.
 
State currentState () const
 
bool isStateOneOf (const std::vector< State > &states) const
 
Geometry::AlignedBox bounds () const override
 Per default a Stream has empty/invalid bounds.
 
Pose::TransformationConvention matrixConvention () const override
 Matrices of streams by default map to the world coordinate system.
 
double updateRate () const
 Average update rate in Hz of the signalStreamData.
 
std::string describe () const override
 Short description of the stream including latest state and update rate information.
 
- Public Member Functions inherited from Data
 Data (const std::string &name="")
 
 Data (const Data &other)
 
Dataoperator= (const Data &other)
 
virtual ~Data ()
 Mandatory virtual destructor.
 
const std::stringname () const
 Return the name of this data.
 
void setName (const std::string &name)
 Sets the name of this data.
 
virtual bool isAnnotationType () const
 Return whether this data type is visualized through an annotation (e.g. mesh)
 
const DataComponentListcomponents () const
 Returns the list of DataComponents for this data.
 
DataComponentListcomponents ()
 
virtual void setMatrixFromWorld (const mat4 &m)
 Set matrix mapping from the world coordinate system to the data coordinate system.
 
virtual void setMatrixToWorld (const mat4 &m)
 Set matrix mapping from the data coordinate system to the world coordinate system.
 
virtual mat4 matrixFromWorld () const
 Get matrix mapping from the world coordinate system to the data coordinate system.
 
virtual mat4 matrixToWorld () const
 Get matrix mapping from the data coordinate system to the world coordinate system.
 
virtual mat4 matrix () const
 Return the transformation matrix.
 
virtual void setMatrix (const mat4 &m)
 Set the transformation matrix.
 
- Public Member Functions inherited from Configurable
virtual void configureDefaults ()
 Retrieve the properties of this object, replaces values with their defaults and sets it again.
 
void registerParameter (ParameterBase *param)
 Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration().
 
void unregisterParameter (const ParameterBase *param)
 Remove the given Parameter or SubProperty from the list of registered parameters.
 
 Configurable (const Configurable &rhs)
 
 Configurable (Configurable &&rhs) noexcept
 
Configurableoperator= (const Configurable &)
 
Configurableoperator= (Configurable &&) noexcept
 
- Public Member Functions inherited from Selectable
 Selectable (const Selectable &)
 
 Selectable (Selectable &&)
 
Selectableoperator= (const Selectable &)
 
Selectableoperator= (Selectable &&)
 
virtual Selection selection () const
 
virtual int focus () const
 
virtual void setSelection (const Selection &sel)
 Set the underlying selection.
 
virtual void setFocus (int index)
 Set focus of the selection.
 

Static Public Member Functions

static std::vector< OpenNI2RGBDStream * > enumerateStreams ()
 Enumerates available OpenNI2 RGB-D streams (deprecated, use enumerate()).
 
static std::vector< std::unique_ptr< OpenNI2RGBDStream > > enumerate ()
 Enumerates available OpenNI2 RGB-D streams and returns them as unique pointers.
 
- Static Public Member Functions inherited from Stream
static std::string stateToString (State state)
 
- Static Public Member Functions inherited from Data
static std::string modalityString (Data::Modality m)
 Return the name of an image modality.
 
static Data::Modality stringToModality (const std::string &s)
 Returns the modality corresponding to a modality string or NA if nothing matches.
 

Protected Member Functions

bool openImpl () override
 Open stream.
 
bool closeImpl () override
 Close stream.
 
bool startImpl () override
 Start stream.
 
bool stopImpl () override
 Stop stream.
 
std::optional< WorkContinuationdoWork () override
 Create one StreamData and publish it (this function will be called at the desired frame rate) If this is not desired, you can do the following: return std::nullopt;.
 
bool defaultColorResolution (int &width, int &height) override
 Returns default color resolution.
 
bool defaultDepthResolution (int &width, int &height) override
 Returns default depth resolution.
 
void retrieveOpenNICalibration (mat3 &depthK, mat3 &colorK)
 
bool readAstraCalib (mat3 &depthK, mat3 &colorK, vec5 &depthDist, vec5 &colorDist, mat4 &depthToColorT, std::string &hash, DistParamLayout &layout) const
 
std::string firmwareSerial () const
 
void computeCalibration ()
 
void initDepthUndistortionMap ()
 
void initColorUndistortionMap ()
 
void initIRUndistortionMap ()
 
void preprocessDepthImage (TypedImage< float > *imgDepth)
 
void preprocessColorImage (TypedImage< unsigned char > *imgColor)
 
template<typename T>
void undistortBrown (TypedImage< T > *imgIn, TypedImage< T > *imgOut, const mat3 &K, const Eigen::Matrix< double, 5, 1 > &dist)
 
- Protected Member Functions inherited from RGBDStream
virtual void onRGBDDataComponentChanged ()
 Called when the RGBDDataComponent changes.
 
- Protected Member Functions inherited from ImageStream
void setKind (Kind k)
 Sets the kind (typically IMAGESTREAM or VOLUMESTREAM) and emits signalKindChanged.
 
bool workerThreadRequiresOpenGl () const override
 Ensure the thread has an GL context before the main loop starts.
 
- Protected Member Functions inherited from Stream
virtual bool pauseImpl ()
 Pause stream (not required to be supported).
 
virtual bool resumeImpl ()
 Resume stream from pause (only required to be supported when pauseImpl() is supported).
 
virtual bool worksWhilePaused () const
 Override if doWork() should be called also in the Paused state.
 
void changeState (State newState)
 
std::shared_future< bool > attemptStateChange (std::function< bool()> work, State stateWorking, State stateSuccess, State stateError)
 
- Protected Member Functions inherited from Data
void swapWith (Data &other)
 Swaps the data and emits a matrix and name changed signal for both.
 

Additional Inherited Members

- Public Attributes inherited from ImageStream
Signal< Data::KindsignalKindChanged
 Is emitted when the stream changes between IMAGESTREAM and VOLUMESTREAM, before the next ImageStreamData is emitted.
 
- Public Attributes inherited from Stream
ProtectedSignal< StateChangesignalStateChanged
 Emitted after a state change has been completed with the old and new state.
 
ProtectedSignal signalEnded
 Indicates that the stream reached the end of its data, e.g. when a video stream has played to the end.
 
ProtectedSignal< std::shared_ptr< const StreamData > > signalStreamData
 Signal that is emitted by the stream when a new StreamData is available.
 
DeprecatedSignal< ProtectedSignal< std::shared_ptr< const StreamData > >, const StreamData & > signalNewData
 Signal that is emitted by the stream when a new StreamData is available.
 
- Public Attributes inherited from Data
Signal< const Data * > signalDeleted
 Signal emitted when this instance is deleted.
 
Signal< const Data * > signalMatrixChanged
 Signal emitted when the transformation of this Data has changed.
 
Signal< std::stringsignalNameChanged
 Signal emitted when the name changed.
 
- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 
- Public Attributes inherited from Selectable
ProtectedSignal signalSelectionChanged
 Signals that the selection or size might have changed.
 
- Protected Attributes inherited from Data
mat4 m_matrix
 Transformation matrix.
 
std::recursive_mutexm_matrixMutex
 Used to internally synchronize access to the matrix of data.
 
DataComponentList m_dataComponentList
 The list of DataComponents for this data.
 
- Protected Attributes inherited from Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 
- Protected Attributes inherited from Selectable
std::mutex m_selectionMutex
 Mutex protecting the selection.
 
Selection m_sel
 

Member Function Documentation

◆ enumerateStreams()

static std::vector< OpenNI2RGBDStream * > enumerateStreams ( )
static

Enumerates available OpenNI2 RGB-D streams (deprecated, use enumerate()).

Deprecated
"Use enumerate() instead, which makes ownership explicit"

◆ depthFormats()

bool depthFormats ( std::vector< FrameInfo > & formats)
overridevirtual

Returns supported depth formats for the device.

Reimplemented from RGBDStream.

◆ colorFormats()

bool colorFormats ( std::vector< FrameInfo > & formats)
overridevirtual

Returns supported color formats for the device.

Reimplemented from RGBDStream.

◆ depthFormat()

bool depthFormat ( FrameInfo & format) const
overridevirtual

Returns the current depth format.

Reimplemented from RGBDStream.

◆ colorFormat()

bool colorFormat ( FrameInfo & format) const
overridevirtual

Returns the current color format.

Reimplemented from RGBDStream.

◆ setDepthFormat()

bool setDepthFormat ( const FrameInfo & format)
overridevirtual

Sets the depth format.

Reimplemented from RGBDStream.

◆ setColorFormat()

bool setColorFormat ( const FrameInfo & format)
overridevirtual

Sets the color format.

Reimplemented from RGBDStream.

◆ supportsColor()

bool supportsColor ( ) const
overridevirtual

Returns true if the device supports color images.

Implements RGBDStream.

◆ name()

std::string name ( ) const
overridevirtual

Returns the device name.

Reimplemented from RGBDStream.

◆ uuid()

std::string uuid ( )
overridevirtual

Returns the device UUID.

Implements Stream.

◆ serialNumber()

std::string serialNumber ( ) const
overridevirtual

Returns the device serial number.

Reimplemented from RGBDStream.

◆ supportsAutoWhiteBalance()

bool supportsAutoWhiteBalance ( ) const
overridevirtual

Returns true if auto white balance is supported.

Reimplemented from RGBDStream.

◆ setAutoWhiteBalanceEnabled()

bool setAutoWhiteBalanceEnabled ( bool enable)
overridevirtual

Enables or disables auto white balance.

Reimplemented from RGBDStream.

◆ isAutoWhiteBalanceEnabled()

bool isAutoWhiteBalanceEnabled ( ) const
overridevirtual

Returns true if auto white balance is enabled.

Reimplemented from RGBDStream.

◆ supportsAutoExposure()

bool supportsAutoExposure ( ) const
overridevirtual

Returns true if auto exposure is supported.

Reimplemented from RGBDStream.

◆ setAutoExposureEnabled()

bool setAutoExposureEnabled ( bool enable)
overridevirtual

Enables or disables auto exposure.

Reimplemented from RGBDStream.

◆ isAutoExposureEnabled()

bool isAutoExposureEnabled ( ) const
overridevirtual

Returns true if auto exposure is enabled.

Reimplemented from RGBDStream.

◆ isGainSupported()

bool isGainSupported ( ) const
overridevirtual

Returns true if gain is supported.

Reimplemented from RGBDStream.

◆ setGain()

bool setGain ( int value)
overridevirtual

Sets the gain value.

Reimplemented from RGBDStream.

◆ gain()

int gain ( ) const
overridevirtual

Returns the current gain value.

Reimplemented from RGBDStream.

◆ isExposureSupported()

bool isExposureSupported ( ) const
overridevirtual

Returns true if exposure is supported.

Reimplemented from RGBDStream.

◆ setExposure()

bool setExposure ( int value)
overridevirtual

Sets the exposure value.

Reimplemented from RGBDStream.

◆ exposure()

int exposure ( ) const
overridevirtual

Returns the current exposure value.

Reimplemented from RGBDStream.

◆ usingFactoryCalibration()

bool usingFactoryCalibration ( ) const
overridevirtual

Returns true if factory calibration is used.

Reimplemented from RGBDStream.

◆ depthK()

bool depthK ( mat3 & K) const
overridevirtual

Returns the depth camera intrinsic matrix.

Reimplemented from RGBDStream.

◆ depthDist()

bool depthDist ( Eigen::Matrix< double, 5, 1 > & dist) const
overridevirtual

Returns the depth camera distortion coefficients.

Reimplemented from RGBDStream.

◆ dropCorruptDepthData()

bool dropCorruptDepthData ( bool & drop) const
virtual

Returns whether corrupt depth data is dropped.

Reimplemented from RGBDStream.

◆ colorK()

bool colorK ( mat3 & K) const
overridevirtual

Returns the color camera intrinsic matrix.

Reimplemented from RGBDStream.

◆ colorDist()

bool colorDist ( Eigen::Matrix< double, 5, 1 > & dist) const
overridevirtual

Returns the color camera distortion coefficients.

Reimplemented from RGBDStream.

◆ depthToColorT()

bool depthToColorT ( mat4 & T) const
overridevirtual

Returns the transformation from depth to color camera.

Reimplemented from RGBDStream.

◆ setDepthK()

bool setDepthK ( const mat3 & K)
overridevirtual

Sets the depth camera intrinsic matrix.

Reimplemented from RGBDStream.

◆ setDepthDist()

bool setDepthDist ( const Eigen::Matrix< double, 5, 1 > & dist)
overridevirtual

Sets the depth camera distortion coefficients.

Reimplemented from RGBDStream.

◆ setDropCorruptDepthData()

bool setDropCorruptDepthData ( bool drop)
virtual

Sets whether to drop corrupt depth data.

Reimplemented from RGBDStream.

◆ setColorK()

bool setColorK ( const mat3 & K)
overridevirtual

Sets the color camera intrinsic matrix.

Reimplemented from RGBDStream.

◆ setColorDist()

bool setColorDist ( const Eigen::Matrix< double, 5, 1 > & dist)
overridevirtual

Sets the color camera distortion coefficients.

Reimplemented from RGBDStream.

◆ setDepthToColorT()

bool setDepthToColorT ( const mat4 & T)
overridevirtual

Sets the transformation from depth to color camera.

Reimplemented from RGBDStream.

◆ loadCalibration()

bool loadCalibration ( const Properties * p)
overridevirtual

Loads calibration from a Properties object.

Reimplemented from RGBDStream.

◆ saveCalibration()

bool saveCalibration ( Properties * p) const
overridevirtual

Saves calibration to a Properties object.

Reimplemented from RGBDStream.

◆ depthImageWidth()

int depthImageWidth ( ) const
overridevirtual

Returns the width of the depth image.

Implements RGBDStream.

◆ depthImageHeight()

int depthImageHeight ( ) const
overridevirtual

Returns the height of the depth image.

Implements RGBDStream.

◆ colorImageWidth()

int colorImageWidth ( ) const
overridevirtual

Returns the width of the color image.

Implements RGBDStream.

◆ colorImageHeight()

int colorImageHeight ( ) const
overridevirtual

Returns the height of the color image.

Implements RGBDStream.

◆ grabImage()

bool grabImage ( float * depthData,
unsigned char * colorData,
int timeOut = 500 )
overridevirtual

Grabs a synchronized depth and color image.

Reimplemented from RGBDStream.

◆ setLaserState()

bool setLaserState ( bool enable)
overridevirtual

Enables or disables the laser.

Reimplemented from RGBDStream.

◆ laserState()

bool laserState ( ) const
overridevirtual

Returns true if the laser is enabled.

Reimplemented from RGBDStream.

◆ configure()

void configure ( const Properties * p)
overridevirtual

Configures the stream from a Properties object.

Reimplemented from Configurable.

◆ configuration()

void configuration ( Properties * p) const
overridevirtual

Writes the current configuration to a Properties object.

Reimplemented from Configurable.

◆ openImpl()

bool openImpl ( )
overrideprotectedvirtual

Open stream.

Returns whether the operation was successful. This method is responsible for allocating necessary resources, initializing device handles, and establishing connections to devices. Implementers should ensure that all one-time setup tasks are completed here.

Implements Stream.

◆ closeImpl()

bool closeImpl ( )
overrideprotectedvirtual

Close stream.

Returns whether the operation was successful. This method should be used to free any resources that were allocated during the openImpl() call and to disconnect from any devices. Implementers must ensure that all resources are properly released to avoid memory leaks.

Implements Stream.

◆ startImpl()

bool startImpl ( )
overrideprotectedvirtual

Start stream.

Returns whether the operation was successful. This method is intended to initiate the actual data readout process or to connect a callback function for data handling. Implementers should ensure that the stream is ready and producing data after this call.

Implements Stream.

◆ stopImpl()

bool stopImpl ( )
overrideprotectedvirtual

Stop stream.

Returns whether the operation was successful. This method should halt any ongoing data readouts or callbacks, effectively pausing the data flow to reduce CPU load. Implementers should ensure that the stream can be restarted after this call.

Implements Stream.

◆ doWork()

std::optional< WorkContinuation > doWork ( )
overrideprotectedvirtual

Create one StreamData and publish it (this function will be called at the desired frame rate) If this is not desired, you can do the following: return std::nullopt;.

Implements Stream.

◆ defaultColorResolution()

bool defaultColorResolution ( int & width,
int & height )
overrideprotectedvirtual

Returns default color resolution.

Reimplemented from RGBDStream.

◆ defaultDepthResolution()

bool defaultDepthResolution ( int & width,
int & height )
overrideprotectedvirtual

Returns default depth resolution.

Reimplemented from RGBDStream.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close