18 #include <libMesaSR.h>
26 this->m_Lambda =
new float[MF_LAST];
27 this->m_Frequency =
new float[MF_LAST];
28 this->m_Lambda[0] = 3.75f;
29 this->m_Lambda[1] = 5.0f;
30 this->m_Lambda[2] = 7.142857f;
31 this->m_Lambda[3] = 7.5f;
32 this->m_Lambda[4] = 7.894737f;
33 this->m_Lambda[5] = 2.5f;
34 this->m_Lambda[6] = 10.0f;
35 this->m_Lambda[7] = 15.0f;
36 this->m_Lambda[8] = 5.172414f;
37 this->m_Lambda[9] = 4.838710f;
38 this->m_Lambda[10] = 10.344828f;
39 this->m_Lambda[11] = 9.677419f;
40 this->m_Frequency[0] = 40.0f;
41 this->m_Frequency[1] = 30.0f;
42 this->m_Frequency[2] = 21.0f;
43 this->m_Frequency[3] = 20.0f;
44 this->m_Frequency[4] = 19.0f;
45 this->m_Frequency[5] = 60.0f;
46 this->m_Frequency[6] = 15.0f;
47 this->m_Frequency[7] = 10.0f;
48 this->m_Frequency[8] = 29.0f;
49 this->m_Frequency[9] = 31.0f;
50 this->m_Frequency[10] = 14.5f;
51 this->m_Frequency[11] = 15.5f;
107 ImgEntry* imgEntryArray;
112 ModulationFrq frq = SR_GetModulationFrequency(
m_MESAHandle);
116 unsigned char integrationTime8bit = SR_GetIntegrationTime(
m_MESAHandle);
117 float integrationTime = (0.3 + ((int)integrationTime8bit) * 0.1) * 1000;
119 char deviceText[1024];
121 MITK_INFO <<
"Device ID: " << deviceText <<std::endl;
124 MITK_INFO <<
"Modulationfrequency: " << this->m_Frequency[frq] <<
" MHz" <<std::endl;
125 MITK_INFO <<
"Max range: " << this->m_Lambda[frq] <<
" m" <<std::endl;
126 MITK_INFO <<
"Integration time: " << integrationTime <<
" microsec" <<std::endl;
134 float intTime = ((integrationTime / 1000.0) - 0.3) / 0.1;
136 MITK_INFO <<
"New integration time: " << integrationTime <<
" microsec" <<std::endl;
137 return integrationTime;
142 unsigned char integrationTime8bit = SR_GetIntegrationTime(
m_MESAHandle);
143 float integrationTime = (0.3 + ((int)integrationTime8bit) * 0.1) * 1000;
144 return (
int)integrationTime;
150 switch(modulationFrequency)
152 case 29: frq = MF_29MHz;
break;
153 case 30: frq = MF_30MHz;
break;
154 case 31: frq = MF_31MHz;
break;
155 default: frq = MF_30MHz;
156 MITK_WARN <<
"Invalid modulation frequency: " << modulationFrequency <<
" MHz, reset to default (30MHz)" <<std::endl;
162 MITK_INFO <<
"New modulation frequency: " << this->m_Frequency[frq] <<
" MHz" <<std::endl;
163 return modulationFrequency;
173 ModulationFrq frq = SR_GetModulationFrequency(
m_MESAHandle);
175 float frequency = this->m_Frequency[frq];
176 return (
int)frequency;
183 acquireMode &= ~AM_COR_FIX_PTRN;
186 acquireMode |= AM_COR_FIX_PTRN;
195 acquireMode &= ~AM_CONV_GRAY;
198 acquireMode |= AM_CONV_GRAY;
207 acquireMode &= ~AM_MEDIAN;
210 acquireMode |= AM_MEDIAN;
219 acquireMode &= ~AM_DENOISE_ANF;
222 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