contains material from
Template Matching Techniques in Computer Vision: Theory and Practice
Roberto Brunelli © 2009 John Wiley & Sons, Ltd
Real optical systems are usually affected by geometrical distortions whose type and amount varies significantly from barely visible to significant. Furthermore, some characteristics of light propagation in an optical system results in unavoidable effects, such as wide angle lens vignetting. In this section we will look at a few TeMa functions that can be used to simulate geometrical distortions and vignetting effects.
The first step is to get some perfect images. A simple and cheap way to obtain such images is to generate them using a ray tracing system. Package TeMa includes some testing images generated using the Persistence of Vision Ray Tracer (http://www.povray.org).
As detailed by Equations TM:2.26-27 geometrical distortions can be considered as image plane effects and can be accurately simulated once the distortion curves are specified. Detailed distortion information is often available for high quality lenses directly from the manufacturer or can be measured using calibration patterns. The following code snippet shows to curves based on the public data for a real wide angle lens: the percent distortion and the vignetting are reported as a function of the distance expressed in millimeters from the optical center of the lens designed for a standard 24 × 36mm frame. The distortion and vignetting curves are obtained using spline interpolation given a set of manually measured points.
Inspection of the distortion curve, reported in Figure 2.1, shows it to be of a complex type, exhibiting both barrel distortion (up to 15mm from the optical center) and pincushion distortion (from 15mm onwards).
Generating a vignetted image is a simple task using the functions provided by TeMa:
The results are reported in Figure 2.2. A distorted image can be generated in a similar way
A vignetted distorted image can be generated easily