15 #include <itkMultiThreader.h> 16 #include <itksys/SystemTools.hxx> 52 for(
int i=0; i<this->
m_PixelNumber; i++) {this->m_DistanceArray[i]=0.0;}
116 this->m_FreePos = (this->m_FreePos+1) % this->
m_BufferSize;
126 itksys::SystemTools::Delay(10);
139 itksys::SystemTools::Delay(100);
145 itksys::SystemTools::Delay(10);
167 struct itk::MultiThreader::ThreadInfoStruct * pInfo = (
struct itk::MultiThreader::ThreadInfoStruct*)pInfoStruct;
168 if (pInfo ==
nullptr)
170 return ITK_THREAD_RETURN_VALUE;
172 if (pInfo->UserData ==
nullptr)
174 return ITK_THREAD_RETURN_VALUE;
177 if (toFCameraDevice!=
nullptr)
179 mitk::RealTimeClock::Pointer realTimeClock;
182 t1 = realTimeClock->GetCurrentStamp();
184 bool overflow =
false;
185 bool printStatus =
false;
196 toFCameraDevice->Modified();
216 t2 = realTimeClock->GetCurrentStamp() - t1;
218 t1 = realTimeClock->GetCurrentStamp();
223 return ITK_THREAD_RETURN_VALUE;
236 MITK_WARN(
"ToF") <<
"Warning: Data can only be acquired if camera is active.";
254 MITK_WARN(
"ToF") <<
"Warning: Data can only be acquired if camera is active.";
260 int requiredImageSequence,
int& capturedImageSequence,
unsigned char* rgbDataArray)
275 if ((requiredImageSequence < 0) || (requiredImageSequence > this->
m_ImageSequence))
287 capturedImageSequence = requiredImageSequence;
303 MITK_WARN(
"ToF") <<
"Warning: Data can only be acquired if camera is active.";
316 if (strcmp(propertyKey,
"RGB") == 0)
322 else if (strcmp(propertyKey,
"IR") == 0)
virtual int GetCaptureHeight()
get the currently set capture height
static ITK_THREAD_RETURN_TYPE Acquire(void *pInfoStruct)
Thread method continuously acquiring images from the ToF hardware.
float ** m_DistanceDataBuffer
buffer holding the last distance images
virtual void UpdateCamera()
updates the camera for image acquisition
float ** m_AmplitudeDataBuffer
buffer holding the last infra-red (IR) images
bool GetBoolProperty(const char *propertyKey, bool &boolValue)
get a bool from the property list
int m_RGBPixelNumber
number of pixels in the range image (m_RGBImageWidth*m_RGBImageHeight)
int m_PixelNumber
number of pixels in the range image (m_CaptureWidth*m_CaptureHeight)
virtual void GetDistances(float *distanceArray, int &imageSequence)
gets the distance data from the ToF camera measuring the distance between the camera and the differen...
DataCollection - Class to facilitate loading/accessing structured data.
PropertyList::Pointer m_PropertyList
a list of the corresponding properties
int GetRGBCaptureHeight()
returns the height of the RGB image
float * m_DistanceArray
float array holding the distance image
int m_ThreadID
ID of the started thread.
virtual bool OnConnectCamera()
opens a connection to the ToF camera
Interface for all representations of Kinect devices. KinectDevice internally holds an instance of Kin...
itk::FastMutexLock::Pointer m_CameraActiveMutex
mutex for the cameraActive flag
itk::MultiThreader::Pointer m_MultiThreader
itk::MultiThreader used for thread handling
int m_FreePos
current position in the buffer which will be filled with data acquired from the hardware ...
Abstract base class for properties.
virtual bool IsCameraActive()
returns whether the camera is currently active or not
virtual void SetProperty(const char *propertyKey, BaseProperty *propertyValue)
set a BaseProperty property in the property list
int m_RGBImageHeight
height of the RGB image (y dimension)
bool m_CameraActive
flag indicating if the camera is currently active or not. Caution: thread safe access only! ...
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...
int m_CurrentPos
current position in the buffer which will be retrieved by the Get methods
bool m_CameraConnected
flag indicating if the camera is successfully connected or not. Caution: thread safe access only! ...
KinectController::Pointer m_Controller
corresponding CameraController
int m_CaptureWidth
width of the range image (x dimension)
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 responsi...
itk::FastMutexLock::Pointer m_ImageMutex
mutex for images provided by the range camera
virtual void GetIntensities(float *intensityArray, int &imageSequence)
gets the intensity data from the ToF camera as a greyscale image. Caution! The user is responsible fo...
int m_BufferSize
buffer size of the image buffer needed for loss-less acquisition of range data
KinectController::Pointer GetController()
returns the corresponding camera controller
virtual bool DisconnectCamera()
closes the connection to the camera
unsigned char ** m_RGBDataBuffer
buffer holding the last RGB image
int m_MaxBufferSize
maximal buffer size needed for initialization of data arrays. Default value is 100.
int m_CaptureHeight
height of the range image (y dimension)
virtual void StopCamera()
stops the continuous updating of the camera
virtual void StartCamera()
starts the continuous updating of the camera. A separate thread updates the source data...
float * m_AmplitudeArray
float array holding the amplitude image
virtual void SetProperty(const char *propertyKey, BaseProperty *propertyValue)
set a BaseProperty
static Pointer New(void)
instanciates a new, operating-system dependant, instance of mitk::RealTimeClock.
void SetBoolProperty(const char *propertyKey, bool boolValue)
set a bool property in the property list
int m_RGBImageWidth
width of the RGB image (x dimension)
int GetRGBCaptureWidth()
returns the width of the RGB image
virtual int GetCaptureWidth()
get the currently set capture width
int m_ImageSequence
counter for acquired images