![]() |
SK91USB3-LX
1.2.0
|
This page describes the functions for Shading Correction or the look-up-table function. More...
Functions | |
int | SK_SETSCM (int CamID, void *pData, int bitDepth, int bytesPerLine, int linesPerImage, int relMin, int relMax) |
Acquires new reference profile. More... | |
unsigned short * | SK_GETSCMPTR (int CamID) |
Returns the pointer to the SCM buffer inside of DLL. More... | |
int | SK_SCMTOFLASH (int CamID) |
Writes the correction profile from the SCM into the camera flash memory. More... | |
int | SK_FLASHTOSCM (int CamID) |
Loads the shading correction profile from the camera flash memory into the SCM. More... | |
int | SK_SHADCORR (int CamID, bool ON) |
Activates and deactivates the shading correction. More... | |
int | SK_SAVESCM (int CamID, const char *fileName) |
Saves the current SCM (Shading Correction Memory) to a file. More... | |
int | SK_LOADSCM (int CamID, const char *fileName, unsigned short *pData) |
Loads a shading correction profile into the SCM from a file, or from a buffer. More... | |
int | SK_SCMTOVIDEO (int CamID, bool ON) |
Outputs the programmed Shading Correction Memory as camera signal. More... | |
int | SK_READSCM (int CamID, int flashID) |
Reads the stored shading correction profile from camera flash memory into the volatile SCM. More... | |
int | SK_LENSVIGNETTINGCORR (int CamID, double FocalLength, double SensorLength, double FOV) |
Correction of natural lens vignetting using Shading Correction function. More... | |
int | SK_SETLUT (int CamID, unsigned short opMode, double param) |
Calculates a pixel transformation function and writes it into the lookup table (LUT) inside the camera. More... | |
int | SK_LUTTOFLASH2 (int CamID) |
Writes the Lookup Table from the LUT memory into the camera flash memory. More... | |
int | SK_FLASH2TOLUT (int CamID) |
Loads the look up table from the camera flash memory into the LUT memory. More... | |
int | SK_LUTCORR (int CamID, bool ON) |
Activates and deactivates the LUT (look up table) correction. More... | |
int | SK_GETLUTSTATUS (int CamID, unsigned short *opMode, double *param) |
Returns LUT status of camera. More... | |
This page describes the functions for Shading Correction or the look-up-table function.
Shading Correction compensates for non-uniform illumination, lens vignetting as well as any differences in pixel sensitivity. The signal from a white homogeneous background is obtained and used as a reference to correct each pixel of the sensor with an individual factor, scaled up to an programmable unitary intensity level to provide a flat signal. The reference signal is stored in the SCM (Shading Correction Memory) of the camera and subsequent scans are normalized using the scale factors from this white reference.
If Shading Correction is active at shutdown, the camera will load the stored reference signal from the flash into the SCM at the next start. If the load process completes then the Shading Correction is active.
Use a homogeneous white object for the acquisition of a reference. The reference can be a grabbed 2-dimensional scan about a determined number of lines (call this function from an Area Scan - recommended) or a line signal which was averaged over a number of single line scans. During the image acquisition the white object should be moved to suppress influences of surface structures.
The Lookup Table (LUT) is a pre-processing inside the camera. By programming a transformation function, brightness values of the camera are converted to other values. The transformation of image data can be useful to get better imaging results, e.g. more contrast or higher dynamic. This version supports Gamma Correction (convex: gamma > 1.0, concave: gamma < 1.0), and Linear Function with factor. The Linear LUT with factor 1.0 provides the unchanged image data.
int SK_FLASH2TOLUT | ( | int | CamID | ) |
Loads the look up table from the camera flash memory into the LUT memory.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
int SK_FLASHTOSCM | ( | int | CamID | ) |
Loads the shading correction profile from the camera flash memory into the SCM.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
int SK_GETLUTSTATUS | ( | int | CamID, |
unsigned short * | opMode, | ||
double * | param | ||
) |
Returns LUT status of camera.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera | |
[out] | opMode | LUT type |
[out] | param | parameter |
unsigned short* SK_GETSCMPTR | ( | int | CamID | ) |
Returns the pointer to the SCM buffer inside of DLL.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
int SK_LENSVIGNETTINGCORR | ( | int | CamID, |
double | FocalLength, | ||
double | SensorLength, | ||
double | FOV | ||
) |
Correction of natural lens vignetting using Shading Correction function.
This function calculates the natural lens profile and corrects it. The edge intensities are increased, e.g. the lower the focal length value the higher the corrected intensity.
This function doesn't need any reference image of a white object.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
FocalLength | focal length of used lens in millimeters (mm) |
SensorLength | length of sensor in millimeters (mm) |
FOV | field of view in millimeters (mm) |
int SK_LOADSCM | ( | int | CamID, |
const char * | fileName, | ||
unsigned short * | pData | ||
) |
Loads a shading correction profile into the SCM from a file, or from a buffer.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
fileName | name of a file which contains valid SCM data, must be NULL if pData is the source of SCM data. |
pData | pointer to a user managed buffer which contains valid SCM data in a 12 bit format. |
int SK_LUTCORR | ( | int | CamID, |
bool | ON | ||
) |
Activates and deactivates the LUT (look up table) correction.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
ON | true = LUT is active false = no pixel conversion |
int SK_LUTTOFLASH2 | ( | int | CamID | ) |
Writes the Lookup Table from the LUT memory into the camera flash memory.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
int SK_READSCM | ( | int | CamID, |
int | flashID | ||
) |
Reads the stored shading correction profile from camera flash memory into the volatile SCM.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
flashID | 0 (default) = Shading Correction Memory 1 = LUT Memory |
int SK_SAVESCM | ( | int | CamID, |
const char * | fileName | ||
) |
Saves the current SCM (Shading Correction Memory) to a file.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
fileName | file name as string |
int SK_SCMTOFLASH | ( | int | CamID | ) |
Writes the correction profile from the SCM into the camera flash memory.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
int SK_SCMTOVIDEO | ( | int | CamID, |
bool | ON | ||
) |
Outputs the programmed Shading Correction Memory as camera signal.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
ON | true = the output camera signal is the content of SCM. false = the output is the sensor signal. |
int SK_SETLUT | ( | int | CamID, |
unsigned short | opMode, | ||
double | param | ||
) |
Calculates a pixel transformation function and writes it into the lookup table (LUT) inside the camera.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
opMode | 0 = linear 1 = gamma |
param | linear: factor gamma: exponent 1/gamma |
int SK_SETSCM | ( | int | CamID, |
void * | pData, | ||
int | bitDepth, | ||
int | bytesPerLine, | ||
int | linesPerImage, | ||
int | relMin, | ||
int | relMax | ||
) |
Acquires new reference profile.
This function calculates a new reference profile for shading correction and stores it into the shading correction memory (SCM).
With pData = nullptr, a new reference image is acquired by this function itself. If pData is a valid pointer, the correction profile will be calculated by pixel wise averaging of this image data.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
pData | pointer to a reference image, nullptr = grab new image |
bitDepth | bit depth, if a reference image is given, else 12 bit is used |
bytesPerLine | number of bytes per line |
linesPerImage | number of lines of the reference image, given or to acquire |
relMin | in % (percent) of absolute maximum, e.g. relMin = 10, at 8 bit minimum = 25, at 12 bit minimum = 409 the algorithm uses only pixels with higher intensity than minimum, pixels with lower intensity will be unchanged |
relMax | in % (percent) of absolute maximum, e.g. relMax = 90, at 8 bit maximum = 230, at 12 bit maximum = 3686 the algorithm scales each pixel to maximum, the result is a flat profile at maximum If relMax is 0, the scaled maximum will be equal to the signal maximum. |
int SK_SHADCORR | ( | int | CamID, |
bool | ON | ||
) |
Activates and deactivates the shading correction.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
ON | true = shading correction active false = shading correction OFF |