MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitk::ToFCameraDevice Class Referenceabstract

Virtual interface and base class for all Time-of-Flight devices. More...

#include <mitkToFCameraDevice.h>

Inheritance diagram for mitk::ToFCameraDevice:
mitk::KinectDevice mitk::KinectV2Device mitk::ToFCameraMESADevice mitk::ToFCameraMITKPlayerDevice mitk::ToFCameraPMDDevice mitk::ToFCameraPMDRawDataDevice mitk::ToFCameraMESASR4000Device mitk::ToFCameraMITKPlayerDeviceImpl mitk::ToFCameraPMDCamBoardDevice mitk::ToFCameraPMDCamCubeDevice mitk::ToFCameraPMDO3Device mitk::ToFCameraPMDPlayerDevice mitk::ToFCameraPMDRawDataCamBoardDevice mitk::ToFCameraPMDRawDataCamCubeDevice

Public Member Functions

 mitkClassMacroItkParent (ToFCameraDevice, itk::Object)
 
virtual bool OnConnectCamera ()=0
 Opens a connection to the ToF camera. Has to be implemented in the specialized inherited classes.
 
virtual bool ConnectCamera ()
 ConnectCamera Internally calls OnConnectCamera() of the respective device implementation.
 
virtual bool DisconnectCamera ()=0
 closes the connection to the camera
 
virtual void StartCamera ()=0
 starts the continuous updating of the camera. A separate thread updates the source data, the main thread processes the source data and creates images and coordinates
 
virtual void StopCamera ()
 stops the continuous updating of the camera
 
virtual bool IsCameraActive ()
 returns true if the camera is connected and started
 
virtual bool IsCameraConnected ()
 returns true if the camera is connected
 
virtual void UpdateCamera ()=0
 updates the camera for image acquisition
 
virtual void GetAmplitudes (float *amplitudeArray, int &imageSequence)=0
 gets the amplitude data from the ToF camera as the strength of the active illumination of every pixel These values can be used to determine the quality of the distance values. The higher the amplitude value, the higher the accuracy of the according distance value
 
virtual void GetIntensities (float *intensityArray, int &imageSequence)=0
 gets the intensity data from the ToF camera as a greyscale image
 
virtual void GetDistances (float *distanceArray, int &imageSequence)=0
 gets the distance data from the ToF camera measuring the distance between the camera and the different object points in millimeters
 
virtual void GetAllImages (float *distanceArray, float *amplitudeArray, float *intensityArray, char *sourceDataArray, int requiredImageSequence, int &capturedImageSequence, unsigned char *rgbDataArray=nullptr)=0
 gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images.
 
 itkGetMacro (CaptureWidth, int)
 get the currently set capture width
 
 itkGetMacro (CaptureHeight, int)
 get the currently set capture height
 
 itkGetMacro (SourceDataSize, int)
 get the currently set source data size
 
 itkGetMacro (BufferSize, int)
 get the currently set buffer size
 
 itkGetMacro (MaxBufferSize, int)
 get the currently set max buffer size
 
void SetBoolProperty (const char *propertyKey, bool boolValue)
 set a bool property in the property list
 
void SetIntProperty (const char *propertyKey, int intValue)
 set an int property in the property list
 
void SetFloatProperty (const char *propertyKey, float floatValue)
 set a float property in the property list
 
void SetStringProperty (const char *propertyKey, const char *stringValue)
 set a string property in the property list
 
virtual void SetProperty (const char *propertyKey, BaseProperty *propertyValue)
 set a BaseProperty property in the property list
 
virtual BaseProperty * GetProperty (const char *propertyKey)
 get a BaseProperty from the property list
 
bool GetBoolProperty (const char *propertyKey, bool &boolValue)
 get a bool from the property list
 
bool GetStringProperty (const char *propertyKey, std::string &string)
 get a string from the property list
 
bool GetIntProperty (const char *propertyKey, int &integer)
 get an int from the property list
 
virtual int GetRGBCaptureWidth ()
 
virtual int GetRGBCaptureHeight ()
 

Protected Member Functions

 ToFCameraDevice ()
 
 ~ToFCameraDevice () override
 
virtual void AllocatePixelArrays ()
 method for allocating memory for pixel arrays m_IntensityArray, m_DistanceArray and m_AmplitudeArray
 
