Classes | Public Member Functions | Protected Attributes | Private Member Functions | List of all members
ipa_CameraSensors::AbstractColorCamera Class Referenceabstract

#include <AbstractColorCamera.h>

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

Classes

struct  t_ColorCameraParameters
 

Public Member Functions

virtual unsigned long Close ()=0
 
virtual t_cameraType GetCameraType ()
 
unsigned long GetColorImage (char *colorImageData, bool getLatestFrame=true)
 
virtual unsigned long GetColorImage (cv::Mat *colorImage, bool getLatestFrame=true)=0
 
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 ()
 
virtual bool isOpen ()
 
virtual unsigned long Open ()=0
 
virtual unsigned long PrintCameraInformation ()=0
 
virtual unsigned long SaveParameters (const char *filename)=0
 
virtual unsigned long SetPathToImages (std::string path)
 
virtual unsigned long SetProperty (t_cameraProperty *cameraProperty)=0
 
virtual unsigned long SetPropertyDefaults ()=0
 
virtual unsigned long TestCamera (const char *filename)
 
virtual ~AbstractColorCamera ()
 Destructor. More...
 

Protected Attributes

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...
 

Private Member Functions

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

Detailed Description

An interface for common color cameras. All color/mono cameras that are used within the project must derive from this class to guarantee interoperability with the already existing code.

Definition at line 50 of file AbstractColorCamera.h.

Constructor & Destructor Documentation

AbstractColorCamera::~AbstractColorCamera ( )
virtual

Destructor.

Definition at line 30 of file AbstractColorCamera.cpp.

Member Function Documentation

virtual unsigned long ipa_CameraSensors::AbstractColorCamera::Close ( )
pure virtual

Close camera device.

Returns
Return code.

Implemented in ipa_CameraSensors::AVTPikeCam, and ipa_CameraSensors::VirtualColorCam.

t_cameraType AbstractColorCamera::GetCameraType ( )
virtual

Returns the camera type.

Returns
The camera type

Definition at line 34 of file AbstractColorCamera.cpp.

unsigned long ipa_CameraSensors::AbstractColorCamera::GetColorImage ( char *  colorImageData,
bool  getLatestFrame = true 
)
inline

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

Definition at line 111 of file AbstractColorCamera.h.

virtual unsigned long ipa_CameraSensors::AbstractColorCamera::GetColorImage ( cv::Mat *  colorImage,
bool  getLatestFrame = true 
)
pure 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

Implemented in ipa_CameraSensors::AVTPikeCam, and ipa_CameraSensors::VirtualColorCam.

virtual int ipa_CameraSensors::AbstractColorCamera::GetNumberOfImages ( )
inlinevirtual

Returns the number of images in the directory

Returns
The number of images in the directory

Reimplemented in ipa_CameraSensors::VirtualColorCam.

Definition at line 161 of file AbstractColorCamera.h.

virtual unsigned long ipa_CameraSensors::AbstractColorCamera::GetProperty ( t_cameraProperty cameraProperty)
pure virtual

Function to get properties of the camera sensor.

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

Implemented in ipa_CameraSensors::AVTPikeCam, and ipa_CameraSensors::VirtualColorCam.

virtual unsigned long ipa_CameraSensors::AbstractColorCamera::Init ( std::string  directory,
int  cameraIndex = 0 
)
pure 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.

Implemented in ipa_CameraSensors::AVTPikeCam, and ipa_CameraSensors::VirtualColorCam.

virtual bool ipa_CameraSensors::AbstractColorCamera::isInitialized ( )
inlinevirtual

Returns true, when Init() has been called on the camera.

Returns
Camera initialized or not.

Definition at line 90 of file AbstractColorCamera.h.

virtual bool ipa_CameraSensors::AbstractColorCamera::isOpen ( )
inlinevirtual

Returns true, when Open() has been called on the camera.

Returns
Camera opened or not.

