Main Content

invert

Invert geometric transformation

Description

tformInv = invert(tform) returns the inverse of the geometric transformation tform.

example

Examples

collapse all

Read and display an image.

I = imread("pout.tif");
imshow(I)

Figure contains an axes object. The hidden axes object contains an object of type image.

Create a rigidtform2d object that defines a 30 degree clockwise rotation around the origin.

translation = [0 0];
theta = 30;
tform = rigidtform2d(theta,translation);

Apply the forward geometric transformation, tform, to the image. Display the rotated image.

J = imwarp(I,tform);
imshow(J)

Figure contains an axes object. The hidden axes object contains an object of type image.

Invert the geometric transformation. The result is a new rigidtform2d object that represents a 30 degree rotation in the counterclockwise direction.

invtform = invert(tform);

Apply the inverse geometric transformation, invtform, to the rotated image J. The final image, K, has the same size, shape, and orientation as the original image. Black padding around the image results from the two transformations.

K = imwarp(J,invtform);
imshow(K)

Figure contains an axes object. The hidden axes object contains an object of type image.

Input Arguments

collapse all

Geometric transformation, specified as a geometric transformation object listed in the table.

Geometric Transformation ObjectDescription
2-D Geometric Transformations
transltform2dTranslation transformation
rigidtform2dRigid transformation: translation and rotation
simtform2dSimilarity transformation: translation, rotation, and isotropic scaling
affinetform2dAffine transformation: translation, rotation, anisotropic scaling, reflection, and shearing
projtform2dProjective transformation
3-D Geometric Transformations
transltform3dTranslation transformation
rigidtform3dRigid transformation: translation and rotation
simtform3dSimilarity transformation: translation, rotation, and isotropic scaling
affinetform3dAffine transformation: translation, rotation, anisotropic scaling, reflection, and shearing

Note

You can also specify tform as an object of type rigid2d, rigid3d, affine2d, affine3d, or projective2d. However, these objects are not recommended. For more information, see Version History.

Output Arguments

collapse all

Inverse geometric transformation, returned as a geometric transformation object of the same type as tform.

Version History

Introduced in R2013a

expand all