Public Member Functions | Private Member Functions | Private Attributes | List of all members
ipa_CameraSensors::VirtualColorCam Class Reference

#include <VirtualColorCam.h>

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

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 ()
 
- Public Member Functions inherited from ipa_CameraSensors::AbstractColorCamera
virtual t_cameraType GetCameraType ()
 
unsigned long GetColorImage (char *colorImageData, bool getLatestFrame=true)
 
virtual bool isInitialized ()
 
virtual bool isOpen ()
 
virtual ~AbstractColorCamera ()
 Destructor. More...
 

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. More...
 
int m_CameraIndex
 Index of the specified camera. Important, when several cameras of the same type are present. More...
 
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 More...
 
int m_ImageHeight
 
int m_ImageWidth
 

Additional Inherited Members

- Protected Attributes inherited from ipa_CameraSensors::AbstractColorCamera
unsigned int m_BufferSize
 Number of images, the camera buffers internally. More...
 
t_cameraType m_CameraType
 Camera Type. More...
 
t_ColorCameraParameters m_ColorCameraParameters
 Storage for xml configuration file data. More...
 
bool m_initialized
 True, when the camera has sucessfully been initialized. More...
 
bool m_open
 True, when the camera has sucessfully been opend. More...
 

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

VirtualColorCam::VirtualColorCam ( )

Definition at line 39 of file VirtualColorCam.cpp.

VirtualColorCam::~VirtualColorCam ( )

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 
)

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.

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 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 
)
privatevirtual

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 ( )
inlineprivatevirtual

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

std::string ipa_CameraSensors::VirtualColorCam::m_CameraDataDirectory
private

Directory where the image data resides.

Definition at line 47 of file VirtualColorCam.h.

int ipa_CameraSensors::VirtualColorCam::m_CameraIndex
private

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

Definition at line 48 of file VirtualColorCam.h.

std::vector<std::string> ipa_CameraSensors::VirtualColorCam::m_ColorImageFileNames
private

Definition at line 50 of file VirtualColorCam.h.

unsigned int ipa_CameraSensors::VirtualColorCam::m_ImageCounter
private

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

Definition at line 52 of file VirtualColorCam.h.

int ipa_CameraSensors::VirtualColorCam::m_ImageHeight
private

Definition at line 45 of file VirtualColorCam.h.

int ipa_CameraSensors::VirtualColorCam::m_ImageWidth
private

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 Thu Mar 19 2020 03:23:05