Image Processing Toolbox User's Guide Previous page   Next Page

Performing General 2-D Spatial Transformations

This section describes two toolbox functions that you can use to perform general 2-D spatial transformations. (For information about performing transformations of arrays of higher dimension, see Performing N-Dimensional Spatial Transformations.)

You use the maketform function to define the 2-D spatial transformation you want to perform. maketform creates a MATLAB structure called a TFORM that contains all the parameters required to perform the transformation. You can define many types of spatial transformations in a TFORM, including affine transformations, such as translation, scaling, rotation, and shearing, projective transformations, and custom transformations. For more information, see Creating TFORM Structures. (You can also create a TFORM using the cp2tform function -- see Image Registration.)

After you create the TFORM, you use the imtransform function to perform the transformation, passing imtransform the image to be transformed and the TFORM structure. The following figure illustrates this process. The next section provides an example that illustrates each step -- see Example: Performing a Translation.

Overview of General 2-D Spatial Transformation Process


Previous page  Cropping an Image Example: Performing a Translation Next page

© 1994-2005 The MathWorks, Inc.