ipa_CameraSensors::VirtualColorCam Class Reference

#include <VirtualColorCam.h>

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

List of all members.

Public Member Functions

unsigned long Close ()
unsigned long GetColorImage (cv::Mat *image, bool getLatestFrame)
unsigned long GetColorImage (char *colorImageData, bool getLatestFrame)
int GetNumberOfImages ()
unsigned long GetProperty (t_cameraProperty *cameraProperty)
unsigned long Init (std::string directory, int cameraIndex=0)
unsigned long Open ()
unsigned long PrintCameraInformation ()
unsigned long SaveParameters (const char *filename)
unsigned long SetPathToImages (std::string path)
unsigned long SetProperty (t_cameraProperty *cameraProperty)
unsigned long SetPropertyDefaults ()
unsigned long TestCamera (const char *filename)
 VirtualColorCam ()
 ~VirtualColorCam ()

Private Member Functions

unsigned long LoadParameters (const char *filename, int cameraIndex)
unsigned long SetParameters ()

Private Attributes

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.
std::vector< std::string > m_ColorImageFileNames
unsigned int m_ImageCounter
 Holds the index of the image that is extracted during the next call of AcquireImages
int m_ImageHeight
int m_ImageWidth

Detailed Description

The class offers an interface to a virtual color camera, that is equivalent to the interface of a real color camera. However, pictures are read from a directory instead of the camera.

Definition at line 88 of file VirtualColorCam.h.


Constructor & Destructor Documentation

VirtualColorCam::VirtualColorCam (  ) 

Definition at line 68 of file VirtualColorCam.cpp.

VirtualColorCam::~VirtualColorCam (  ) 

Definition at line 81 of file VirtualColorCam.cpp.


Member Function Documentation

unsigned long VirtualColorCam::Close (  )  [virtual]

Close camera device.

Returns:
Return code.

Implements ipa_CameraSensors::AbstractColorCamera.

Definition at line 235 of file VirtualColorCam.cpp.

unsigned long VirtualColorCam::GetColorImage ( cv::Mat *  colorImage,
bool  getLatestFrame 
) [virtual]

Retrieves an image from the camera. cv::Mat object is initialized on demand.

Parameters:
colorImage The image that has been acquired by the camera.
getLatestFrame If true, the camera acquires a new frame and returns it. Otherwise, the next frame following the last returned frame is returned from the internal camera buffer.
Exceptions:
IPA_Exception Throws an exception, if camera access failed

Implements ipa_CameraSensors::AbstractColorCamera.

Definition at line 337 of file VirtualColorCam.cpp.

unsigned long VirtualColorCam::GetColorImage ( char *  colorImageData,
bool  getLatestFrame 
)

Retrieves image data from the color camera.

Parameters:
colorImageData An array to be filled with image data
getLatestFrame True, when the latest picture has to be returned. Otherwise, the next picture following the last call to getLatestFrame is returned.
Returns:
Return code

Reimplemented from ipa_CameraSensors::AbstractColorCamera.

Definition at line 302 of file VirtualColorCam.cpp.

int VirtualColorCam::GetNumberOfImages (  )  [virtual]

Returns the number of images in the directory

Returns:
The number of images in the directory

Reimplemented from ipa_CameraSensors::AbstractColorCamera.

Definition at line 218 of file VirtualColorCam.cpp.

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

Function to get properties of the camera sensor.

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

Implements ipa_CameraSensors::AbstractColorCamera.

Definition at line 274 of file VirtualColorCam.cpp.

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

Initializes the color camera. Camera specific constants may be set within the configuration file cameraSensorsIni.xml. The function has to set the member variable m_initialized.

Parameters:
directory Path to the configuration file directory.
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
Returns:
Return code.

Implements ipa_CameraSensors::AbstractColorCamera.

Definition at line 90 of file VirtualColorCam.cpp.

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

Parses the XML configuration file, that holds the camera settings

Parameters:
filename The file name and path of the configuration file
cameraIndex The index of the camera within the configuration file i.e. AVT_PIKE_CAM_0 or AVT_PIKE_CAM_1
Returns:
Return value

Implements ipa_CameraSensors::AbstractColorCamera.

Definition at line 371 of file VirtualColorCam.cpp.

unsigned long VirtualColorCam::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::AbstractColorCamera.

Definition at line 114 of file VirtualColorCam.cpp.

unsigned long VirtualColorCam::PrintCameraInformation (  )  [virtual]

Displays camera information on standard output. Information includes available parameters, color and camera formats.

Returns:
Return code.

Implements ipa_CameraSensors::AbstractColorCamera.

Definition at line 355 of file VirtualColorCam.cpp.

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

Saves all parameters on hard disk.

Parameters:
filename The filename of the storage.
Returns:
Return code.

Implements ipa_CameraSensors::AbstractColorCamera.

Definition at line 223 of file VirtualColorCam.cpp.

unsigned long ipa_CameraSensors::VirtualColorCam::SetParameters (  )  [inline, private, virtual]

Sets the loaded parameters.

Returns:
Return code.

Implements ipa_CameraSensors::AbstractColorCamera.

Definition at line 108 of file VirtualColorCam.h.

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

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

Parameters:
path The camera path
Returns:
Return code

Reimplemented from ipa_CameraSensors::AbstractColorCamera.

Definition at line 228 of file VirtualColorCam.cpp.

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

Function to set properties of the camera sensor.

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

Implements ipa_CameraSensors::AbstractColorCamera.

Definition at line 247 of file VirtualColorCam.cpp.

unsigned long VirtualColorCam::SetPropertyDefaults (  )  [virtual]

Function to set property defaults of the camera sensor.

Returns:
Return code.

Implements ipa_CameraSensors::AbstractColorCamera.

Definition at line 272 of file VirtualColorCam.cpp.

unsigned long VirtualColorCam::TestCamera ( const char *  filename  )  [virtual]

Unit Test for the camera interface. Tests each of the single interface functions and displays the output on standard out.

Parameters:
filename Path to the camera initialization xml file.
Returns:
Return code.

Reimplemented from ipa_CameraSensors::AbstractColorCamera.

Definition at line 360 of file VirtualColorCam.cpp.


Member Data Documentation

Directory where the image data resides.

Definition at line 94 of file VirtualColorCam.h.

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

Definition at line 95 of file VirtualColorCam.h.

Definition at line 97 of file VirtualColorCam.h.

Holds the index of the image that is extracted during the next call of AcquireImages

Definition at line 99 of file VirtualColorCam.h.

Definition at line 92 of file VirtualColorCam.h.

Definition at line 91 of file VirtualColorCam.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