Bayer
Top  Previous  Next

Description

Enables/disables the Bayer conversion mode and selects the Bayer conversion method.

Syntax


[VB]
objActiveGige.Bayer [= Value]


[C/C++]
HRESULT get_Bayer ( short *pBayer );
HRESULT put_Bayer( short Bayer );


Data Type
[VB]

Integer


Parameters
[C/C++]

pBayer [out,retval]  
Pointer to the ordinal number of the currently selected Bayer filter, zero if Bayer conversion is disabled.  
Bayer [in]  
Set to zero to disable Bayer conversion, or set to values from 1 to 3 to select one of the following Bayer filters:  
1 - Nearest Neighbour filter. Missing pixels are substituted with adjacent pixels of the same color.  
2 - Bilinear filter. Calculates the values of missing pixels by performing bilinear interpolation of the adjacent pixels.  
3 - High Quality Linear filter. Calculates the values of missing pixels based on the Malvar, He and Cutler algorithm.  
4 - Chrominance filter. Interpolates the values of missing pixels based on chrominance gradients.     


Return Values


S_OK  
Success  
E_FAIL  
Failure.  

Example


This VB example activates the bilinear Bayer filter:

ActiveGige1.Bayer = 1
 

Remarks


Bayer images are usually generated by a single-chip CCD camera, which has a color filter mosaic array (CFA) installed in front of the sensor. The most frequently used Bayer pattern has the following layout:

G B G B R    
R G R G R
G B G B G
R G R G R

Each pixel value in a Bayer image corresponds to the intensity of the pixel behind the corresponding color filter. The conversion from such a grayscale image to RGB image is typically done on the camera itself, however some cameras (known as Bayer cameras) output a raw Bayer image unchanged. The Bayer transforms such an image into RGB image by performing real-time Bayer color reconstruction (demosaicing). The layout of the Bayer array is defined by the current Format.

Note that the higher the ordinal number of the selected Bayer filter is, the higher the quality of the resulting image is and the higher the CPU load is. If the application speed is critical, consider using the Nearest Neighbour filter.