virtual void CleanupPixelArrays ()
 method for cleanup memory allocated for pixel arrays m_IntensityArray, m_DistanceArray and m_AmplitudeArray
 

Protected Attributes

float * m_IntensityArray
 float array holding the intensity image
 
float * m_DistanceArray
 float array holding the distance image
 
float * m_AmplitudeArray
 float array holding the amplitude image
 
int m_BufferSize
 buffer size of the image buffer needed for loss-less acquisition of range data
 
int m_MaxBufferSize
 maximal buffer size needed for initialization of data arrays. Default value is 100.
 
int m_CurrentPos
 current position in the buffer which will be retrieved by the Get methods
 
int m_FreePos
 current position in the buffer which will be filled with data acquired from the hardware
 
int m_CaptureWidth
 width of the range image (x dimension)
 
int m_CaptureHeight
 height of the range image (y dimension)
 
int m_PixelNumber
 number of pixels in the range image (m_CaptureWidth*m_CaptureHeight)
 
int m_RGBImageWidth
 width of the RGB image (x dimension)
 
int m_RGBImageHeight
 height of the RGB image (y dimension)
 
int m_RGBPixelNumber
 number of pixels in the range image (m_RGBImageWidth*m_RGBImageHeight)
 
int m_SourceDataSize
 size of the PMD source data
 
std::mutex m_ImageMutex
 mutex for images provided by the range camera
 
std::mutex m_CameraActiveMutex
 mutex for the cameraActive flag
 
std::thread m_Thread
 
bool m_CameraActive
 flag indicating if the camera is currently active or not. Caution: thread safe access only!
 
bool m_CameraConnected
 flag indicating if the camera is successfully connected or not. Caution: thread safe access only!
 
int m_ImageSequence
 counter for acquired images
 
PropertyList::Pointer m_PropertyList
 a list of the corresponding properties
 

Detailed Description

Virtual interface and base class for all Time-of-Flight devices.

Definition at line 37 of file mitkToFCameraDevice.h.

Constructor & Destructor Documentation

◆ ToFCameraDevice()

mitk::ToFCameraDevice::ToFCameraDevice ( )
protected

Definition at line 17 of file mitkToFCameraDevice.cpp.

◆ ~ToFCameraDevice()

mitk::ToFCameraDevice::~ToFCameraDevice ( )
overrideprotected

Definition at line 38 of file mitkToFCameraDevice.cpp.

Member Function Documentation

◆ AllocatePixelArrays()

void mitk::ToFCameraDevice::AllocatePixelArrays ( )
protectedvirtual

method for allocating memory for pixel arrays m_IntensityArray, m_DistanceArray and m_AmplitudeArray

Reimplemented in mitk::ToFCameraPMDRawDataDevice.

Definition at line 125 of file mitkToFCameraDevice.cpp.

◆ CleanupPixelArrays()

void mitk::ToFCameraDevice::CleanupPixelArrays ( )
protectedvirtual

method for cleanup memory allocated for pixel arrays m_IntensityArray, m_DistanceArray and m_AmplitudeArray

Reimplemented in mitk::ToFCameraPMDRawDataDevice.

Definition at line 109 of file mitkToFCameraDevice.cpp.

◆ ConnectCamera()

bool mitk::ToFCameraDevice::ConnectCamera ( )
virtual

ConnectCamera Internally calls OnConnectCamera() of the respective device implementation.

Returns
True for success.

Reimplemented in mitk::ToFCameraPMDRawDataCamBoardDevice.

Definition at line 168 of file mitkToFCameraDevice.cpp.

◆ DisconnectCamera()

virtual bool mitk::ToFCameraDevice::DisconnectCamera ( )
pure virtual

◆ GetAllImages()

virtual void mitk::ToFCameraDevice::GetAllImages ( float * distanceArray,
float * amplitudeArray,
float * intensityArray,
char * sourceDataArray,
int requiredImageSequence,
int & capturedImageSequence,
unsigned char * rgbDataArray = nullptr )
pure virtual

gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images.

