#include <VirtualColorCam.h>
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... | |
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.
VirtualColorCam::VirtualColorCam | ( | ) |
Definition at line 39 of file VirtualColorCam.cpp.
VirtualColorCam::~VirtualColorCam | ( | ) |
Definition at line 52 of file VirtualColorCam.cpp.
|
virtual |
Close camera device.
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.
|
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 308 of file VirtualColorCam.cpp.
|
virtual |
Returns the number of images in the directory
Reimplemented from ipa_CameraSensors::AbstractColorCamera.
Definition at line 189 of file VirtualColorCam.cpp.
|
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 245 of file VirtualColorCam.cpp.
|
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 61 of file VirtualColorCam.cpp.
|
privatevirtual |
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 342 of file VirtualColorCam.cpp.
|
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 85 of file VirtualColorCam.cpp.
|
virtual |
Displays camera information on standard output. Information includes available parameters, color and camera formats.
Implements ipa_CameraSensors::AbstractColorCamera.
Definition at line 326 of file VirtualColorCam.cpp.
|
virtual |
Saves all parameters on hard disk.
filename | The filename of the storage. |
Implements ipa_CameraSensors::AbstractColorCamera.
Definition at line 194 of file VirtualColorCam.cpp.
|
inlineprivatevirtual |
Sets the loaded parameters.
Implements ipa_CameraSensors::AbstractColorCamera.
Definition at line 61 of file VirtualColorCam.h.
|
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 199 of file VirtualColorCam.cpp.
|
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 218 of file VirtualColorCam.cpp.
|
virtual |
Function to set property defaults of the camera sensor.
Implements ipa_CameraSensors::AbstractColorCamera.
Definition at line 243 of file VirtualColorCam.cpp.
|
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 331 of file VirtualColorCam.cpp.
|
private |
Directory where the image data resides.
Definition at line 47 of file VirtualColorCam.h.
|
private |
Index of the specified camera. Important, when several cameras of the same type are present.
Definition at line 48 of file VirtualColorCam.h.
|
private |
Definition at line 50 of file VirtualColorCam.h.
|
private |
Holds the index of the image that is extracted during the next call of AcquireImages
Definition at line 52 of file VirtualColorCam.h.
|
private |
Definition at line 45 of file VirtualColorCam.h.
|
private |
Definition at line 44 of file VirtualColorCam.h.