ipa_CameraSensors::Swissranger Class Reference

#include <Swissranger.h>

Inheritance diagram for ipa_CameraSensors::Swissranger:
Inheritance graph
[legend]

List of all members.

Public Member Functions

unsigned long AcquireImages (cv::Mat *rangeImage=0, cv::Mat *grayImage=0, cv::Mat *cartesianImage=0, bool getLatestFrame=true, bool undistort=true, ipa_CameraSensors::t_ToFGrayImageType grayImageType=ipa_CameraSensors::INTENSITY_32F1)
unsigned long AcquireImages (int widthStepRange, int widthStepGray, int widthStepCartesian, char *RangeImage=NULL, char *IntensityImage=NULL, char *cartesianImage=NULL, bool getLatestFrame=true, bool undistort=true, ipa_CameraSensors::t_ToFGrayImageType grayImageType=ipa_CameraSensors::INTENSITY_32F1)
unsigned long Close ()
unsigned long GetProperty (t_cameraProperty *cameraProperty)
unsigned long Init (std::string directory, int cameraIndex=0)
bool isInitialized ()
bool isOpen ()
unsigned long Open ()
unsigned long SaveParameters (const char *filename)
unsigned long SetProperty (t_cameraProperty *cameraProperty)
unsigned long SetPropertyDefaults ()
 Swissranger ()
 ~Swissranger ()

Private Member Functions

unsigned long GetCalibratedXYMatlab (int u, int v, float z, float &x, float &y)
unsigned long GetCalibratedXYSwissranger (int u, int v, int width, float &x, float &y)
unsigned long GetCalibratedZMatlab (int u, int v, float zRaw, float &zCalibrated)
unsigned long GetCalibratedZSwissranger (int u, int v, int width, float &zCalibrated)
unsigned long LoadParameters (const char *filename, int cameraIndex)
unsigned long SetParameters ()

Private Attributes

cv::Mat m_CoeffsA0
 a0 z-calibration parameters. One matrix entry corresponds to one pixel
cv::Mat m_CoeffsA1
 a1 z-calibration parameters. One matrix entry corresponds to one pixel
cv::Mat m_CoeffsA2
 a2 z-calibration parameters. One matrix entry corresponds to one pixel
cv::Mat m_CoeffsA3
 a3 z-calibration parameters. One matrix entry corresponds to one pixel
cv::Mat m_CoeffsA4
 a4 z-calibration parameters. One matrix entry corresponds to one pixel
cv::Mat m_CoeffsA5
 a5 z-calibration parameters. One matrix entry corresponds to one pixel
cv::Mat m_CoeffsA6
 a6 z-calibration parameters. One matrix entry corresponds to one pixel
bool m_CoeffsInitialized
 True, when m_CoeffsAx have been initialized.
ImgEntry * m_DataBuffer
 Image array.
bool m_GrayImageAcquireCalled
 Is false, when acquiring gray image has not been called, yet.
int m_NumOfImages
 Number of images the siwssranger returns (i.e. an intensity and a range image).
SRCAM m_SRCam
 Handle to USB SR3000 camera.
float m_X [SWISSRANGER_COLUMNS *SWISSRANGER_ROWS]
float m_Y [SWISSRANGER_COLUMNS *SWISSRANGER_ROWS]
float m_Z [SWISSRANGER_COLUMNS *SWISSRANGER_ROWS]

Detailed Description

Interface class to SwissRanger camera SR-3000. Platform independent interface to SwissRanger camera SR-3000. Implementation depends on libusbSR library.

Definition at line 119 of file Swissranger.h.


Constructor & Destructor Documentation

Swissranger::Swissranger (  ) 

Definition at line 67 of file Swissranger.cpp.

Swissranger::~Swissranger (  ) 

Definition at line 80 of file Swissranger.cpp.


Member Function Documentation