Parameters
distanceArraycontains the returned distance data as an array.
amplitudeArraycontains the returned amplitude data as an array.
intensityArraycontains the returned intensity data as an array.
sourceDataArraycontains the complete source data from the camera device.
requiredImageSequencethe required image sequence number
capturedImageSequencethe actually captured image sequence number
rgbDataArray

Implemented in mitk::KinectDevice, mitk::KinectV2Device, mitk::ToFCameraMESADevice, mitk::ToFCameraMITKPlayerDevice, mitk::ToFCameraPMDDevice, mitk::ToFCameraPMDRawDataCamBoardDevice, and mitk::ToFCameraPMDRawDataDevice.

◆ GetAmplitudes()

virtual void mitk::ToFCameraDevice::GetAmplitudes ( float * amplitudeArray,
int & imageSequence )
pure virtual

gets the amplitude data from the ToF camera as the strength of the active illumination of every pixel These values can be used to determine the quality of the distance values. The higher the amplitude value, the higher the accuracy of the according distance value

Parameters
imageSequencethe actually captured image sequence number
amplitudeArraycontains the returned amplitude data as an array.

Implemented in mitk::KinectDevice, mitk::KinectV2Device, mitk::ToFCameraMESADevice, mitk::ToFCameraMITKPlayerDevice, mitk::ToFCameraPMDDevice, mitk::ToFCameraPMDRawDataCamBoardDevice, and mitk::ToFCameraPMDRawDataDevice.

◆ GetBoolProperty()

bool mitk::ToFCameraDevice::GetBoolProperty ( const char * propertyKey,
bool & boolValue )

get a bool from the property list

Definition at line 72 of file mitkToFCameraDevice.cpp.

◆ GetDistances()

virtual void mitk::ToFCameraDevice::GetDistances ( float * distanceArray,
int & imageSequence )
pure virtual

gets the distance data from the ToF camera measuring the distance between the camera and the different object points in millimeters

Parameters
distanceArraycontains the returned distances data as an array.
imageSequencethe actually captured image sequence number

Implemented in mitk::KinectDevice, mitk::KinectV2Device, mitk::ToFCameraMESADevice, mitk::ToFCameraMITKPlayerDevice, mitk::ToFCameraPMDDevice, mitk::ToFCameraPMDRawDataCamBoardDevice, and mitk::ToFCameraPMDRawDataDevice.

◆ GetIntensities()

virtual void mitk::ToFCameraDevice::GetIntensities ( float * intensityArray,
int & imageSequence )
pure virtual

gets the intensity data from the ToF camera as a greyscale image

Parameters
intensityArraycontains the returned intensities data as an array.
imageSequencethe actually captured image sequence number

Implemented in mitk::KinectDevice, mitk::KinectV2Device, mitk::ToFCameraMESADevice, mitk::ToFCameraMITKPlayerDevice, mitk::ToFCameraPMDDevice, mitk::ToFCameraPMDRawDataCamBoardDevice, and mitk::ToFCameraPMDRawDataDevice.

◆ GetIntProperty()

bool mitk::ToFCameraDevice::GetIntProperty ( const char * propertyKey,
int & integer )

get an int from the property list

Definition at line 95 of file mitkToFCameraDevice.cpp.

◆ GetProperty()

BaseProperty * mitk::ToFCameraDevice::GetProperty ( const char * propertyKey)
virtual

get a BaseProperty from the property list

Definition at line 67 of file mitkToFCameraDevice.cpp.

◆ GetRGBCaptureHeight()

int mitk::ToFCameraDevice::GetRGBCaptureHeight ( )
virtual

Reimplemented in mitk::KinectDevice, and mitk::KinectV2Device.

Definition at line 143 of file mitkToFCameraDevice.cpp.

◆ GetRGBCaptureWidth()

int mitk::ToFCameraDevice::GetRGBCaptureWidth ( )
virtual

Reimplemented in mitk::KinectDevice, and mitk::KinectV2Device.

Definition at line 138 of file mitkToFCameraDevice.cpp.

◆ GetStringProperty()

bool mitk::ToFCameraDevice::GetStringProperty ( const char * propertyKey,
std::string & string )

get a string from the property list

Definition at line 82 of file mitkToFCameraDevice.cpp.

◆ IsCameraActive()

bool mitk::ToFCameraDevice::IsCameraActive ( )
virtual

returns true if the camera is connected and started

