25 #ifndef __BIASVIDEOSOURCE_SWISSRANGER_HH__
26 #define __BIASVIDEOSOURCE_SWISSRANGER_HH__
28 #include <VideoSource/VideoSource_Base.hh>
29 #include <Image/Camera.hh>
30 #include <bias_config.h>
32 #include <Base/Common/W32Compat.hh>
35 typedef unsigned long DWORD;
37 #include <libMesaSR.h>
54 virtual int OpenDevice();
58 virtual int OpenDevice(
int camNr);
60 virtual int CloseDevice();
63 virtual int PreGrab();
65 virtual int PostGrab();
78 virtual int InitDepthImage(
ImageBase &img);
84 virtual int SetIntegrationTime(
const unsigned char inttime);
88 val = integrationTime_;
93 virtual int SetIntegrationTimeMS(
float inttime);
96 virtual int GetIntegrationTimeMS(
float &inttime);
111 int SetModulationFrequency(ModulationFrq dModulationFrequency);
115 val = modulationFrequency_;
121 amplitudeThreshold_ = val;
122 return SR_SetAmplitudeThreshold(srCam_, amplitudeThreshold_);
127 val = amplitudeThreshold_;
133 saturationThreshold_ = val;
134 return SR_SetAmplitudeThreshold(srCam_, saturationThreshold_);
139 val = saturationThreshold_;
145 distanceOffset_ = val;
146 return SR_SetDistanceOffset(srCam_, distanceOffset_);
151 val = distanceOffset_;
158 if (!DepthImgF_.IsEmpty()) {
168 if (!ModCoeffImg_.IsEmpty()) {
169 image = ModCoeffImg_;
176 BIASWARNONCE(
"Always generating new UUIDS for Swissranger images.");
182 return SetAutoIllumination(5, 255, 10, 45);
184 return SetAutoIllumination(0xff, 0, 0, 0);
189 const unsigned char maxIntTime,
190 const unsigned char percentOverPos,
191 const unsigned char desiredPos) {
192 return SR_SetAutoExposure(srCam_, minIntTime, maxIntTime,
193 percentOverPos, desiredPos);
205 bEnsureLatestFrame_ = ensure;
209 bGrabImageReturnsDepth_ = on;
213 int GetSoftwareVersion(std::string& version);
216 int GetDeviceString(std::string& device);
221 void ConvertRawImageToFloat_(
const unsigned short* data,
Image<float> &dst);
222 void ConvertRawImage_(
const unsigned short* data,
Image<float> &dst);
227 void ResetUsbDeviceConnection_();
261 #endif //__VIDEOSOURCE_SWISSRANGER_HH__
int SetDistanceOffset(const unsigned short val)
Distance Offset
Defines a common interface to different devices.
virtual int GetIntegrationTime(unsigned char &val)
Get IntegrationTime (as uchar 0-255)
int GetModulationFrequency(unsigned int &val)
Get the Modulation frequency.
unsigned short amplitudeThreshold_
int SetSaturationThreshold(const unsigned short val)
Set Saturation Threshold.
BIAS::Camera< float > ModCoeffImg_
bool bGrabImageReturnsDepth_
const unsigned short * dataAmp_
Support for SwissRanger usb cam.
unsigned int serialNumber_
const unsigned short * dataDepth_
int SetAutoIllumination(const unsigned char minIntTime, const unsigned char maxIntTime, const unsigned char percentOverPos, const unsigned char desiredPos)
Sets the autoillumination settings.
int GetDistanceOffset(unsigned short &val)
Get Distance Offset.
int GrabSingleModCoeff(Camera< float > &image)
Returns the amplitude image.
int GetSaturationThreshold(unsigned short &val)
Get Saturation Threshold.
ModulationFrq modulationFrequency_
BIAS::Camera< float > DepthImgF_
BIAS::Camera< unsigned char > DepthImg_
void GrabImageReturnsDepth(bool on)
Sets whether a call to GrabSingle should return the depth image.
unsigned short distanceOffset_
int SetAmplitudeThreshold(const unsigned short val)
Set Amplitude Threshold.
void EnsureLatestFrame(const bool ensure)
Sets the scattering filter.
int GetAmplitudeThreshold(unsigned short &val)
Get Amplitude Threshold.
unsigned char integrationTime_
int GrabSingleDepth(Camera< float > &image)
Returns the depth image.
Checks for VideoSource capabilities.
unsigned short saturationThreshold_
This is the base class for images in BIAS.
int SetAutoIllumination(const bool on)
Sets the autoillumination default settings on or off.
void SetGenerateNewUIDs(bool s)
Sets whether to generate new UIDS for each image.