unsigned long Swissranger::AcquireImages ( cv::Mat *  rangeImage = 0,
cv::Mat *  intensityImage = 0,
cv::Mat *  cartesianImage = 0,
bool  getLatestFrame = true,
bool  undistort = true,
ipa_CameraSensors::t_ToFGrayImageType  grayImageType = ipa_CameraSensors::INTENSITY_32F1 
) [virtual]

Acquires an image from SwissRanger camera. Data is read from the camera and put into a corresponding OpenCV cv::Mat data type. The cv::Mat are allocated on demand.

Parameters:
rangeImage OpenCV conform image with depth information.
grayImage OpenCV conform image with grayscale information.
cartesianImage OpenCV conform image with cartesian (x,y,z) information in meters.
getLatestFrame Set true to acquire a new image on calling instead of returning the one acquired last time
useCalibratedZ Calibrate z values
grayImageType Either gray image data is filled with amplitude image or intensity image
Exceptions:
IPA_Exception Throws an exception, if camera access failed

Implements ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 656 of file Swissranger.cpp.

unsigned long Swissranger::AcquireImages ( int  widthStepRange,
int  widthStepGray,
int  widthStepCartesian,
char *  rangeImage = NULL,
char *  grayImage = NULL,
char *  cartesianImage = NULL,
bool  getLatestFrame = true,
bool  undistort = true,
ipa_CameraSensors::t_ToFGrayImageType  grayImageType = ipa_CameraSensors::INTENSITY_32F1 
) [virtual]

Acquires an image from SwissRanger. This implementation is designated for people that do not use openCV image type.

Parameters:
widthStepRange The stride of a row from the range image.
widthStepGray The stride of a row from the grayscale intensity image.
widthStepCartesian The stride of a row from the cartesian image.
rangeImage character array with depth information.
grayImage character array with intensity (grayscale) information.
cartesianImage character array with cartesian (x,y,z) information in meters.
getLatestFrame Set true to acquire a new image on calling instead of returning the one acquired last time
useCalibratedZ Calibrate z values
grayImageType Either gray image data is filled with amplitude image or intensity image
Returns:
Return code.

***********************************************************************

***********************************************************************

***********************************************************************

***********************************************************************

***********************************************************************

***********************************************************************

***********************************************************************

***********************************************************************

Implements ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 705 of file Swissranger.cpp.

unsigned long Swissranger::Close (  )  [virtual]

Close camera device.

Returns:
Return code.

Implements ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 331 of file Swissranger.cpp.

unsigned long Swissranger::GetCalibratedXYMatlab ( int  u,
int  v,
float  z,
float &  x,
float &  y 
) [private]

Definition at line 992 of file Swissranger.cpp.

unsigned long Swissranger::GetCalibratedXYSwissranger ( int  u,
int  v,
int  width,
float &  x,
float &  y 
) [private]

Definition at line 1031 of file Swissranger.cpp.

unsigned long Swissranger::GetCalibratedZMatlab ( int  u,
int  v,
float  zRaw,
float &  zCalibrated 
) [private]

Definition at line 971 of file Swissranger.cpp.

unsigned long Swissranger::GetCalibratedZSwissranger ( int  u,
int  v,
int  width,
float &  zCalibrated 
) [private]

Definition at line 984 of file Swissranger.cpp.

unsigned long Swissranger::GetProperty ( t_cameraProperty *  cameraProperty  )  [virtual]

Function to set properties of the range imaging sensor.

Parameters:
propertyID The ID of the property.
cameraProperty The value of the property.
Returns:
Return code.

Implements ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 583 of file Swissranger.cpp.

unsigned long Swissranger::Init ( std::string  directory,
int  cameraIndex = 0 
) [virtual]

Initializes Swissranger.

Parameters:
directory Path to the directory of the range imaging sensor parameter file.
cameraIndex It is possible to have several cameras of the same type on the system. One may use the camera index to apply different configuration files to each of them.
Returns:
Return code.

Implements ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 115 of file Swissranger.cpp.

bool ipa_CameraSensors::Swissranger::isInitialized (  )  [inline, virtual]

