Public Member Functions | Private Member Functions | Private Attributes
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 (char *colorImageData, bool getLatestFrame)
unsigned long GetColorImage (cv::Mat *image, 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 41 of file VirtualColorCam.h.


Constructor & Destructor Documentation

Definition at line 39 of file VirtualColorCam.cpp.

Definition at line 52 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 206 of file VirtualColorCam.cpp.

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

Retrieves image data from the color camera.

Parameters:
colorImageDataAn array to be filled with image data
getLatestFrameTrue, 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 273 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:
colorImageThe image that has been acquired by the camera.
getLatestFrameIf 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_ExceptionThrows an exception, if camera access failed

Implements ipa_CameraSensors::AbstractColorCamera.

Definition at line 308 of file VirtualColorCam.cpp.

Returns the number of images in the directory

Returns:
The number of images in the directory

Reimplemented from ipa_CameraSensors::AbstractColorCamera.

Definition at line 189 of file VirtualColorCam.cpp.

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

Function to get properties of the camera sensor.

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

Implements ipa_CameraSensors::AbstractColorCamera.

Definition at line 245 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:
directoryPath to the configuration file directory.
cameraIndexIt 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 61 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:
filenameThe file name and path of the configuration file
cameraIndexThe 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 342 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 85 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 326 of file VirtualColorCam.cpp.

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

Saves all parameters on hard disk.

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

Implements ipa_CameraSensors::AbstractColorCamera.

Definition at line 194 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 61 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:
pathThe camera path
Returns:
Return code

Reimplemented from ipa_CameraSensors::AbstractColorCamera.

Definition at line 199 of file VirtualColorCam.cpp.

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

Function to set properties of the camera sensor.

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

Implements ipa_CameraSensors::AbstractColorCamera.

Definition at line 218 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 243 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:
filenamePath to the camera initialization xml file.
Returns:
Return code.

Reimplemented from ipa_CameraSensors::AbstractColorCamera.

Definition at line 331 of file VirtualColorCam.cpp.


Member Data Documentation

Directory where the image data resides.

Definition at line 47 of file VirtualColorCam.h.

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

Definition at line 48 of file VirtualColorCam.h.

Definition at line 50 of file VirtualColorCam.h.

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

Definition at line 52 of file VirtualColorCam.h.

Definition at line 45 of file VirtualColorCam.h.

Definition at line 44 of file VirtualColorCam.h.


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


cob_camera_sensors
Author(s): Jan Fischer , Richard Bormann
autogenerated on Sat Jun 8 2019 21:02:02