Definition at line 94 of file AbstractColorCamera.h.

virtual unsigned long ipa_CameraSensors::AbstractColorCamera::LoadParameters ( const char *  filename,
int  cameraIndex 
)
privatepure virtual

Loads all camera specific parameters from the xml configuration file and saves them in t_ColorCameraParameters. This function is internally called by Init to load the parameters from the xml configuration file.

Parameters
filenameThe path to the configuration file.
Returns
Return code.

Implemented in ipa_CameraSensors::AVTPikeCam, and ipa_CameraSensors::VirtualColorCam.

virtual unsigned long ipa_CameraSensors::AbstractColorCamera::Open ( )
pure virtual

Opens the camera device. All camera specific parameters for opening the camera should have been set within the Init function.

Returns
Return code.

Implemented in ipa_CameraSensors::AVTPikeCam, and ipa_CameraSensors::VirtualColorCam.

virtual unsigned long ipa_CameraSensors::AbstractColorCamera::PrintCameraInformation ( )
pure virtual

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

Returns
Return code.

Implemented in ipa_CameraSensors::AVTPikeCam, and ipa_CameraSensors::VirtualColorCam.

virtual unsigned long ipa_CameraSensors::AbstractColorCamera::SaveParameters ( const char *  filename)
pure virtual

Saves all parameters on hard disk.

Parameters
filenameThe filename of the storage.
Returns
Return code.

Implemented in ipa_CameraSensors::AVTPikeCam, and ipa_CameraSensors::VirtualColorCam.

virtual unsigned long ipa_CameraSensors::AbstractColorCamera::SetParameters ( )
privatepure virtual

Sets the loaded parameters.

Returns
Return code.

Implemented in ipa_CameraSensors::AVTPikeCam, and ipa_CameraSensors::VirtualColorCam.

virtual unsigned long ipa_CameraSensors::AbstractColorCamera::SetPathToImages ( std::string  path)
inlinevirtual

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

Parameters
pathThe camera path
Returns
Return code

Reimplemented in ipa_CameraSensors::VirtualColorCam.

Definition at line 167 of file AbstractColorCamera.h.

virtual unsigned long ipa_CameraSensors::AbstractColorCamera::SetProperty ( t_cameraProperty cameraProperty)
pure virtual

Function to set properties of the camera sensor.

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

Implemented in ipa_CameraSensors::AVTPikeCam, and ipa_CameraSensors::VirtualColorCam.

virtual unsigned long ipa_CameraSensors::AbstractColorCamera::SetPropertyDefaults ( )
pure virtual

Function to set property defaults of the camera sensor.

Returns
Return code.

Implemented in ipa_CameraSensors::AVTPikeCam, and ipa_CameraSensors::VirtualColorCam.

unsigned long AbstractColorCamera::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 in ipa_CameraSensors::AVTPikeCam, and ipa_CameraSensors::VirtualColorCam.

Definition at line 39 of file AbstractColorCamera.cpp.

Member Data Documentation

unsigned int ipa_CameraSensors::AbstractColorCamera::m_BufferSize
protected

Number of images, the camera buffers internally.

Definition at line 181 of file AbstractColorCamera.h.

t_cameraType ipa_CameraSensors::AbstractColorCamera::m_CameraType
protected

Camera Type.

Definition at line 179 of file AbstractColorCamera.h.

t_ColorCameraParameters ipa_CameraSensors::AbstractColorCamera::m_ColorCameraParameters
protected

Storage for xml configuration file data.

Definition at line 177 of file AbstractColorCamera.h.

bool ipa_CameraSensors::AbstractColorCamera::m_initialized
protected

True, when the camera has sucessfully been initialized.

Definition at line 174 of file AbstractColorCamera.h.

bool ipa_CameraSensors::AbstractColorCamera::m_open
protected

True, when the camera has sucessfully been opend.

Definition at line 175 of file AbstractColorCamera.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