Digital cameras, compared to their analog counterparts, offer greater flexibility in allowing the user to adjust camera settings through acquisition software. In some cases, the settings in analog cameras can be adjusted through hardware such as dual in-line package (DIP) switches or RS-232 connections. Nevertheless, the flexibility of modifying settings through the software greatly adds to increased image quality, speed, and contrast - factors that could mean the difference between observing a defect and missing it altogether. Many digital cameras have on board field-programmable gate arrays (FPGAs) for digital signal processing and camera functions. FPGAs perform the calculations behind many digital camera functions, as well as additional ones such as color interpolation for mosaic filters and simple image processing (in the case of smart cameras). Camera firmware encompasses the FPGA and on board memory; firmware updates are occasionally available for cameras, adding and improving features. The on board memory in digital cameras allows for storage of settings, look up tables, buffering for high transfer rates, and multi-camera networking with ethernet switches. Some of the most common digital camera settings are gain, gamma, area of interest, binning/subsampling, pixel clock, offset, and triggering. Understanding these basic settings will help to achieve the best results for a range of applications.
Gain is a digital camera setting that controls the amplification of the signal from the camera sensor. It should be noted that this amplifies the whole signal, including any associated background noise. Most cameras have automatic gain, or autogain, which is abbreviated as AGC. Some allow the user to turn it off or set it manually.
Gain can be before or after the analog-to-digital converter (ADC). However, it is important to note that gain after the ADC is not true gain, but rather digital gain. Digital gain uses a look up table to map the digital values to other values, losing some information in the process.
Gain before the ADC can be useful for taking full advantage of the bit-depth of the camera in low light conditions, although it is almost always the case that careful lighting is more desirable. Gain can also be used to ensure that the taps of multi-tap sensors are well matched. For a detailed discussion of sensor taps, view Imaging Electronics 101: Camera Resolution for Improved Imaging System Performance. In general, gain should be used only after optimizing the exposure setting, and then only after exposure time is set to its maximum for a given frame rate. To visually see the improvement gain can make in an image, compare Figures 1a, 1b, 2a, and 2b.
Figure 1a: Real-World Image without Gain (AGC = 0), Gamma = 1, 8MHz Pixel Clock, and 0.2ms Exposure
Figure 1b: Close-Up of Image with AGC = 0, Gamma = 1, 8Hz Pixel Clock, and 0.2ms Exposure
Figure 2a: Real-World Image with High Gain (AGC = 100), Gamma = 1, 8MHz Pixel Clock, and 3.4ms Exposure
Figure 2b: Close-Up of Image with AGC = 100, Gamma = 1, 8MHz Pixel Clock, and 3.4ms Exposure
Gamma is a digital camera setting that controls the grayscale reproduced on the image. An image gamma of unity (Figures 3a - 3b) indicates that the camera sensor is precisely reproducing the object grayscale (linear response). A gamma setting much greater than unity results in a silhouetted image in black and white (Figures 4a – 4b). In Figure 4b, notice the decreased contrast compared to Figure 3b. Gamma can be thought of as the ability to stretch one side (either black or white) of the dynamic range of the pixel. This control is often used in signal processing to raise the signal-to-noise ratio (SNR).
Figure 3a: Real-World Image with Gamma Equal to Unity (Gamma = 1), 10MHz Pixel Clock, and 5ms Exposure
Figure 3b: Close-Up of Image with Gamma = 1, 10MHz Pixel Clock, and 5ms Exposure
Figure 4a: Real-World Image with Gamma Greater than Unity (Gamma = 2), 10MHz Pixel Clock, and 5ms Exposure
Figure 4b: Close-Up of Image with Gamma = 2, 10MH Pixel Clock, and 5ms Exposure