Demo Headboard Tuning Plug-in

 

Introduction

The Demo Headboard Tuning tool is used to program a sensor headboard's EEPROM with Lens Shading Correct (LSC) coefficients to ensure image quality. The resulting settings are also stored in an INI file.

The Demo Headboard Tuning tool is implemented as a "Plug-in" for use with internal and external versions of DevWare.

It is assumed that the reader of this document already has working knowledge of DevWare and the general concept of LSCs.

Note: This plug-in is only valid for Aptina parts that support on-chip LSC, and it will only appear as a DevWare "Plug-ins" option when those parts are present.

If assistance is needed, contact John Medalen at 408-660-2273 (jmedalen@aptina.com).

Demo Headboard Tuning Tool Startup

Once a good image is shown in DevWare, the Demo Headboard Tuning tool can be started. To launch it, select "Demo Headboard Tuning" from the "Plug-ins" menu item (see Image #1):

Usage

Lens Calibration is used to describe the process of generating lens shading correction (LSC) coefficients (see Image #2). The resulting settings can then be loaded in the EEPROM and/or stored in a file.

The Lens Calibration process is fully automated via the tool, but each step can be run individually if desired, but in most cases this is not necessary.

The following presents the most common setup and usage of the Demo Headboard Tuning tool.

Step 1 – Setup

It is assumed that the correct light source has been selected and a suitable enclosure provided (both are usually supplied as a purchased "light box").

Position the color neutral object target (usually a white-colored board) and the sensor in the enclosure.

Step 2 – Select a target Directory to store the LSC settings file (optional)

If it is desired to save the generated LSC settings in to a file, then a target Directory needs to be established. You only need to do this once. The software will remember the directory for future sessions. If you do not enter a directory this step will be skipped.

Select the Browse button in Control Box 4 to open the directory dialog. Navigate to the desired directory and select "OK".

At this point, the Step 4 Status Indicator should go from red to gray. Note that status message next to the Save to File button should go from "Error: The directory does not exist" to "Not done yet".

Step 3 – Set Lens Calibration Parameters (optional)

If required for the given sensor and lens, there are two calibration parameters that can be adjusted, both of which are in Control Box 3.

The Allow Falloff to pull-down can be used to adjust the Falloff. Select the appropriate value.

The Good Color Uniformity is less than field can be set as a threshold to indicate that Color Uniformity was achieved. If another value is appropriate, enter it in the data box. Note that incorrect values will turn its Step status indicator to yellow.

Step 4 – Start the LC process

To start the LC process, select the Run All Steps button. As the process progresses, each Control Box Step status indicator will go from gray to blue to green.

Once Control Box 5 Step status indicator turns to green, the LSC has been programmed in to the EEPROM with the standard label of "FACTORY".

Step 5 – Verify success

If each Step status indicator is green (Step 4 will be gray if it was not enabled) the LSC is correct. If you want to visually verify the LSC, exit DevWare, unplug and plug in the sensor, and restart DevWare.
If the Color Uniformity indicator is yellow or red, see section Color Uniformity Failures and Possible Remedies, below.

At this point, the process is complete; exit DevWare, unplug the sensor and plug in the next sensor, restart DevWare, re-launch the tool, and start over at Step 1.

For additional Lens Calibration usage please refer to the following section.

Additional Notes

To stop the process at any time, press the Start Over button.

To manually run this process, select Control Box button individually but in their presented order.

Lens Calibration - Advanced Usage

The following describes various advanced features of Lens Calibration

 

To use any of the advanced features, first re-initialize the sensor by selecting the Init menu item. This will reset the sensor and apply the default settings. It will also load the LSC that was just programmed into the EEPROM.

Color Uniformity Failures and Possible Remedies

The Color Uniformity indicator objectively evaluates the lens shading correction using a mathematical formula calibrated to human image quality perception. The lower the value, the better the image quality is. A value of 2.0 or less represents no loss of image quality. If the value is 2.0 or less then the indicator will be green. If the value is more than 2.0 but less than 3.0 the indicator will be yellow, and a value of 3.0 or more the indicator will be red. In those cases something may have gone wrong with the calibration and the source of the problem should be investigated. The problem area(s) will be highlighted with a red square. See Image #4 for an example.

 

Possible causes and resolutions of Color Uniformity failures are:

  • Dust on the sensor; this will be indicated by one or several randomly situated red square. It may be possible to clean the sensor and run Lens Calibration again.
  • The lens may be misaligned; this will be indicated by red squares situated on a single edge of the display.  In some cases the lens can be adjusted.
  • Good Color Uniformity is less than value may be too low for the given sensor; this will be indicated by red squares covering most of the image. Note that a value of 2.00 is based on evaluation and measurement of human perception to image quality, so increasing this value may resolve the Color Uniformity error but will result in overall lower image quality.

Note:      The LSC setting will be saved to the EEPROM and the file regardless of the Color Uniformity result

  

Evaluate the LSC solution

A subjective method to evaluate the effectiveness of the LSC solution is to view the image. With LC enabled, the color should be uniform across the entire image. Disable LC by selecting the Disable LC button; the color should now appear non-uniform. Enable LC by selecting the same button again, now labeled Enable LC.

Another subjective method to evaluate the effectiveness of the LSC solution is to use the Analysis Graph.

  • Display the Analysis Graph by selecting the Show Graph button.
  • Set the Analysis Graph type by selecting Row from the "Mouse Selection" box, and then within the image display set the Analysis Graph location so it is in the center of the image.
  • Select Cumulative Intensity in the Analysis Graph and observe that the displayed lines of red, green, and blue are flat and uniform (see Image #3; "Analysis Graph").
  • To observe what happens when LC is not enabled, select the Disable LC button. The Analysis Graph will now display lines that are uneven and non-uniform (see Image #5).

 

Name of file containing the LSC settings

If saving of the Lens Calibration to a file was enabled, the name of the file can be found next to the Save to File button in Control Box 4. The file name is generated by using the sensor's part number and revision.

 

Lens Calibration – INI file Notes

Note: This section is targeted for Aptina Application Engineers only.

Required Preset

The Demo Headboard Tuning Tool expects the sensor's INI file to have a preset named "Lens Calibration Setup". This preset is used by the tool to configure the sensor before it continues with the lens calibration process.
The tool needs uncorrected Bayer data for the calibration, and corrected data for the color uniformity test. Most SOCs have a Bypass-with-LC mode that can be used for both. The "Lens Calibration Setup" preset puts the SOC is Bypass-with-LC mode with LC off. The tool does the calibration and then turns on the PGA enable bit for the color uniformity test, which it knows how to do.
Some SOCs (0367 and 1040, for example) don't have Bypass-with-LC mode. In that case Lens Calibration Setup puts it in regular Bypass mode, and there is another preset called "Lens Calibration Verify" that puts it in a mode suitable for the color uniformity test, usually normal SOC non-bypass mode.
"Lens Calibration Setup" on an SOC has to ensure all auto functions are off so that the integration time and analog gain registers can be written from the host. Often that means pausing or stopping the firmware altogether.
For a VGA part Lens Calibration Setup should put it in full resolution Bypass mode.

Option Settings

Some of the Demo Headboard Tuning Tool's settings can be configured within the "Lens Calibration Setup" preset.
OPTION= LensAssist Dir, "directory path" // note the quotes are required
OPTION= LensAssist Falloff for <sensor_name>, <value>// Falloff value
OPTION= LensAssist GoodCU for <sensor_name>, <value> // Color Uniformity threshold * 1000
OPTION= LensAssist Left Temp for < sensor_name>, <value> // APGA parts only
OPTION= LensAssist Mid Temp for < sensor_name>, <value> // APGA parts only
OPTION= LensAssist Right Temp for < sensor_name>, <value> // APGA parts only
The <sensor_name> must match the "Name" field from the sdat file (shown at the top of the left-hand Info panel in DevWare, as "Sensor").