Geometric Warping"Warping" [1] is any process that changes the shapes portrayed in an image. There are simple types of warping, like stretch and rotation, and there are more complex types, like restoring a distorted wide-angle image. Nevertheless, the basic idea of warping is to re-assign (or re-map) every pixel in the input image to a different location in the output image. The pixel re-assignment or re-mapping is usually done according to some mathematical equations. Therefore, if we want to "reverse" the distortion in a wide-angle image, then we should have a mathematical understanding of the nature of the distortion. In the remainder of this section, we address a type of distortion called radial distortion [2], which is commonly produced by wide-angle lenses. Note that this algorithm, while not the same, is similar to the one used in the Bigshot software.
Consider a scene being photographed using a normal lens. Let us assume a point P in front of the lens will form an image at pixel P1 as shown in Figure 10(a). Let the distance between P1 and the image center O be r1. Keep in mind that, since the normal lens follows perspective projection, the straight lines in the scene will remain straight in the image. Now let us replace the normal lens by a wide-angle lens. Since the wide-angle lens has to squeeze in a larger field-of-view onto the same sensor, it "squishes" the light rays. The squishing is usually the same in all the directions from the image center, but the amount of squishing may vary with the distance from the image center. This means that the point P, which would have been imaged at pixel P1, will be imaged at a different pixel, say P2 at a distance of r2 from the center, but along the same direction as pixel P1 (see Figure 10(b)). This sort of distortion is known as radial distortion [2]. To rectify this distortion (i.e., to move P2 back to P1), we need to, first, understand the mathematical relation between P1 and P2. One of the common representations is given by a polynomial equation: r2 = r1 + cr13 where c is a parameter controlling the amount of distortion. Keep in mind that one could choose a higher order polynomial, if the distortion were severe. Once we know the mathematical representation, correcting the distortion is easy. For every pixel in the desired distortion-free image, or the output image, we calculate its distance (r1) from the image center. By plugging this value in the above equation, we get the distance of the corresponding pixel in the distorted image. The color values are then simply copied from the pixel in the distorted image to the pixel in the output image.
The interactive demo is Figure 11 shows how one could correct for distortions. The slider controls the distortion parameter c described in the above equation. When c=0, the output image is the same as the input image. As we increase the value of c, we can see that the amount of distortion is reduced. Through trial and error, one could simply find the optimum value of c for which that the output appears distortion-free.
References
|
Copyright © 2009 Shree Nayar. Computer Vision Laboratory, Columbia University. Bigshot is a registered trademark.