Metrologic Instruments IS4910 Series Scanner User Manual


 
23
C
AMERA
S
UPPORT
L
IBRARY
C
AM
L
IB
Automatic Brightness Adjustment APIs
The set of automatic brightness adjustment APIs allows an application to automatically adjust the
camera’s gain and image integration time based on the quality of the previous images.
camAdjustBrightness
This function adjusts the IS4910 camera’s gain and/or image integration time (exposure) based on the
known quality of the last image and the desired correction, in dB, to this quality. The quality of the image
is presented by the number between 0 and 100, with 0 being extremely poor quality and 100 being an
excellent quality.
The flags parameter indicates whether the gain and/or image integration time (exposure) are allowed to
be adjusted, and whether the new values should immediately be applied to the camera or postponed until
and applied upon the next image acquisition. Note that in the snapshot mode adjustment of the image
integration time is not allowed regardless of the flags parameter.
The function calculates the most optimal values of gain and exposure within their allowed ranges, see
functions camSetAutoGainRange_db() and camSetAutoExpoRange() for details.
Prototype:
int camAdjustBrightness (int cam_handle, int cur_quality, float correction_db, unsigned long flags);
Parameters:
cam_handle - [in] handle to the camera device returned by the camOpen function.
cur_quality - [in] quality of the last image, from 0 to 100, or -1 if correction should be done
regardless of the quality of the last image.
correction_db - [in] desired level of brightness correction, in dB.
flags - [in] bit-combinatory value specifying whether the gain and/or image integration
time (exposure) can be adjusted, and whether the new values should immediately
be applied to the camera or postponed until and applied upon the next image
acquisition. The individual bit values are:
CAM_AUTOGAIN, gain can be adjusted
CAM_AUTOEXPO, image integration time can be adjusted
CAM_APPLY_INSTANTLY, new values should be applied immediately
Return Value:
0: Success; -1: Failure
camSetAutoBrightnessControl
This function enables or disables the automatic brightness adjustment. If it is enabled then the IS4910
camera’s gain and/or image integration time (exposure) will be automatically adjusted after each image
acquisition based on the calculated quality of the currently acquired image.