#include <VirtualColorCam.h>
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 |
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.
VirtualColorCam::VirtualColorCam | ( | ) |
Definition at line 68 of file VirtualColorCam.cpp.
VirtualColorCam::~VirtualColorCam | ( | ) |
Definition at line 81 of file VirtualColorCam.cpp.
unsigned long VirtualColorCam::Close | ( | ) | [virtual] |
Close camera device.
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.
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. |
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.
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. |
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
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.
propertyID | The ID of the property. | |
cameraProperty | The value of the property. |
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
.
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 |
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
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 |
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.
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.
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.
filename | The filename of the storage. |
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.
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.
path | The camera path |
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.
propertyID | The ID of the property. | |
cameraProperty | The value of the property. |
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.
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.
filename | Path to the camera initialization xml file. |
Reimplemented from ipa_CameraSensors::AbstractColorCamera.
Definition at line 360 of file VirtualColorCam.cpp.
std::string ipa_CameraSensors::VirtualColorCam::m_CameraDataDirectory [private] |
Directory where the image data resides.
Definition at line 94 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 95 of file VirtualColorCam.h.
std::vector<std::string> ipa_CameraSensors::VirtualColorCam::m_ColorImageFileNames [private] |
Definition at line 97 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 99 of file VirtualColorCam.h.
int ipa_CameraSensors::VirtualColorCam::m_ImageHeight [private] |
Definition at line 92 of file VirtualColorCam.h.
int ipa_CameraSensors::VirtualColorCam::m_ImageWidth [private] |
Definition at line 91 of file VirtualColorCam.h.