USB 2.0 USB 3.x GigE |
USB 2.0 USB 3.x GigE |
Syntax
INT is_Blacklevel(HIDS hCam, UINT nCommand, void* pParam, UINT cbSizeOfParam)
Description
is_Blacklevel() controls the black level correction of the camera which might improve the image quality under certain circumstances. By default, the sensor adjusts the black level value for each pixel automatically. If the environment is very bright, it can be necessary to adjust the black level manually.
Fig. 195: Black level correction - Auto
Fig. 196: Black level correction - Auto + offset
Fig. 197: Black level correction with offset only
The nCommand input parameter is used to select the function mode. The pParam input parameter depends on the selected function mode. If you select functions for setting or returning a value, pParam contains a pointer to a variable of the UINT type. The size of the memory area to which pParam refers is specified in the cbSizeOfParam input parameter.
Input parameters
hCam |
Camera handle |
pParam |
Pointer to a function parameter, whose function depends on nCommand. |
cbSizeOfParam |
Size (in bytes) of the memory area to which pParam refers. |
Return values
IS_INVALID_PARAMETER |
One of the submitted parameters is outside the valid range or is not supported for this sensor or is not available in this mode. |
IS_NO_SUCCESS |
General error message |
IS_NOT_SUPPORTED |
The camera model used here does not support this function or setting. |
IS_SUCCESS |
Function executed successfully |
INT nBlacklevelCaps;
nRet = is_Blacklevel(hCam, IS_BLACKLEVEL_CMD_GET_CAPS,
(void*)&nBlacklevelCaps, sizeof(nBlacklevelCaps));
if (nRet == IS_SUCCESS) {
// The user can changed the state of the auto blacklevel
BOOL bSetAutoBlacklevel = (nBlacklevelCaps & IS_BLACKLEVEL_CAP_SET_AUTO_BLACKLEVEL) != 0;
// The user can change the offset
BOOL bSetBlacklevelOffset = (nBlacklevelCaps & IS_BLACKLEVEL_CAP_SET_OFFSET) != 0;
}
INT nMode = IS_AUTO_BLACKLEVEL_OFF;
// Get default blacklevel mode
INT nRet = is_Blacklevel(hCam, IS_BLACKLEVEL_CMD_GET_MODE_DEFAULT, (void*)&nMode, sizeof(nMode));
// Get current blacklevel mode
nRet = is_Blacklevel(hCam, IS_BLACKLEVEL_CMD_GET_MODE, (void*)&nMode, sizeof(nMode));
// Set new mode (enable auto blacklevel)
nMode = IS_AUTO_BLACKLEVEL_ON;
nRet = is_Blacklevel(hCam, IS_BLACKLEVEL_CMD_SET_MODE, (void*)&nMode , sizeof(nMode ));
INT nOffset = 0;
// Get default blacklevel offset
INT nRet = is_Blacklevel(hCam, IS_BLACKLEVEL_CMD_GET_OFFSET_DEFAULT,
(void*)&nOffset, sizeof(nOffset));
// Get offset range
IS_RANGE_S32 nRange;
nRet = is_Blacklevel(hCam, IS_BLACKLEVEL_CMD_GET_OFFSET_RANGE, (void*)&nRange, sizeof(nRange));
INT nOffsetMin = nRange.s32Min;
INT nOffsetMax = nRange.s32Max;
INT nOffsetInc = nRange.s32Inc;
// Get current blacklevel offset
nRet = is_Blacklevel(hCam, IS_BLACKLEVEL_CMD_GET_OFFSET, (void*)&nOffset, sizeof(nOffset));
// Set new offset
nOffset = 100;
nRet = is_Blacklevel(hCam, IS_BLACKLEVEL_CMD_SET_OFFSET, (void*)&nOffset, sizeof(nOffset));