62
Operational Reference
Genie Monochrome Series-GigE Vision Camera
Flat Field (Image Shading) Correction
Image Shading correction, also known as Flat Field Correction is the process of eliminating small gain differences
between pixels in a sensor, eliminate sensor hotspots by automatically doing pixel replacement, and also to
compensate for light distortion caused by a lens. That sensor when exposed to a uniformly lit field will have no gray
level differences between pixels when calibrated flat field correction is applied to the image. The Genie camera
stores flat field correction data until power off or in its user setting state for recall at any time (see "Power-up
Configuration" on page 32). Flat field correction data is composed of 8 bit gain and 8 bit offset coefficients.
The CamExpert Flat Field Correction tool (or Sapera Flat Field Demo) allows calibrating. saving, and loading the
flat field calibration data for any Genie camera being controlled.
Information on the Flat Field Data File
A Sapera application (such as CamExpert) creates a new SapBuffer object of the same width as the image buffer but
with twice the number of lines. This provides the room to store both offset and gain Flat Field data. The Flat Field
offset data is contained in the top half of the new buffer, while the gain buffer is in the bottom half.
A Sapera application saves the new buffer using SapBuffer::Save with the "-format tiff" option, which allows
saving both 8-bit and 10-bit offset/gain data without loss of significant bits.
The Flat Field correction formula is:
correctedPixelValue = (originalPixelValue - offset) * (gain/128)
Note: If the offset data = 0xff, then that is a special flag, indicating that the pixel is replaced with an adjacent pixel,
without any calculation. The Flat Field calibration procedure using Sapera tools as described in this section, will
eliminate dead or hot pixels. A pixel on the left edge (beginning of the line) would be replaced with the pixel to its
right, while a pixel on the right edge (end of the line) is replaced with the pixel to its left. Any pixel within a line is
replaced with the average of the its neighboring pixels (on the same line).
Important:
During calibration, no other Genie features should be accessed or modified. The calibration process
will disable functions such as image crop or flip setting. These features need to be re-enabled by the application or
user only after the flat field calibration completes.
Important:
Before calibration, the Genie should be powered on long enough to achieve its nominal temperature.
A metallic camera mount or a low ambient temperature may increase the time required for the Genie to reach a
stable internal temperature.
Set up Dark and Bright Acquisitions with the Histogram Tool
Before performing calibration, verify Genie acquisition with a live grab. Also at this time make preparations to grab
a flat light gray level image, required for the calibration, such as a clean evenly lighted white wall or non-glossy
paper with the lens slightly out of focus. Ideally a controlled diffused light source aimed directly at the lens should
be used. Note the lens iris position for a bright but not saturated image. Additionally check that the lens iris closes
well or have a lens cover to grab the dark calibration image.
Verify a Dark Acquisition
Close the camera lens iris and cover the lens with a lens cap. Using CamExpert, click on the grab button and then
the histogram button. The following figure shows a typical histogram for a Genie grabbing a very dark image.