![]() |
embedded system library for e-puck
1.0.1
A redesigned API library for the e-puck robot platform
|
interface of the camera module More...
Files | |
file | el_camera.h |
interface of the camera module
In this library, the resolution of the image captured by the camera is fixed to 40x15 in RGB mode with a maximum frame rate of 18.432. This resolution is a result of subsampling, which means field of view (FOV) of the image is not lost. The horizontal FOV of the camera is about 56 deg while the vertical FOV is about 42 deg. Both FOV are almost fully covered in the captured image.
The camera module in this library uses dual-buffer-swapping mechanism. At any moment, data acquired from the camera are written to the front buffer while any reading functions read data from the back buffer. Once a frame is fully written, pointers to the two buffers will be swapped. This mechanism allows a frame of image to be processed concurrently with the acquisition of next frame.
To run something when a frame of image is ready, create a trigger with EL_EVENT_CAMERA_FRAME_UPDATE event.
Before reading data in the frame buffer, it (the back buffer) needs to be locked. The following structure is a typical loop to process a frame:
When the frame buffer is locked, no further buffer swapping will occur. Therefore, the time cost of the image processing code ought to be less than the update interval of the frames if each of the frames from the camera need to be processed.
See Example 4 for a systematic usage of the camera module with some image processing techniques.
In Example 3, the robot can transmit camera images via UART1. While using the serial communication utility of this library, the incoming images will be saved as BMP files. A suitable camera configuration can be tuned based on the images.
The actual frame rate achieved depends on the exposure mode used. When automatic exposure control is used and the environment is not well illuminated, the frame rate may drop to ~9. Fixed time exposure mode can be used to stablize the frame rate. For example:
In EL_EXPOSURE_TIME mode, the framerate will become lower than 18.4 when the ExposureTime
is set to be bigger than 7.5 approximately.
More detailed information about tuning the camera should be found in the datasheet of PO6030K.
For reference, the setting used in the laboratory in Sheffield Robotics is: