BkgCorrect
Top  Previous  Next

Description

Returns or sets the mode for the background correction. The values from 0 to 2 correspond to the following modes:

0 - None  
No background correction is performed.  
1 - Dark  
The dark field (offset) background correction is applied to each acquired frame.  
2 - Flat  
The flat field (gain) background correction is applied to each acquired frame.  
 
Syntax

[VB]
objActiveGeni.BkgCorrect [ = Value ] 


[C/C++]
HRESULT get_BkgCorrect( short *pCorrect );
HRESULT put_BkgCorrect( short Correct );



Data Types
[VB]

Integer

Parameters
[C/C++]

pCorrect [out,retval]  
Pointer to the current background correction mode  
Correct [in]  
Background correction mode to be set  
 
 
Return Values

S_OK  
Success  
 

Example


The following VB example sets the dark field correction mode:

ActiveGeni1.BkgCorrect=1


Remarks


The dark field (offset) correction is used to compensate for the pixel-to-pixel difference in the dark current of the camera sensor. The correction is performed by subtracting background pixel values from corresponding pixel values of the original image. The dark field correction requires the dark field background image for the current video mode to have been stored on the hard drive.

The flat field (gain) correction is used to compensate for the variations in pixel-to-pixel sensitivity as well as non-uniformity of the illumination. The correction algorithm is based on the following formula:

bkcorrect
where

Ix,y    is a pixel value of the original image
Bx,y    is a pixel value of the dark field image
Wx,y    is a pixel value of the bright field image
Wmax    is a maximum value of the bright field image
Cx,y    is a new pixel value of the corrected image

The flat field correction requires the bright field background image for the current video mode to have been stored on the hard drive. If the dark field image for the currently selected video mode does not exist on the hard drive, the value of 0 will be used in place of B.

If corresponding background images are not found on the hard drive, no correction will be performed. See SaveBkg for more details on preparing and saving background data.