Reimplemented in mitk::KinectDevice, mitk::KinectV2Device, mitk::ToFCameraMESADevice, and mitk::ToFCameraPMDRawDataDevice.

Definition at line 160 of file mitkToFCameraDevice.cpp.

◆ IsCameraConnected()

bool mitk::ToFCameraDevice::IsCameraConnected ( )
virtual

returns true if the camera is connected

Definition at line 175 of file mitkToFCameraDevice.cpp.

◆ itkGetMacro() [1/5]

mitk::ToFCameraDevice::itkGetMacro ( BufferSize ,
int  )

get the currently set buffer size

Returns
buffer size

◆ itkGetMacro() [2/5]

mitk::ToFCameraDevice::itkGetMacro ( CaptureHeight ,
int  )

get the currently set capture height

Returns
capture height

◆ itkGetMacro() [3/5]

mitk::ToFCameraDevice::itkGetMacro ( CaptureWidth ,
int  )

get the currently set capture width

Returns
capture width

◆ itkGetMacro() [4/5]

mitk::ToFCameraDevice::itkGetMacro ( MaxBufferSize ,
int  )

get the currently set max buffer size

Returns
max buffer size

◆ itkGetMacro() [5/5]

mitk::ToFCameraDevice::itkGetMacro ( SourceDataSize ,
int  )

get the currently set source data size

Returns
source data size

◆ mitkClassMacroItkParent()

mitk::ToFCameraDevice::mitkClassMacroItkParent ( ToFCameraDevice ,
itk::Object  )

◆ OnConnectCamera()

virtual bool mitk::ToFCameraDevice::OnConnectCamera ( )
pure virtual

Opens a connection to the ToF camera. Has to be implemented in the specialized inherited classes.

Returns
True for success.

Implemented in mitk::KinectDevice, mitk::KinectV2Device, mitk::ToFCameraMESADevice, mitk::ToFCameraMITKPlayerDevice, mitk::ToFCameraPMDDevice, and mitk::ToFCameraPMDRawDataDevice.

◆ SetBoolProperty()

void mitk::ToFCameraDevice::SetBoolProperty ( const char * propertyKey,
bool boolValue )

set a bool property in the property list

Definition at line 42 of file mitkToFCameraDevice.cpp.

◆ SetFloatProperty()

void mitk::ToFCameraDevice::SetFloatProperty ( const char * propertyKey,
float floatValue )

set a float property in the property list

Definition at line 52 of file mitkToFCameraDevice.cpp.

◆ SetIntProperty()

void mitk::ToFCameraDevice::SetIntProperty ( const char * propertyKey,
int intValue )

set an int property in the property list

Definition at line 47 of file mitkToFCameraDevice.cpp.

◆ SetProperty()

void mitk::ToFCameraDevice::SetProperty ( const char * propertyKey,
BaseProperty * propertyValue )
virtual

◆ SetStringProperty()

void mitk::ToFCameraDevice::SetStringProperty ( const char * propertyKey,
const char * stringValue )

set a string property in the property list

Definition at line 57 of file mitkToFCameraDevice.cpp.

◆ StartCamera()

virtual void mitk::ToFCameraDevice::StartCamera ( )
pure virtual

starts the continuous updating of the camera. A separate thread updates the source data, the main thread processes the source data and creates images and coordinates

Implemented in mitk::KinectDevice, mitk::KinectV2Device, mitk::ToFCameraMESADevice, mitk::ToFCameraMITKPlayerDevice, mitk::ToFCameraPMDDevice, and mitk::ToFCameraPMDRawDataDevice.

◆ StopCamera()

void mitk::ToFCameraDevice::StopCamera ( )
virtual

stops the continuous updating of the camera

Reimplemented in mitk::KinectDevice, mitk::KinectV2Device, mitk::ToFCameraMESADevice, and mitk::ToFCameraPMDRawDataDevice.

Definition at line 148 of file mitkToFCameraDevice.cpp.

◆ UpdateCamera()

virtual void mitk::ToFCameraDevice::UpdateCamera ( )
pure virtual

Member Data Documentation

◆ m_AmplitudeArray

float* mitk::ToFCameraDevice::m_AmplitudeArray
protected

float array holding the amplitude image

