Gain (Level)
Auto-gain Modes
| Value | Mode |
|---|---|
| 0 | NONE (MANUAL GAIN) |
| 1 | LINEAR_1 |
| 2 | LINEAR_2 |
| 3 | CLAHE (ELAP) |
| 4 | CDF_1 |
| 5 | CDF_2 |
CIGI Control
| Field Name | Description |
|---|---|
| Component Class | SensorV3 (3) |
| Instance ID | Weapon ID |
| Component ID | SENSOR_AGC_TYPE (27) |
| Component State | 0-5 |
ICD Data
_pHost2Pcnova->w2ig[].autoGain
Description and Examples
LINEAR_1 and LINEAR_2
With linear auto-gain, there is a constant term (level) and a linear term (gain) that are used to stretch the raw sensor scene contrast linearly between min (e.g. 0) and max (e.g. 1.0 or 255) brightness, from the measured min/max of the raw signal. Linear auto-gain is intended to replicate how old analog sensors implemented AGC by controlling the amplification within the sensor array itself. LINEAR_1 and LINEAR_2 only differ in those min/max values which are specified in the sensorhost config file, so users can set them up however they want. Modern digital sensors should probably use one of the other auto-gain modes.


CLAHE (ELAP)
CLAHE is our rendition of ELAP. More info here: https://en.wikipedia.org/wiki/Adaptive_histogram_equalization#Contrast_Limited_AHE
CLAHE does two things different from a basic linear histogram equalization algorithm.
- Instead of calculating just one full image histogram, the histogram is calculated on a small region around each pixel (e.g. 24 x 24).
- A clipping level is applied to this histogram to prevent too many pixels to reside in one bin. Any excess in a histogram bin above the clipping level is cut and equally redistributed to all the bins in the histogram.
The pixel’s new intensity is the summation of the histogram bins from 0 to original pixel intensity value.


CDF_1 and CDF_2
The CDF modes compute a histogram and then derive a Cumulative Density Function (CDF) from the histogram, which is used to non-linearly stretch contrast between the desired min/max values, and also apply a gamma exponent for enhanced perception. CDF_1 and CDF_2 are the same algorithm, but CDF_2 uses a different exponent that biases more towards white. You can specify the desired min/max in and also how much of the “tails” of the histogram to exclude from the CDF (to reduce noise-induced flashing) in the sensorhost config file.




Pseudo-color IR using row=0 and threshold=0.35