| Home > C: Programming > Function descriptions > | History back Previous chapter Next chapter Print |
is_HotPixel |
|
uEye Camera Manual Version 4.00
|
|
USB 2.0 USB 3.0 GigE |
USB 2.0 USB 3.0 GigE |
Syntax
INT is_HotPixel (HIDS hCam, UINT nCommand, void* pParam, UINT nSizeOfParam)
Description
is_HotPixel() configures the correction of sensor hot pixels. The correction is performed by the software. The hot pixel list is stored in the camera's non-volatile EEPROM. Some sensor models can also correct hot pixels directly in the sensor.
For further information on hot pixel correction, please refer to Basics: Hot pixels.
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 nSizeOfParam input parameter.
|
|
|
|
Input parameters
hCam |
Camera handle |
||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||
pParam |
Pointer to a function parameter, whose function depends on nCommand. |
||||||||||||||||||||||||||||||||||||||||||||||||
nSizeOfParam |
Size (in bytes) of the memory area to which pParam refers. |
||||||||||||||||||||||||||||||||||||||||||||||||
Return values
IS_CANT_COMMUNICATE_WITH_DRIVER |
Communication with the driver failed because no driver has been loaded. |
IS_CANT_OPEN_DEVICE |
An attempt to initialize or select the camera failed (no camera connected or initialization error). |
IS_INVALID_CAMERA_TYPE |
The camera type defined in the .ini file does not match the current camera model. |
IS_INVALID_CAMERA_HANDLE |
Invalid camera handle |
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_IO_REQUEST_FAILED |
An IO request from the uEye driver failed. Possibly the versions of the ueye_api.dll (API) and the driver file (ueye_usb.sys or ueye_eth.sys) do not match. |
IS_NO_SUCCESS |
General error message |
IS_NOT_CALIBRATED |
The camera does not contain any calibration data. |
IS_NOT_SUPPORTED |
The camera model used here does not support this function or setting. |
IS_NULL_POINTER |
Invalid array |
IS_OUT_OF_MEMORY |
No memory could be allocated. |
IS_SUCCESS |
Function executed successfully |
IS_TIMED_OUT |
A timeout occurred. An image capturing process could not be terminated within the allowable period. |
// Enable/disable correction
INT nRet = is_HotPixel(hCam, IS_HOTPIXEL_DISABLE_CORRECTION, NULL, NULL);
nRet = is_HotPixel(hCam, IS_HOTPIXEL_ENABLE_CAMERA_CORRECTION, NULL, NULL);
nRet = is_HotPixel(hCam, IS_HOTPIXEL_ENABLE_SOFTWARE_USER_CORRECTION, NULL, NULL);
nRet = is_HotPixel(hCam, IS_HOTPIXEL_ENABLE_SENSOR_CORRECTION, NULL, NULL);
nRet = is_HotPixel(hCam, IS_HOTPIXEL_DISABLE_SENSOR_CORRECTION, NULL, NULL);
// Read out current mode
INT nMode = 0;
INT nRet = is_HotPixel(hCam, IS_HOTPIXEL_GET_CORRECTION_MODE,
(void*)&nMode, sizeof(nMode));
// Query supported modes
INT nRet = is_HotPixel(hCam, IS_HOTPIXEL_GET_SUPPORTED_CORRECTION_MODES,
(void*)&nMode, sizeof(nMode));
// Query user-defined hot pixel list
INT nRet = is_HotPixel(hCam, IS_HOTPIXEL_GET_SOFTWARE_USER_LIST_EXISTS, NULL, NULL);
if (nRet == IS_SUCCESS)
{
// Query the number of hot pixels in the user-defined list
INT nNumber = 0;
nRet = is_HotPixel(hCam, IS_HOTPIXEL_GET_SOFTWARE_USER_LIST_NUMBER,
(void*)&nNumber, sizeof(nNumber));
if (nRet == IS_SUCCESS)
{
// Allocate sufficient memory. Each hot pixel needs two WORDS
// memory space.
// Additional memory space of one WORD per hot pixel is required for numbering.
WORD *pList = new WORD[1 + 2 * nNumber];
nRet = is_HotPixel(hCam, IS_HOTPIXEL_GET_SOFTWARE_USER_LIST,
(void*)pList, (1 + 2 * nNumber) * sizeof(WORD));
// Change a value and save the list.
// The number of the hot pixel has to be specified in pList[0]
pList[1] = 100;
nRet = is_HotPixel(hCam, IS_HOTPIXEL_SET_SOFTWARE_USER_LIST,
(void*)pList, (1 + 2 * nNumber) * sizeof(WORD));
// Delete unneeded list
delete [] pList;
}
}
// Save user-defined list to file
char File1[100];
ZeroMemory(File1, sizeof(File1));
strcpy(File1, "c:\\test.txt");
nRet = is_HotPixel(hCam, IS_HOTPIXEL_LOAD_SOFTWARE_USER_LIST, (void*)File1, 0);
nRet = is_HotPixel(hCam, IS_HOTPIXEL_SAVE_SOFTWARE_USER_LIST, (void*)File1, 0);
// Unicode
wchar_t File2[100];
ZeroMemory(File2, sizeof(File2));
wcscpy(File2, L"c:\\test.txt");
nRet = is_HotPixel(hCam, IS_HOTPIXEL_LOAD_SOFTWARE_USER_LIST_UNICODE, (void*)File2, 0);
nRet = is_HotPixel(hCam, IS_HOTPIXEL_SAVE_SOFTWARE_USER_LIST_UNICODE, (void*)File2, 0);
// Save user-defined list to the camera EEPROM
INT nNumber = 0;
INT nRet = is_HotPixel(hCam, IS_HOTPIXEL_GET_CAMERA_USER_LIST_MAX_NUMBER,
(void*)&nNumber , sizeof(nNumber));
if (nRet == IS_SUCCESS)
{
// Write the maximum number of hot pixels to EEPROM
WORD *pList = new WORD[1 + 2 * nNumber];
pList[0] = nNumber;
for (int i = 0; i < nNumber; i++)
{
pList[1 + 2 * i] = x_value;
pList[2 + 2 * i] = y_value;
}
nRet = is_HotPixel(hCam, IS_HOTPIXEL_SET_CAMERA_USER_LIST,
(void*)pList, (1 + 2 * nNumber) * sizeof(WORD));
delete [] pList;
// Delete user-defined EEPROM list
nRet = is_HotPixel(hCam, IS_HOTPIXEL_DELETE_CAMERA_USER_LIST, NULL, NULL);
}
// Return combined list
INT nNumber = 0;
INT nRet = is_HotPixel(hCam, IS_HOTPIXEL_GET_MERGED_CAMERA_LIST_NUMBER,
(void*)&nNumber , sizeof(nNumber));
if (nRet == IS_SUCCESS)
{
// Allocate sufficient memory. Each hot pixel needs two WORDS
// memory space.
// Additional memory space of one WORD per hot pixel is required for numbering.
WORD *pList = new WORD[1 + 2 * nNumber];
nRet = is_HotPixel(hCam, IS_HOTPIXEL_GET_MERGED_CAMERA_LIST,
(void*)pList, (1 + 2 * nNumber) * sizeof(WORD));
// Delete unneeded list
delete [] pList;
}