Public Member Functions | Private Member Functions | Private Attributes
ipa_CameraSensors::VirtualRangeCam Class Reference

#include <VirtualRangeCam.h>

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

List of all members.

Public Member Functions

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 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)
unsigned long Close ()
unsigned long GetCalibratedUV (double x, double y, double z, double &u, double &v)
int GetNumberOfImages ()
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 SetPathToImages (std::string path)
unsigned long SetProperty (t_cameraProperty *cameraProperty)
unsigned long SetPropertyDefaults ()
 VirtualRangeCam ()
 ~VirtualRangeCam ()

Private Member Functions

void FindSourceImageFormat (std::map< std::string, int >::iterator &itCounter, std::string &ext)
unsigned long GetCalibratedXYMatlab (int u, int v, float z, float &x, float &y)
unsigned long GetCalibratedZMatlab (int u, int v, float zRaw, float &zCalibrated)
unsigned long LoadParameters (const char *filename, int cameraIndex)
void UpdateImageDimensionsOnFirstImage (std::string filename, std::string ext=".xml")

Private Attributes

std::vector< std::string > m_AmplitudeImageFileNames
std::string m_CameraDataDirectory
 Directory where the image data resides.
int m_CameraIndex
 Index of the specified camera. Important, when several cameras of the same type are present.
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
std::vector< std::string > m_CoordinateImageFileNames
int m_ImageHeight
 Image height.
int m_ImageWidth
 Image width.
std::vector< std::string > m_IntensityImageFileNames
double m_k1
double m_k2
double m_p1
double m_p2
 Distortion parameters.
std::vector< std::string > m_RangeImageFileNames

Detailed Description

Interface class to virtual range camera like Swissranger 3000/4000. The class offers an interface to a virtual range camera, that is equal to the interface of a real range camera. However, pictures are read from a directory instead of the camera.

Definition at line 86 of file VirtualRangeCam.h.


Constructor & Destructor Documentation

Definition at line 76 of file VirtualRangeCam.cpp.

Definition at line 87 of file VirtualRangeCam.cpp.


Member Function Documentation

unsigned long VirtualRangeCam::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:
widthStepRangeThe stride of a row from the range image.
widthStepGrayThe stride of a row from the grayscale intensity image.
widthStepCartesianThe stride of a row from the cartesian image.
rangeImagecharacter array with depth information.
grayImagecharacter array with intensity (grayscale) information.
cartesianImagecharacter array with cartesian (x,y,z) information in meters.
getLatestFrameSet true to acquire a new image on calling instead of returning the one acquired last time
useCalibratedZCalibrate z values
grayImageTypeEither gray image data is filled with amplitude image or intensity image
Returns:
Return code.

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

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

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

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

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

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

Implements ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 575 of file VirtualRangeCam.cpp.

unsigned long VirtualRangeCam::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:
rangeImageOpenCV conform image with depth information.
grayImageOpenCV conform image with grayscale information.
cartesianImageOpenCV conform image with cartesian (x,y,z) information in meters.
getLatestFrameSet true to acquire a new image on calling instead of returning the one acquired last time
useCalibratedZCalibrate z values
grayImageTypeEither gray image data is filled with amplitude image or intensity image
Exceptions:
IPA_ExceptionThrows an exception, if camera access failed

Implements ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 532 of file VirtualRangeCam.cpp.

unsigned long VirtualRangeCam::Close ( ) [virtual]

Close camera device.

Returns:
Return code.

Implements ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 467 of file VirtualRangeCam.cpp.

void VirtualRangeCam::FindSourceImageFormat ( std::map< std::string, int >::iterator &  itCounter,
std::string &  ext 
) [inline, private]

Compares the value of the iterator with ext in order to find the extension which has instances in the directory. Throws an error if different file formats are present at the same time.

Parameters:
itCounterIterator containing a file extension and a number of instances.
extIs empty if no extension was found before, otherwise it contains the found extension.

Definition at line 263 of file VirtualRangeCam.cpp.

unsigned long VirtualRangeCam::GetCalibratedUV ( double  x,
double  y,
double  z,
double &  u,
double &  v 
)

Definition at line 960 of file VirtualRangeCam.cpp.

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

Definition at line 921 of file VirtualRangeCam.cpp.

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

Definition at line 909 of file VirtualRangeCam.cpp.

Returns the number of images in the directory

Returns:
The number of images in the directory

Reimplemented from ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 875 of file VirtualRangeCam.cpp.

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

Function to set properties of the range imaging sensor.

Parameters:
propertyIDThe ID of the property.
cameraPropertyThe value of the property.
Returns:
Return code.

Implements ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 503 of file VirtualRangeCam.cpp.

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

Initializes Swissranger.

Parameters:
directoryPath to the directory of the range imaging sensor parameter file.
cameraIndexIt 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 95 of file VirtualRangeCam.cpp.

Determines if range imaging camera has successfully been initialized.

Returns:
True if camera is initialized, false otherwise.

Implements ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 117 of file VirtualRangeCam.h.

bool ipa_CameraSensors::VirtualRangeCam::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 118 of file VirtualRangeCam.h.

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

Load general range camera parameters .

Parameters:
filenameConfiguration file-path and file-name.
cameraIndexThe index of the camera within the configuration file i.e. SR_CAM_0 or SR_CAM_1
Returns:
Return code

Implements ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 1005 of file VirtualRangeCam.cpp.

unsigned long VirtualRangeCam::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 278 of file VirtualRangeCam.cpp.

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

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

Parameters:
filenameConfiguration file name.
Returns:
Return code.

Implements ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 901 of file VirtualRangeCam.cpp.

unsigned long VirtualRangeCam::SetPathToImages ( std::string  path) [virtual]

Function specific to virtual camera. Resets the image directory read from the configuration file.

Parameters:
pathThe camera path
Returns:
Return code

Reimplemented from ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 895 of file VirtualRangeCam.cpp.

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

Function to set properties of the range imaging sensor.

Parameters:
propertyIDThe ID of the property.
cameraPropertyThe value of the property.
Returns:
Return code.

Implements ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 480 of file VirtualRangeCam.cpp.

unsigned long VirtualRangeCam::SetPropertyDefaults ( ) [virtual]

Function to set property defaults of the range imaging sensor.

Returns:
Return code.

Implements ipa_CameraSensors::AbstractRangeImagingSensor.

Definition at line 497 of file VirtualRangeCam.cpp.

void VirtualRangeCam::UpdateImageDimensionsOnFirstImage ( std::string  filename,
std::string  ext = ".xml" 
) [inline, private]

Reads out the image width and height from the first image found in the filesystem.

Parameters:
filenameThe name of that image.

Definition at line 241 of file VirtualRangeCam.cpp.


Member Data Documentation

Definition at line 172 of file VirtualRangeCam.h.

Directory where the image data resides.

Definition at line 169 of file VirtualRangeCam.h.

Index of the specified camera. Important, when several cameras of the same type are present.

Definition at line 170 of file VirtualRangeCam.h.

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 161 of file VirtualRangeCam.h.

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

Definition at line 162 of file VirtualRangeCam.h.

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

Definition at line 163 of file VirtualRangeCam.h.

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

Definition at line 164 of file VirtualRangeCam.h.

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

Definition at line 165 of file VirtualRangeCam.h.

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

Definition at line 166 of file VirtualRangeCam.h.

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

Definition at line 167 of file VirtualRangeCam.h.

Definition at line 155 of file VirtualRangeCam.h.

Definition at line 175 of file VirtualRangeCam.h.

Image height.

Definition at line 178 of file VirtualRangeCam.h.

Image width.

Definition at line 177 of file VirtualRangeCam.h.

Definition at line 173 of file VirtualRangeCam.h.

Definition at line 180 of file VirtualRangeCam.h.

Definition at line 180 of file VirtualRangeCam.h.

Definition at line 180 of file VirtualRangeCam.h.

Distortion parameters.

Definition at line 180 of file VirtualRangeCam.h.

Definition at line 174 of file VirtualRangeCam.h.


The documentation for this class was generated from the following files:


cob_camera_sensors
Author(s): Jan Fischer
autogenerated on Sun Oct 5 2014 23:07:55