#include <OCamera.h>
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 | SetupHardwareWhitebalancingFactors (unsigned char WBtable[768]) |
For Hardware(FPGA)-Whitebalancing lookup tables are used. | |
static int | StoreWhiteBalanceFactors (int red, int green, int blue) |
Store white balance factors to flash memory. |
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.
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.
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) |
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.
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.
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 |
static int OCameraTools::SetupHardwareWhitebalancingFactors | ( | unsigned char | WBtable[768] | ) | [static] |
For Hardware(FPGA)-Whitebalancing lookup tables are used.
This method reads the stored factors from flash memory (flash file system /ffx/etc/wb.conf) and builds up the whitebalancing tables that can directly be used with the OCamera::SetWhiteBalance() method.
WBtable | 768 byte width array where the lookup-tables are created. |
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).
red | red color component white balance factor | |
green | green color component white balance factor | |
blue | blue color component white balance factor |