Determines if range imaging camera has successfully been initialized.

Returns:
True if camera is initialized, false otherwise.

Implements ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 148 of file Swissranger.h.

bool ipa_CameraSensors::Swissranger::isOpen (  )  [inline, virtual]

Determines if range imaging camera camera has successfully been opened.

Returns:
True if camera is open, false otherwise.

Implements ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 149 of file Swissranger.h.

unsigned long Swissranger::LoadParameters ( const char *  filename,
int  cameraIndex 
) [private, virtual]

Load general Swissranger parameters and previously determined calibration parameters.

Parameters:
filename Swissranger parameter path and file name.
cameraIndex The index of the camera within the configuration file i.e. SR_CAM_0 or SR_CAM_1
Returns:
Return value

Implements ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 1161 of file Swissranger.cpp.

unsigned long Swissranger::Open (  )  [virtual]

Opens the camera device. All camera specific parameters for opening the camera should have been set within the Init() function.

Returns:
Return code.

Implements ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 261 of file Swissranger.cpp.

unsigned long Swissranger::SaveParameters ( const char *  filename  )  [virtual]

Save camera parameters. Saves the on-line set parameters for the range imaging camera to a file.

Parameters:
filename Configuration file name.
Returns:
Return code.

Implements ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 966 of file Swissranger.cpp.

unsigned long Swissranger::SetParameters (  )  [private]

Parses the data extracted by LoadParameters and calls the corresponding SetProperty functions.

Returns:
Return code

Definition at line 1041 of file Swissranger.cpp.

unsigned long Swissranger::SetProperty ( t_cameraProperty *  cameraProperty  )  [virtual]

Function to set properties of the range imaging sensor.

Parameters:
propertyID The ID of the property.
cameraProperty The value of the property.
Returns:
Return code.

Implements ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 352 of file Swissranger.cpp.

unsigned long Swissranger::SetPropertyDefaults (  )  [virtual]

Function to set property defaults of the range imaging sensor.

Returns:
Return code.

Implements ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 577 of file Swissranger.cpp.


Member Data Documentation

a0 z-calibration parameters. One matrix entry corresponds to one pixel

Given a 32 bit swissranger depth value, the real depth value in meteres is given by: z(u,v)=a0(u,v)+a1(u,v)*d(u,v)+a2(u,v)*d(u,v)^2 +a3(u,v)*d(u,v)^3+a4(u,v)*d(u,v)^4+a5(u,v)*d(u,v)^5 +a6(u,v)*d(u,v)^6;

Definition at line 189 of file Swissranger.h.

a1 z-calibration parameters. One matrix entry corresponds to one pixel

Definition at line 190 of file Swissranger.h.

a2 z-calibration parameters. One matrix entry corresponds to one pixel

Definition at line 191 of file Swissranger.h.

a3 z-calibration parameters. One matrix entry corresponds to one pixel

Definition at line 192 of file Swissranger.h.

a4 z-calibration parameters. One matrix entry corresponds to one pixel

Definition at line 193 of file Swissranger.h.

a5 z-calibration parameters. One matrix entry corresponds to one pixel

Definition at line 194 of file Swissranger.h.

a6 z-calibration parameters. One matrix entry corresponds to one pixel

Definition at line 195 of file Swissranger.h.

True, when m_CoeffsAx have been initialized.

Definition at line 182 of file Swissranger.h.

Image array.

Definition at line 175 of file Swissranger.h.

Is false, when acquiring gray image has not been called, yet.

Definition at line 183 of file Swissranger.h.

Number of images the siwssranger returns (i.e. an intensity and a range image).

Definition at line 174 of file Swissranger.h.

Handle to USB SR3000 camera.

Definition at line 173 of file Swissranger.h.

Definition at line 178 of file Swissranger.h.

Definition at line 179 of file Swissranger.h.

Definition at line 180 of file Swissranger.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines


cob_camera_sensors
Author(s): Jan Fischer
autogenerated on Fri Jan 11 10:01:13 2013