MITK-IGT
IGT Extension of MITK
|
Interface for all representations of Kinect devices. KinectDevice internally holds an instance of KinectController and starts a thread that continuously grabs images from the controller. A buffer structure buffers the last acquired images to provide the image data loss-less. More...
#include <mitkKinectDevice.h>
Public Member Functions | |
mitkClassMacro (KinectDevice, ToFCameraDevice) | |
itkFactorylessNewMacro (Self) | |
itkCloneMacro (Self) | |
virtual bool | OnConnectCamera () |
opens a connection to the ToF camera | |
virtual bool | DisconnectCamera () |
closes the connection to the camera | |
virtual void | StartCamera () |
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 void | UpdateCamera () |
updates the camera for image acquisition | |
virtual bool | IsCameraActive () |
returns whether the camera is currently active or not | |
virtual void | GetAmplitudes (float *amplitudeArray, int &imageSequence) |
gets the amplitude data from the ToF camera as the strength of the active illumination of every pixel. Caution! The user is responsible for allocating and deleting the images. 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) |
gets the intensity data from the ToF camera as a greyscale image. Caution! The user is responsible for allocating and deleting the images. | |
virtual void | GetDistances (float *distanceArray, int &imageSequence) |
gets the distance data from the ToF camera measuring the distance between the camera and the different object points in millimeters. Caution! The user is responsible for allocating and deleting the images. | |
virtual void | GetAllImages (float *distanceArray, float *amplitudeArray, float *intensityArray, char *sourceDataArray, int requiredImageSequence, int &capturedImageSequence, unsigned char *rgbDataArray=nullptr) |
gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images. | |
KinectController::Pointer | GetController () |
returns the corresponding camera controller | |
virtual void | SetProperty (const char *propertyKey, BaseProperty *propertyValue) |
set a BaseProperty | |
int | GetRGBCaptureWidth () |
returns the width of the RGB image | |
int | GetRGBCaptureHeight () |
returns the height of the RGB image | |
![]() | |
mitkClassMacroItkParent (ToFCameraDevice, itk::Object) | |
virtual bool | ConnectCamera () |
ConnectCamera Internally calls OnConnectCamera() of the respective device implementation. | |
virtual bool | IsCameraConnected () |
returns true if the camera is connected | |
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 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 | |
Protected Member Functions | |
KinectDevice () | |
~KinectDevice () | |
void | GetNextPos () |
moves the position pointer m_CurrentPos to the next position in the buffer if that's not the next free position to prevent reading from an empty buffer | |
![]() | |
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 | |
Static Protected Member Functions | |
static ITK_THREAD_RETURN_TYPE | Acquire (void *pInfoStruct) |
Thread method continuously acquiring images from the ToF hardware. | |
Protected Attributes | |
KinectController::Pointer | m_Controller |
corresponding CameraController | |
float ** | m_DistanceDataBuffer |
buffer holding the last distance images | |
float ** | m_AmplitudeDataBuffer |
buffer holding the last infra-red (IR) images | |
unsigned char ** | m_RGBDataBuffer |
buffer holding the last RGB image | |
![]() | |
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 | |
Interface for all representations of Kinect devices. KinectDevice internally holds an instance of KinectController and starts a thread that continuously grabs images from the controller. A buffer structure buffers the last acquired images to provide the image data loss-less.
mitkException | In case of no connection, an exception is thrown! |
Definition at line 38 of file mitkKinectDevice.h.
|
protected |
Definition at line 22 of file mitkKinectDevice.cpp.
|
protected |
Definition at line 27 of file mitkKinectDevice.cpp.
|
staticprotected |
Thread method continuously acquiring images from the ToF hardware.
Definition at line 164 of file mitkKinectDevice.cpp.
|
virtual |
closes the connection to the camera
Implements mitk::ToFCameraDevice.
Definition at line 78 of file mitkKinectDevice.cpp.
|
virtual |
gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images.
distanceArray | contains the returned distance data as an array. |
amplitudeArray | contains the returned amplitude data as an array. |
intensityArray | |
sourceDataArray | |
requiredImageSequence | |
capturedImageSequence | the actually captured image sequence number. |
rgbDataArray |
Implements mitk::ToFCameraDevice.
Definition at line 259 of file mitkKinectDevice.cpp.
|
virtual |
gets the amplitude data from the ToF camera as the strength of the active illumination of every pixel. Caution! The user is responsible for allocating and deleting the images. 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
imageSequence | the actually captured image sequence number |
amplitudeArray | contains the returned amplitude data as an array. |
Implements mitk::ToFCameraDevice.
Definition at line 226 of file mitkKinectDevice.cpp.
KinectController::Pointer mitk::KinectDevice::GetController | ( | ) |
returns the corresponding camera controller
Definition at line 307 of file mitkKinectDevice.cpp.
|
virtual |
gets the distance data from the ToF camera measuring the distance between the camera and the different object points in millimeters. Caution! The user is responsible for allocating and deleting the images.
distanceArray | contains the returned distances data as an array. |
imageSequence | the actually captured image sequence number |
Implements mitk::ToFCameraDevice.
Definition at line 245 of file mitkKinectDevice.cpp.
|
virtual |
gets the intensity data from the ToF camera as a greyscale image. Caution! The user is responsible for allocating and deleting the images.
intensityArray | contains the returned intensities data as an array. |
imageSequence | the actually captured image sequence number |
Implements mitk::ToFCameraDevice.
Definition at line 241 of file mitkKinectDevice.cpp.
|
protected |
moves the position pointer m_CurrentPos to the next position in the buffer if that's not the next free position to prevent reading from an empty buffer
|
virtual |
returns the height of the RGB image
Reimplemented from mitk::ToFCameraDevice.
Definition at line 335 of file mitkKinectDevice.cpp.
|
virtual |
returns the width of the RGB image
Reimplemented from mitk::ToFCameraDevice.
Definition at line 330 of file mitkKinectDevice.cpp.
|
virtual |
returns whether the camera is currently active or not
Reimplemented from mitk::ToFCameraDevice.
Definition at line 148 of file mitkKinectDevice.cpp.
mitk::KinectDevice::itkCloneMacro | ( | Self | ) |
mitk::KinectDevice::itkFactorylessNewMacro | ( | Self | ) |
mitk::KinectDevice::mitkClassMacro | ( | KinectDevice | , |
ToFCameraDevice | ) |
|
virtual |
opens a connection to the ToF camera
mitkException | In case of no connection, an exception is thrown! |
Implements mitk::ToFCameraDevice.
Definition at line 31 of file mitkKinectDevice.cpp.
|
virtual |
set a BaseProperty
Reimplemented from mitk::ToFCameraDevice.
Definition at line 312 of file mitkKinectDevice.cpp.
|
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
mitkException | In case of no connection, an exception is thrown! |
Implements mitk::ToFCameraDevice.
Definition at line 108 of file mitkKinectDevice.cpp.
|
virtual |
stops the continuous updating of the camera
Reimplemented from mitk::ToFCameraDevice.
Definition at line 134 of file mitkKinectDevice.cpp.
|
virtual |
updates the camera for image acquisition
mitkException | In case of no connection, an exception is thrown! |
Implements mitk::ToFCameraDevice.
Definition at line 156 of file mitkKinectDevice.cpp.
|
protected |
buffer holding the last infra-red (IR) images
Definition at line 142 of file mitkKinectDevice.h.
|
protected |
corresponding CameraController
Definition at line 139 of file mitkKinectDevice.h.
|
protected |
buffer holding the last distance images
Definition at line 141 of file mitkKinectDevice.h.
|
protected |
buffer holding the last RGB image
Definition at line 143 of file mitkKinectDevice.h.