Main Content

invert

Invert geometric transformation

Description

example

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

Examples

collapse all

Read and display an image.

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

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)

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)

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 Compatibility Considerations.

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