embedded system library for e-puck  1.0.1
A redesigned API library for the e-puck robot platform
 All Data Structures Files Functions Variables Enumerations Enumerator Modules Pages
Data Structures | Macros | Enumerations | Functions
el_camera.h File Reference
#include "el_common.h"
#include "el_clock.h"

Go to the source code of this file.

Data Structures

struct  el_camera_param
 
struct  el_camera_image
 

Macros

#define EL_CAMERA_FRAME_DIM_X   40
 
#define EL_CAMERA_FRAME_DIM_Y   15
 

Enumerations

enum  el_camera_exposure_mode { EL_AUTOMATIC = 0, EL_EXPOSURE_TIME = 1, EL_EIT_AND_ELG = 2, EL_IT_AND_GG = 3 }
 

Functions

void el_enable_camera ()
 enable the camera
 
void el_disable_camera ()
 disable the camera
 
el_camera_paramel_camera_options ()
 get the pointer to a static instance of el_camera_param More...
 
void el_camera_options_apply ()
 apply the settings stored in el_camera_options directly More...
 
void el_camera_options_reset ()
 reset the settings stored in el_camera_options to default More...
 
void el_config_camera (const el_camera_param *p)
 apply the settings in the given structure More...
 
void el_camera_lock_frame ()
 lock the frame buffers More...
 
void el_camera_unlock_frame ()
 unlock the frame buffers
 
bool el_camera_is_frame_locked ()
 check whether the frame buffers is locked More...
 
el_uint32 el_camera_get_frame_counter ()
 get total number of frames captured since initialization More...
 
void el_camera_get_frame_pixel (int X, int Y, el_uint8 *out3v)
 get the color of a pixel in current frame buffer. More...
 
el_uint16 el_camera_get_frame_width ()
 get width (horizontal dimension) of the image in the frame buffer for reading. More...
 
el_uint16 el_camera_get_frame_height ()
 get height (vertical dimension) of the image in the frame buffer for reading. More...
 
el_camera_imageel_camera_frame ()
 get the pointer to a static instance of el_camera_image for reading More...
 

Detailed Description

Author
Jianing Chen

Enumeration Type Documentation

This enum is used in el_camera_param to specify the exposure mode of the camera.

Enumerator
EL_AUTOMATIC 

automatically adjusted by the camera

EL_EXPOSURE_TIME 

use ExposureTime

EL_EIT_AND_ELG 

use ExternalIntergationTime and ExternalLinearGain

EL_IT_AND_GG 

use IntegrationTime and GlobalGain

Function Documentation

el_camera_param* el_camera_options ( )

get the pointer to a static instance of el_camera_param

Returns
the pointer
void el_camera_options_apply ( )

apply the settings stored in el_camera_options directly

This function is equivalent to "el_config_camera( el_camera_options() )".

void el_camera_options_reset ( )

reset the settings stored in el_camera_options to default

This function can be used in combination with el_camera_options_apply when the default configuration need to be used.

void el_config_camera ( const el_camera_param p)

apply the settings in the given structure

Parameters
ppointer to the data structure

The default parameters of the camera is equivalent to the following code:

1 el_camera_options()->ExposureMode = EL_AUTOMATIC;
2 el_camera_options()->AutoWhiteBalance = true;
3 el_camera_options()->AutoDigitalGain = true;
4 el_camera_options()->ExposureTime = 1.0f;
5 el_camera_options()->RedGain = 1.0f;
6 el_camera_options()->GreenGain = 1.0f;
7 el_camera_options()->BlueGain = 1.0f;
8 el_camera_options()->ExternalIntergationTime = 1.0f;
9 el_camera_options()->ExternalLinearGain = 1.0f;
10 el_camera_options()->IntegrationTime = 1.0f;
11 el_camera_options()->GlobalGain = 1.0f;
12 el_camera_options()->DigitalGain = 1.0f;
13 el_config_camera( el_camera_options() );

Unlike the config functions for other modules, the time cost to execute this function is not neglectable (around 7.1 ms), so it should not be executed frequently in a process.

void el_camera_lock_frame ( )

lock the frame buffers

When the frame buffer is locked, no buffer swapping will occur. This guarantees the image inside the frame buffer to be one frame of image. Otherwise, the image may be changed halfway through a image processing algorithm.

bool el_camera_is_frame_locked ( )

check whether the frame buffers is locked

Returns
locked or not
el_uint32 el_camera_get_frame_counter ( )

get total number of frames captured since initialization

Returns
total number of frames

When the frame buffers are locked, the frame counter will not be increased.

void el_camera_get_frame_pixel ( int  X,
int  Y,
el_uint8 *  out3v 
)

get the color of a pixel in current frame buffer.

Parameters
Xx coordinate of the pixel
Yy coordinate of the pixel
out3vpointer to the array to store the RGB components.

(0,0) is the bottom left corner.

el_uint16 el_camera_get_frame_width ( )

get width (horizontal dimension) of the image in the frame buffer for reading.

Returns
width of the frame to be locked for reading.

At present, this function always return 40.

el_uint16 el_camera_get_frame_height ( )

get height (vertical dimension) of the image in the frame buffer for reading.

Returns
height of the frame to be locked for reading.

At present, this function always return 15.

el_camera_image* el_camera_frame ( )

get the pointer to a static instance of el_camera_image for reading

Returns
the pointer