#include <AbstractRangeImagingSensor.h>
Classes | |
struct | t_RangeCameraParameters |
Public Member Functions | |
virtual 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)=0 |
virtual unsigned long | 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)=0 |
virtual unsigned long | Close ()=0 |
virtual t_CalibrationMethod | GetCalibrationMethod () |
virtual t_cameraType | GetCameraType () |
virtual int | GetNumberOfImages () |
virtual unsigned long | GetProperty (t_cameraProperty *cameraProperty)=0 |
virtual unsigned long | Init (std::string directory, int cameraIndex=0)=0 |
virtual bool | isInitialized ()=0 |
virtual bool | isOpen ()=0 |
virtual unsigned long | Open ()=0 |
virtual unsigned long | SaveParameters (const char *filename)=0 |
virtual unsigned long | SetIntrinsics (cv::Mat &intrinsicMatrix, cv::Mat &undistortMapX, cv::Mat &undistortMapY) |
virtual unsigned long | SetPathToImages (std::string path) |
virtual unsigned long | SetProperty (t_cameraProperty *cameraProperty)=0 |
virtual unsigned long | SetPropertyDefaults ()=0 |
virtual | ~AbstractRangeImagingSensor () |
Destructor. | |
Public Attributes | |
unsigned int | m_ImageCounter |
Holds the index of the image that is extracted during the next call of AcquireImages | |
Protected Attributes | |
unsigned int | m_BufferSize |
Number of images, the camera buffers internally. | |
t_CalibrationMethod | m_CalibrationMethod |
Calibration method MATLAB, MATLAB_NO_Z or SWISSRANGER. | |
t_cameraType | m_CameraType |
Camera Type. | |
bool | m_initialized |
True, when the camera has sucessfully been initialized. | |
cv::Mat | m_intrinsicMatrix |
Intrinsic parameters [fx 0 cx; 0 fy cy; 0 0 1]. | |
bool | m_open |
True, when the camera has sucessfully been opend. | |
t_RangeCameraParameters | m_RangeCameraParameters |
Storage for xml configuration file parmeters. | |
cv::Mat | m_undistortMapX |
The output array of x coordinates for the undistortion map. | |
cv::Mat | m_undistortMapY |
The output array of Y coordinates for the undistortion map. | |
Private Member Functions | |
virtual unsigned long | LoadParameters (const char *filename, int cameraIndex)=0 |
Abstract interface for range imaging sensors.
Definition at line 52 of file AbstractRangeImagingSensor.h.
AbstractRangeImagingSensor::~AbstractRangeImagingSensor | ( | ) | [virtual] |
Destructor.
Definition at line 30 of file AbstractRangeImagingSensor.cpp.
virtual unsigned long ipa_CameraSensors::AbstractRangeImagingSensor::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 |
||
) | [pure 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.
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 |
IPA_Exception | Throws an exception, if camera access failed |
Implemented in ipa_CameraSensors::Swissranger, and ipa_CameraSensors::VirtualRangeCam.
virtual unsigned long ipa_CameraSensors::AbstractRangeImagingSensor::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 |
||
) | [pure virtual] |
Acquires an image from SwissRanger. This implementation is designated for people that do not use openCV image type.
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 |
Implemented in ipa_CameraSensors::Swissranger, and ipa_CameraSensors::VirtualRangeCam.
virtual unsigned long ipa_CameraSensors::AbstractRangeImagingSensor::Close | ( | ) | [pure virtual] |
Close camera device.
Implemented in ipa_CameraSensors::Swissranger, and ipa_CameraSensors::VirtualRangeCam.
virtual t_CalibrationMethod ipa_CameraSensors::AbstractRangeImagingSensor::GetCalibrationMethod | ( | ) | [inline, virtual] |
Returns the utilized calibration method. Possible methods are MATLAB or SWISSRANGER.
Definition at line 158 of file AbstractRangeImagingSensor.h.
virtual t_cameraType ipa_CameraSensors::AbstractRangeImagingSensor::GetCameraType | ( | ) | [inline, virtual] |
Returns the camera type.
Definition at line 162 of file AbstractRangeImagingSensor.h.
virtual int ipa_CameraSensors::AbstractRangeImagingSensor::GetNumberOfImages | ( | ) | [inline, virtual] |
Returns the number of images in the directory
Reimplemented in ipa_CameraSensors::VirtualRangeCam.
Definition at line 177 of file AbstractRangeImagingSensor.h.
virtual unsigned long ipa_CameraSensors::AbstractRangeImagingSensor::GetProperty | ( | t_cameraProperty * | cameraProperty | ) | [pure virtual] |
Function to set properties of the range imaging sensor.
propertyID | The ID of the property. |
cameraProperty | The value of the property. |
Implemented in ipa_CameraSensors::Swissranger, and ipa_CameraSensors::VirtualRangeCam.
virtual unsigned long ipa_CameraSensors::AbstractRangeImagingSensor::Init | ( | std::string | directory, |
int | cameraIndex = 0 |
||
) | [pure virtual] |
Initializes Swissranger.
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. |
Implemented in ipa_CameraSensors::Swissranger, and ipa_CameraSensors::VirtualRangeCam.
virtual bool ipa_CameraSensors::AbstractRangeImagingSensor::isInitialized | ( | ) | [pure virtual] |
Determines if range imaging camera has successfully been initialized.
Implemented in ipa_CameraSensors::Swissranger, and ipa_CameraSensors::VirtualRangeCam.
virtual bool ipa_CameraSensors::AbstractRangeImagingSensor::isOpen | ( | ) | [pure virtual] |
Determines if range imaging camera camera has successfully been opened.
Implemented in ipa_CameraSensors::Swissranger, and ipa_CameraSensors::VirtualRangeCam.
virtual unsigned long ipa_CameraSensors::AbstractRangeImagingSensor::LoadParameters | ( | const char * | filename, |
int | cameraIndex | ||
) | [private, pure virtual] |
Load general SR31 parameters and previously determined calibration parameters.
filename | Range imaging sensor parameter path and file name. |
cameraIndex | It is possible to have several cameras of the same type on the system. One may us the camera index to apply different configuration files to each of them |
Implemented in ipa_CameraSensors::Swissranger, and ipa_CameraSensors::VirtualRangeCam.
virtual unsigned long ipa_CameraSensors::AbstractRangeImagingSensor::Open | ( | ) | [pure virtual] |
Opens the camera device. All camera specific parameters for opening the camera should have been set within the Init()
function.
Implemented in ipa_CameraSensors::Swissranger, and ipa_CameraSensors::VirtualRangeCam.
virtual unsigned long ipa_CameraSensors::AbstractRangeImagingSensor::SaveParameters | ( | const char * | filename | ) | [pure virtual] |
Save camera parameters. Saves the on-line set parameters for the range imaging camera to a file.
filename | Configuration file name. |
Implemented in ipa_CameraSensors::Swissranger, and ipa_CameraSensors::VirtualRangeCam.
unsigned long AbstractRangeImagingSensor::SetIntrinsics | ( | cv::Mat & | intrinsicMatrix, |
cv::Mat & | undistortMapX, | ||
cv::Mat & | undistortMapY | ||
) | [virtual] |
Assignes intrinsics to the range sensor. Intrinsics are read from the configuration file by the camera toolbox. Intrinsics are needed to calculat range values based on own calibration.
intrinsicMatrix | The intrinsic matrix |
undistortMapX | undistortMapX The undistortion map for x direction |
undistortMapY | undistortMapY The undistortion map for y direction |
Definition at line 34 of file AbstractRangeImagingSensor.cpp.
unsigned long AbstractRangeImagingSensor::SetPathToImages | ( | std::string | path | ) | [virtual] |
Function specific to virtual camera. Resets the image directory read from the configuration file.
path | The camera path |
Reimplemented in ipa_CameraSensors::VirtualRangeCam.
Definition at line 44 of file AbstractRangeImagingSensor.cpp.
virtual unsigned long ipa_CameraSensors::AbstractRangeImagingSensor::SetProperty | ( | t_cameraProperty * | cameraProperty | ) | [pure virtual] |
Function to set properties of the range imaging sensor.
propertyID | The ID of the property. |
cameraProperty | The value of the property. |
Implemented in ipa_CameraSensors::Swissranger, and ipa_CameraSensors::VirtualRangeCam.
virtual unsigned long ipa_CameraSensors::AbstractRangeImagingSensor::SetPropertyDefaults | ( | ) | [pure virtual] |
Function to set property defaults of the range imaging sensor.
Implemented in ipa_CameraSensors::Swissranger, and ipa_CameraSensors::VirtualRangeCam.
unsigned int ipa_CameraSensors::AbstractRangeImagingSensor::m_BufferSize [protected] |
Number of images, the camera buffers internally.
Definition at line 196 of file AbstractRangeImagingSensor.h.
Calibration method MATLAB, MATLAB_NO_Z or SWISSRANGER.
Definition at line 189 of file AbstractRangeImagingSensor.h.
Camera Type.
Definition at line 191 of file AbstractRangeImagingSensor.h.
Holds the index of the image that is extracted during the next call of AcquireImages
Definition at line 185 of file AbstractRangeImagingSensor.h.
bool ipa_CameraSensors::AbstractRangeImagingSensor::m_initialized [protected] |
True, when the camera has sucessfully been initialized.
Definition at line 193 of file AbstractRangeImagingSensor.h.
cv::Mat ipa_CameraSensors::AbstractRangeImagingSensor::m_intrinsicMatrix [protected] |
Intrinsic parameters [fx 0 cx; 0 fy cy; 0 0 1].
Definition at line 198 of file AbstractRangeImagingSensor.h.
bool ipa_CameraSensors::AbstractRangeImagingSensor::m_open [protected] |
True, when the camera has sucessfully been opend.
Definition at line 194 of file AbstractRangeImagingSensor.h.
t_RangeCameraParameters ipa_CameraSensors::AbstractRangeImagingSensor::m_RangeCameraParameters [protected] |
Storage for xml configuration file parmeters.
Definition at line 190 of file AbstractRangeImagingSensor.h.
cv::Mat ipa_CameraSensors::AbstractRangeImagingSensor::m_undistortMapX [protected] |
The output array of x coordinates for the undistortion map.
Definition at line 199 of file AbstractRangeImagingSensor.h.
cv::Mat ipa_CameraSensors::AbstractRangeImagingSensor::m_undistortMapY [protected] |
The output array of Y coordinates for the undistortion map.
Definition at line 200 of file AbstractRangeImagingSensor.h.