lens calibration tool

The Lens calibration tool supports two modes: mathematical model based calibration and measurement based calibration.

Measurement based lens calibration

Check Calibration Lens to enable measurement based calibration. This mode allows the user to capture a set of images and use the information to create a text file.

Hardware/environment

Computer with two monitors with each monitor on a separate table are required, one is for displaying target images and the other is for Devware operations. Two tables should be used in order to minimize the table vibration during image capturing. The vibration needs to be less than 1 pixel in the sensor.
Other hardware includes Demo2 system with fine adjustment for height control and SOC 360 or MI360 with a wide angle lens mount.
The key issues to consider are [1]:
The monitor must be normal to the optical bench (no tilt)
The camera must be parallel to the monitor
An accurate measurement of the optical center of the lens is very important; the Cross-Hair image target can be used for this purpose.
An accurate flat-fielding of the image, make sure the experiment setup is not touched during image capturing.
The illumination of the room can be controlled ( lights need to be turned off during data collections)

Workflow

Specify the directory under which captured images will be stored in the edit box next to Images button. Or click Images button to browse to the target location. Enter Lens Name, and it will affect names of all captured images (ex: Largan).
Four target images are provided in this process:
crossHairWithLensFallOff_9Rings.bmp; captured image crossHairImage_largan.bmp
radialRingsWithLensFallOff_9Rings.bmp; captured image targetImage_largan.bmp
flatFieldWithLensFallOff_9Rings.bmp; captured image ffImage_largan.bmp
In this mode, seven steps are required in order to complete the procedure.

  1. Click on Load Crosshair Target button, the cross-hair target image will be displayed on one of the monitors, double click to maximize the image.
  2. Adjust lens focus; adjust camera height so that the image of the crosshairs shows up as straight lines at the center (co-ordinates [319,239]) of the Devware display. If it is not possible to adjust the camera so that the straight –lines line up the center of the display, then the optical center of the lens is not at the center of the sensor. Record the values of the horizontal and vertical co-ordinates where the cross-hair lines are straight (from Devware) and enter them in the Horizontal and Vertical edit boxes respectively, click on Capture Crosshair Target button.
  3. Click on Load Flatfield Target button, double click to maximize the image.
  4. Adjust Devware gains and exposure so that the average intensity in the image is around 200 digital counts and no part of the image is saturated. To check the average digital count, draw a graph through a column / row near the center of the image. Make sure aperture correction is disabled in Devware. Click on Capture Flatfield Target button.
  5. Click on Load Scene Target button, double click to maximize the image
  6. Click on Capture Scene Target button.
  7. Click on Calibrate Button to initiate the distortion measurements.

Please note all the finished steps will get checked so the user does not have to do it again. If all the required images have already been captured before and stored at the specified location, you can directly go to step 7.





Example of an image of the cross-hair target, notice that the lines should be straight enough. See figure 2 (step 2).

Fig. 2 Captured crosshair target

Figure 3 is an example of captured flat-field image (step 4).
Fig. 3 Captured flat field image















Figure 4 shows an example of the calibration target image captured by an wide angle lens (step 6).

Fig. 4 Captured calibration target image














Notice
A grid line image may be used to locate the optical center of the lens. Find the point where both the horizontal and vertical line straight up and enter their coordinates to Horizontal and Vertical edit boxes respectively. Other steps are the same, instead of maximizing the flat-field image and the calibration target image display window; you may need to resize and move the window so that the tiny dot in the center of the image should be positioned at the optical center of the lens.








Fig. 5 Grid Line image














Mathematical model based lens calibration

A simplified mathematical model is introduced to simulate lens distortion. Given scene radius rScene, β parameter, focal length and pixel size, sensor radius can be computed as following:





Click Model Based Calibration radio box and … button, in Model Based Calibration dialog box, enter required information, and then click Apply, the generated lens model will be plotted in the distortion curve graph on Lens Calibration Tool page.

Load lens data from a different source

You may import lens calibration data from an outside text file which may have been saved earlier. The Distortion Correction tool comes with default settings for certain lenses, and the files can be found in the folder <installation-path>\Plugins\Default Lens Correction where <installation-path> is the directory you chose to install the DevSuite in.
The text file has the following format:
Coxccoyc
Xxxx xxxx (float point value)
rScene rSensor (in the unit of pixel numbers)
xxxxxxxx
xxxxxxxx
example:
coxc coyc
286 154
rScene rSensor
0 0
25 42
45 72
68 106
94 142
121 175
148 203
176 226
207 248
246 269
295 289
355 307
423 321
503 334
610 370
658 370
706 370
754 370
802 370



Loaded calibration data will be plotted in the distortion curve graph on Lens Calibration Tool page. See Figure 6.

Fig. 6 Import calibration data from a text file


Lens calibration data generated by the Lens Calibration Tool page will be exported to the Distortion Correction page automatically.