Mathematica 9 is now available
Previous section-----Next section

4.3 Rotation and Warping

Geometric transformation functions.

where x,y and u, v are point coordinates in the input and output images, respectively, N is the polynomial order, and a, b are mapping coefficients that characterize the transformation [Sch89]. Typical choices for the mapping order are N=1, 2, 3. The lowest-order mapping, N=1, is known as a bilinear transformation and has the form
The bilinear transformation in Equation (4.3.3) is defined by 6 coefficients, the elements of matrix W. Given a minimum of three pairs of control points, the coefficients may be obtained by solving a system of linear equations. In the case when the number of control points exceeds the necessary minimum of , a pseudo-inverse solution returns coefficients that best approximate the true mapping function in the least-squares sense [Wol90]. Subsequently, the coefficients may be used to compute the location in the x-y plane of any point in the u-v plane. Considering the latter to be the distorted image plane, and the former the domain of the undistorted original, this calculation in effect corrects for the distortion. Note, however, that calculation of point (x,y) using Equations (4.3.1), (4.3.2), or (4.3.3) will almost never result in a pair of integer values. In order to assign pixel intensities to points actually on the sampling (i.e., integer) grid, some interpolation strategy must be adopted. The two most common are nearest neighbor and bilinear interpolation. In bilinear interpolation, the pixel values at the corners of the square integer grid enclosing point (x,y) are weighted and averaged.

Option for ImageRotate, ImageWarp, and Resize.

Rotation is an example of an elementary spatial transformation. A planar rotation specification includes a rotation angle (typically with respect to the horizontal image axis), and a pivot point. In the function ImageRotate, the default pivot point is assumed to be centered in the image array. In computer vision applications, rotation is used to align two misregistered images.
In[1]:=
In[2]:=
In[3]:=
Out[3]=Out[3]=
Here is an example of geometric warping and correction. We use the function ImageWarp to first warp the geometry of the example image, so that it exhibits barrel distortion. Next we use the distorted image as the new input and reverse the distortion. We show the geometry of the two domains. The red grid lines represent the geometry of the undistorted image, while the blue lines are an example of barrel distortion.

In[4]:=
In[5]:=
Out[5]=Out[5]=
In[6]:=
Out[6]=Out[6]=
In[7]:=
Out[7]=Out[7]=
In[8]:=
Out[8]=Out[8]=
In[9]:=
Out[9]=Out[9]=
In[10]:=
Out[10]=Out[10]=
In[11]:=
Out[11]=Out[11]=
In[12]:=
Out[12]=Out[12]=


Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.