Definition at line 203 of file mitkToFCameraDevice.h.

◆ m_BufferSize

int mitk::ToFCameraDevice::m_BufferSize
protected

buffer size of the image buffer needed for loss-less acquisition of range data

Definition at line 204 of file mitkToFCameraDevice.h.

◆ m_CameraActive

bool mitk::ToFCameraDevice::m_CameraActive
protected

flag indicating if the camera is currently active or not. Caution: thread safe access only!

Definition at line 218 of file mitkToFCameraDevice.h.

◆ m_CameraActiveMutex

std::mutex mitk::ToFCameraDevice::m_CameraActiveMutex
protected

mutex for the cameraActive flag

Definition at line 216 of file mitkToFCameraDevice.h.

◆ m_CameraConnected

bool mitk::ToFCameraDevice::m_CameraConnected
protected

flag indicating if the camera is successfully connected or not. Caution: thread safe access only!

Definition at line 219 of file mitkToFCameraDevice.h.

◆ m_CaptureHeight

int mitk::ToFCameraDevice::m_CaptureHeight
protected

height of the range image (y dimension)

Definition at line 209 of file mitkToFCameraDevice.h.

◆ m_CaptureWidth

int mitk::ToFCameraDevice::m_CaptureWidth
protected

width of the range image (x dimension)

Definition at line 208 of file mitkToFCameraDevice.h.

◆ m_CurrentPos

int mitk::ToFCameraDevice::m_CurrentPos
protected

current position in the buffer which will be retrieved by the Get methods

Definition at line 206 of file mitkToFCameraDevice.h.

◆ m_DistanceArray

float* mitk::ToFCameraDevice::m_DistanceArray
protected

float array holding the distance image

Definition at line 202 of file mitkToFCameraDevice.h.

◆ m_FreePos

int mitk::ToFCameraDevice::m_FreePos
protected

current position in the buffer which will be filled with data acquired from the hardware

Definition at line 207 of file mitkToFCameraDevice.h.

◆ m_ImageMutex

std::mutex mitk::ToFCameraDevice::m_ImageMutex
protected

mutex for images provided by the range camera

Definition at line 215 of file mitkToFCameraDevice.h.

◆ m_ImageSequence

int mitk::ToFCameraDevice::m_ImageSequence
protected

counter for acquired images

Definition at line 220 of file mitkToFCameraDevice.h.

◆ m_IntensityArray

float* mitk::ToFCameraDevice::m_IntensityArray
protected

float array holding the intensity image

Definition at line 201 of file mitkToFCameraDevice.h.

◆ m_MaxBufferSize

int mitk::ToFCameraDevice::m_MaxBufferSize
protected

maximal buffer size needed for initialization of data arrays. Default value is 100.

Definition at line 205 of file mitkToFCameraDevice.h.

◆ m_PixelNumber

int mitk::ToFCameraDevice::m_PixelNumber
protected

number of pixels in the range image (m_CaptureWidth*m_CaptureHeight)

Definition at line 210 of file mitkToFCameraDevice.h.

◆ m_PropertyList

PropertyList::Pointer mitk::ToFCameraDevice::m_PropertyList
protected

a list of the corresponding properties

Definition at line 222 of file mitkToFCameraDevice.h.

◆ m_RGBImageHeight

int mitk::ToFCameraDevice::m_RGBImageHeight
protected

height of the RGB image (y dimension)

Definition at line 212 of file mitkToFCameraDevice.h.

◆ m_RGBImageWidth

int mitk::ToFCameraDevice::m_RGBImageWidth
protected

width of the RGB image (x dimension)

Definition at line 211 of file mitkToFCameraDevice.h.

◆ m_RGBPixelNumber

int mitk::ToFCameraDevice::m_RGBPixelNumber
protected

number of pixels in the range image (m_RGBImageWidth*m_RGBImageHeight)

Definition at line 213 of file mitkToFCameraDevice.h.

◆ m_SourceDataSize

int mitk::ToFCameraDevice::m_SourceDataSize
protected

size of the PMD source data

Definition at line 214 of file mitkToFCameraDevice.h.

◆ m_Thread

std::thread mitk::ToFCameraDevice::m_Thread
protected

Definition at line 217 of file mitkToFCameraDevice.h.


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