invert
Invert geometric transformation
Syntax
Description
Examples
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
Geometric transformation, specified as a geometric transformation object listed in the table.
Geometric Transformation Object | Description |
---|---|
2-D Geometric Transformations | |
transltform2d | Translation transformation |
rigidtform2d | Rigid transformation: translation and rotation |
simtform2d | Similarity transformation: translation, rotation, and isotropic scaling |
affinetform2d | Affine transformation: translation, rotation, anisotropic scaling, reflection, and shearing |
projtform2d | Projective transformation |
3-D Geometric Transformations | |
transltform3d | Translation transformation |
rigidtform3d | Rigid transformation: translation and rotation |
simtform3d | Similarity transformation: translation, rotation, and isotropic scaling |
affinetform3d | Affine 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
Inverse geometric transformation, returned as a geometric transformation
object of the same type as tform
.
Version History
Introduced in R2013aStarting in R2022b, most Image Processing Toolbox™ functions create and perform geometric transformations using the
premultiply convention. Accordingly, you can now specify tform
as a geometric transformation object that uses the premultiply convention, such as
an affinetform2d
object.
Although invert
still supports objects that use the
postmultiply convention, such as affine2d
object, these objects are
not recommended. You can streamline your geometric transformation workflows by
switching to the new premultiply geometric transformation objects. For more
information, see Migrate Geometric Transformations to Premultiply Convention.
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)