Main Content

Generic Geometric Transformations

Perform generic geometric transformations using the imwarp workflow

Geometric transformations map pixel coordinates in the output image to coordinates in the input image. The mapping process then interpolates the value of output pixels from the input image.

Use these functions to perform general 2-D, 3-D, and N-D geometric transformations. To perform a 2-D or 3-D geometric transformation, first create a geometric transformation object that stores information about the transformation. Then, pass the image to be transformed and the geometric transformation object to the imwarp function.


expand all

imwarpApply geometric transformation to image
transformPointsForwardApply forward geometric transformation
transformPointsInverseApply inverse geometric transformation
WarperApply same geometric transformation to many images efficiently
fitgeotransFit geometric transformation to control point pairs
affine2d2-D affine geometric transformation
affine3d 3-D affine geometric transformation
rigid2d2-D rigid geometric transformation
rigid3d3-D rigid geometric transformation
projective2d 2-D projective geometric transformation
geometricTransform2d2-D geometric transformation object
geometricTransform3d3-D geometric transformation object
PiecewiseLinearTransformation2D2-D piecewise linear geometric transformation
PolynomialTransformation2D2-D polynomial geometric transformation
LocalWeightedMeanTransformation2D2-D local weighted mean geometric transformation
tformarrayApply spatial transformation to N-D array
findboundsFind output bounds for spatial transformation
fliptformFlip input and output roles of spatial transformation structure
makeresamplerCreate resampling structure
maketformCreate N-D spatial transformation structure (TFORM)
tformfwdApply forward N-D spatial transformation
tforminvApply inverse N-D spatial transformation
imref2dReference 2-D image to world coordinates
imref3dReference 3-D image to world coordinates
affineOutputViewCreate output view for warping images


Geometric Transformation

2-D and 3-D Geometric Transformation Process Overview

To perform a general geometric transformation of a 2-D or 3-D image, first define the parameters of the transformation, then warp the image.

Matrix Representation of Geometric Transformations

Affine and projective transformations are represented by matrices. You can use matrix operations to perform a global transformation of an image.

N-Dimensional Spatial Transformations

You can create custom geometric transformations to process images of arbitrary dimension, or to change the dimensionality of the output image from the input image.

Specify Fill Values in Geometric Transformation Output

This example shows how to specify the color of blank space in the image after a geometric transformation.

Spatial Referencing

Image Coordinate Systems

Learn how image locations are expressed using discrete pixel indices and continuous spatial coordinates.

Define World Coordinate System of Image

Spatial referencing objects encode the relationship between the image extent in intrinsic coordinates, the image extent in world coordinates, and the image resolution.

Shift X- and Y-Coordinate Range of Displayed Image

This example shows how to specify a nondefault world coordinate system by changing the XData and YData properties of a displayed image.

Featured Examples