![]() |
SK91GigE-WIN
5.5.2
|
Explanations about gain and offset control. More...
Functions | |
int | SK_SETGAIN (int CamID, int gain, int channel) |
Gain control. More... | |
int | SK_SETOFFSET (int CamID, int offset, int channel) |
Offset control. More... | |
int | SK_SETGAINCOUPLING (int CamID, int enable) |
Coupling of gain channels. More... | |
int | SK_GETGAIN (int CamID, int channel) |
Returns the current gain value of a ADC channel. More... | |
int | SK_GETOFFSET (int CamID, int channel) |
Returns the current offset value (black level) for the defined ADC channel. More... | |
int | SK_GETNROFCHANNELS (int CamID) |
Returns the camera specific number of ADC channels. More... | |
Explanations about gain and offset control.
The number of channels for gain and offset is sensor specific and depends on the number of ADCs inside of the camera. The number of channels is returned by the function SK_GETNROFCHANNELS. The setting range for gain is 0 to 1023 (0 db to 24 db), the offset setting range is 0 to 255.
Note: Too low gain values (< 80) can reduce the signal dynamic by limiting the input range of the ADC. Very high gain values increase the noise.
Normally, to re-adjust the gain / offset setting use the SKLineScan program with the manual for SKLineScan.
If this is not possible, here is an example to display the oscilloscope signal with the library OpenCV:
1. Offset (using the SK2048GPD)
The zero baselines of the video signal 1 and 2 must be adjusted and balanced. To do this, totally block the incident light and execute the function SK_SETOFFSET(m_CamID, 0, 0) and SK_SETOFFSET(m_CamID, 1, 0).
Minimize any differences using the function SK_SETOFFSET.
A slight signal noise should be visible in the zero baseline.
2. Gain (using SK2048GPD)
Illuminate the sensor with a slight over exposure to identify the maximum clipping. Use the function SK_SETGAIN(m_CamID, 0, XX) (XX = gain value) to adjust the maximum output voltage for the first channel. Adjust the signal intensity with the function SK_SETGAIN(m_CamID, 1, XX) (XX = gain value) to minimize the difference between channels 0 and 1.
Notes for gain adjustment:
int SK_GETGAIN | ( | int | CamID, |
int | channel | ||
) |
Returns the current gain value of a ADC channel.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
channel | ADC channel |
int SK_GETNROFCHANNELS | ( | int | CamID | ) |
Returns the camera specific number of ADC channels.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
int SK_GETOFFSET | ( | int | CamID, |
int | channel | ||
) |
Returns the current offset value (black level) for the defined ADC channel.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
channel | ADC channel |
int SK_SETGAIN | ( | int | CamID, |
int | gain, | ||
int | channel | ||
) |
Gain control.
This function sets the gain value for the defined ADC channel.
The number of ADC channels is camera specific and can be inquire by SK_GETNROFCHANNELS or the camera manual.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
gain | gain value |
channel | ADC Channel |
int SK_SETGAINCOUPLING | ( | int | CamID, |
int | enable | ||
) |
Coupling of gain channels.
This function is suitable for cameras with more than one ADC channel. Once adjusted, all gain channels can be coupled and will be controlled together by channel 0 only. The differences between the channels before coupling are changed proportionally.
enable
= true this function is usable for a very fast changes of gain adjustment.CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
enable | 1 = gain coupling is active 0 = gain coupling is not active |
int SK_SETOFFSET | ( | int | CamID, |
int | offset, | ||
int | channel | ||
) |
Offset control.
This function sets the offset value for the defined ADC channel.
The number of ADC channels is camera specific and can be inquire by SK_GETNROFCHANNELS or the camera manual.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
offset | Offset value |
channel | ADC channel |