14 #include <libMesaSR.h> 22 this->m_Lambda =
new float[MF_LAST];
23 this->m_Frequency =
new float[MF_LAST];
24 this->m_Lambda[0] = 3.75f;
25 this->m_Lambda[1] = 5.0f;
26 this->m_Lambda[2] = 7.142857f;
27 this->m_Lambda[3] = 7.5f;
28 this->m_Lambda[4] = 7.894737f;
29 this->m_Lambda[5] = 2.5f;
30 this->m_Lambda[6] = 10.0f;
31 this->m_Lambda[7] = 15.0f;
32 this->m_Lambda[8] = 5.172414f;
33 this->m_Lambda[9] = 4.838710f;
34 this->m_Lambda[10] = 10.344828f;
35 this->m_Lambda[11] = 9.677419f;
36 this->m_Frequency[0] = 40.0f;
37 this->m_Frequency[1] = 30.0f;
38 this->m_Frequency[2] = 21.0f;
39 this->m_Frequency[3] = 20.0f;
40 this->m_Frequency[4] = 19.0f;
41 this->m_Frequency[5] = 60.0f;
42 this->m_Frequency[6] = 15.0f;
43 this->m_Frequency[7] = 10.0f;
44 this->m_Frequency[8] = 29.0f;
45 this->m_Frequency[9] = 31.0f;
46 this->m_Frequency[10] = 14.5f;
47 this->m_Frequency[11] = 15.5f;
103 ImgEntry* imgEntryArray;
108 ModulationFrq frq = SR_GetModulationFrequency(
m_MESAHandle);
112 unsigned char integrationTime8bit = SR_GetIntegrationTime(
m_MESAHandle);
113 float integrationTime = (0.3 + ((int)integrationTime8bit) * 0.1) * 1000;
115 char deviceText[1024];
117 MITK_INFO <<
"Device ID: " << deviceText <<std::endl;
120 MITK_INFO <<
"Modulationfrequency: " << this->m_Frequency[frq] <<
" MHz" <<std::endl;
121 MITK_INFO <<
"Max range: " << this->m_Lambda[frq] <<
" m" <<std::endl;
122 MITK_INFO <<
"Integration time: " << integrationTime <<
" microsec" <<std::endl;
130 float intTime = ((integrationTime / 1000.0) - 0.3) / 0.1;
132 MITK_INFO <<
"New integration time: " << integrationTime <<
" microsec" <<std::endl;
133 return integrationTime;
138 unsigned char integrationTime8bit = SR_GetIntegrationTime(
m_MESAHandle);
139 float integrationTime = (0.3 + ((int)integrationTime8bit) * 0.1) * 1000;
140 return (
int)integrationTime;
146 switch(modulationFrequency)
148 case 29: frq = MF_29MHz;
break;
149 case 30: frq = MF_30MHz;
break;
150 case 31: frq = MF_31MHz;
break;
151 default: frq = MF_30MHz;
152 MITK_WARN <<
"Invalid modulation frequency: " << modulationFrequency <<
" MHz, reset to default (30MHz)" <<std::endl;
158 MITK_INFO <<
"New modulation frequency: " << this->m_Frequency[frq] <<
" MHz" <<std::endl;
159 return modulationFrequency;
169 ModulationFrq frq = SR_GetModulationFrequency(
m_MESAHandle);
171 float frequency = this->m_Frequency[frq];
172 return (
int)frequency;
179 acquireMode &= ~AM_COR_FIX_PTRN;
182 acquireMode |= AM_COR_FIX_PTRN;
191 acquireMode &= ~AM_CONV_GRAY;
194 acquireMode |= AM_CONV_GRAY;
203 acquireMode &= ~AM_MEDIAN;
206 acquireMode |= AM_MEDIAN;
215 acquireMode &= ~AM_DENOISE_ANF;
218 acquireMode |= AM_DENOISE_ANF;
~ToFCameraMESASR4000Controller()
float m_MaxRangeFactor
holds the factor to calculate the real distance depends on the modulation frequency ...
virtual bool OpenCameraConnection()
opens a connection to the ToF camera and initializes the hardware specific members ...
bool ErrorText(int error)
Method printing the current error message to the console and returning whether the previous command w...
virtual int SetIntegrationTime(unsigned int integrationTime)
Sets the integration time of the ToF device. The method automatically calculates a valid value from t...
virtual void SetANF(bool anf)
Sets the acquire mode of the MESA SR4000 camera. The method sets some parameter supported by the MESA...
int m_MESARes
holds the current result message provided by MESA
DataCollection - Class to facilitate loading/accessing structured data.
CMesaDevice * m_MESAHandle
virtual int SetModulationFrequency(unsigned int modulationFrequency)
Sets the modulation frequency of the ToF device. The method automatically calculates a valid value fr...
int m_NumImg
holds the number of images the camera provided (distance, intensity, etc)
int m_NumberOfBytes
holds the number of bytes contained in the image
virtual void SetMedian(bool median)
Sets the acquire mode of the MESA SR4000 camera. The method sets some parameter supported by the MESA...
virtual int GetModulationFrequency()
Returns the currently set modulation frequency.
ToFCameraMESASR4000Controller()
virtual void SetConvGray(bool convGray)
Sets the acquire mode of the MESA SR4000 camera. The method sets some parameter supported by the MESA...
unsigned int m_CaptureHeight
holds the height of the image in pixel
bool m_ConnectionCheck
flag showing whether the camera is connected (true) or not (false)
unsigned int m_CaptureWidth
holds the width of the image in pixel
virtual void SetFPN(bool fpn)
Sets the acquire mode of the MESA SR4000 camera. The method sets some parameter supported by the MESA...
virtual int GetIntegrationTime()
Returns the currently set integration time.
int m_PixelNumber
holds the number of pixels contained in the image