OCameraTools Class Reference

#include <OCamera.h>

List of all members.


Detailed Description

Basic class for camera tools.


Public Types

enum  eBayerPattern { BAYER_PATTERN_GRGR = 1, BAYER_PATTERN_BGBG = 2, BAYER_PATTERN_RGRG = 3, BAYER_PATTERN_GBGB = 4 }

Static Public Member Functions

static void Bayer2RGB (unsigned char *bayer, unsigned char *rgb, int width, int height, eBayerPattern ePattern=BAYER_PATTERN_GRGR)
 Transform a bayer encoded image into a rgb encoded image.
static int Bayer2RGBBuiltIn (unsigned char *bayer, unsigned char *rgb, int width, int height, eBayerPattern ePattern=BAYER_PATTERN_GRGR)
 Transform a bayer encoded image into a rgb encoded image using built in white balance.
static void Bayer2RGBWhiteBalance (unsigned char *bayer, unsigned char *rgb, int width, int height, int red, int green, int blue, eBayerPattern ePattern=BAYER_PATTERN_GRGR)
 Transform a bayer encoded image into a white balanced rgb encoded image.
static int GetWhiteBalanceFactors (int *red, int *green, int *blue)
 Read white balance factors stored in flash memory.
static int StoreWhiteBalanceFactors (int red, int green, int blue)
 Store white balance factors to flash memory.


Member Enumeration Documentation

enum OCameraTools::eBayerPattern

Enumerator:
BAYER_PATTERN_GRGR  bayer data start with green-red-green-red color pixels
BAYER_PATTERN_BGBG  bayer data start with blue-green-blue-green color pixels
BAYER_PATTERN_RGRG  bayer data start with reg-green-red-green color pixels
BAYER_PATTERN_GBGB  bayer data start with green-blue-green-blue color pixels


Member Function Documentation

static void OCameraTools::Bayer2RGB ( unsigned char *  bayer,
unsigned char *  rgb,
int  width,
int  height,
eBayerPattern  ePattern = BAYER_PATTERN_GRGR 
) [static]

Transform a bayer encoded image into a rgb encoded image.

Parameters:
bayer source image buffer with bayer encoded image
rgb destination image buffer for rgb encoded image
width number of pixels in x direction
height number of pixels in y direction
ePattern specifies the bayer pixel order

static int OCameraTools::Bayer2RGBBuiltIn ( unsigned char *  bayer,
unsigned char *  rgb,
int  width,
int  height,
eBayerPattern  ePattern = BAYER_PATTERN_GRGR 
) [static]

Transform a bayer encoded image into a rgb encoded image using built in white balance.

This method performs a bayer to rgb conversion with white balancing using the white balance factors stored in the camera's flash. White balance factors are read from the flash using the method GetWhiteBalanceFactors(). Afterwards Bayer2RGBWhiteBalance() is called using this factors. If reading the factors from flash fails the bayer to rgb conversion is still performed but no white balancing is done and an error code is returned.

Parameters:
bayer source image buffer with bayer encoded image
rgb destination image buffer for rgb encoded image
width number of pixels in x direction
height number of pixels in y direction
ePattern specifies the bayer pixel order (currently only GRGR and BGBG are supported)
Returns:
0 ... on success
-errno ... on failure always negative (see errno.h)
-EAGAIN ... on incomplete or invalid configuration file /ffx/etc/wb.conf

static void OCameraTools::Bayer2RGBWhiteBalance ( unsigned char *  bayer,
unsigned char *  rgb,
int  width,
int  height,
int  red,
int  green,
int  blue,
eBayerPattern  ePattern = BAYER_PATTERN_GRGR 
) [static]

Transform a bayer encoded image into a white balanced rgb encoded image.

This method performs two tasks in one step:
a bayer to RGB conversion and white balance color correction.
White balancing is done by multiplying the individual RGB channels with a given factor. White balancing is necessary to adjust for different light conditions (day light, bulbs, neon, ...) in a way, that white areas are reproduces as white independent of illumination. Normally white balancing should happen when a white/grey surface is shown to the camera. Grey is better because it better prevents from calibrating on saturated (0xff pixels) image areas.

Parameters:
bayer source image buffer with bayer encoded image
rgb destination image buffer for rgb encoded image
width number of pixels in x direction
height number of pixels in y direction
red multiplication factor (given in percent) for red color component
green multiplication factor (given in percent) for green color component
blue multiplication factor (given in percent) for blue color component
ePattern specifies the bayer pixel order (currently only GRGR and BGBG are supported)

static int OCameraTools::GetWhiteBalanceFactors ( int *  red,
int *  green,
int *  blue 
) [static]

Read white balance factors stored in flash memory.

This method reads previously stored white balance factors from flash memory (flash file system /ffx/etc/wb.conf).
White balance factors are percentage values, i.e. 100 means the corresponding color component is left unchanged, whereas 115 means the the corresponding color component is multiplied by the factor 1.15. Values smaller than 100 lead to a reduction of the corresponding color component.

Parameters:
red pointer to the red color component white balance factor
green pointer to the green color component white balance factor
blue pointer to the blue color component white balance factor
Returns:
0 ... on success
-errno ... on failure always negative (see errno.h)
-EAGAIN ... on incomplete or invalid configuration file /ffx/etc/wb.conf

static int OCameraTools::StoreWhiteBalanceFactors ( int  red,
int  green,
int  blue 
) [static]

Store white balance factors to flash memory.

This method writes/stores white balance factors to flash memory (flash file system /ffx/etc/wb.conf).

Parameters:
red red color component white balance factor
green green color component white balance factor
blue blue color component white balance factor
Returns:
0 ... on success
-errno ... on failure always negative (see errno.h)


The documentation for this class was generated from the following file:
Generated on Fri Oct 12 10:31:12 2007 for Festo SBOx-C API by  doxygen 1.5.1-4