invert
Invert geometric transformation
Syntax
Description
Examples
Invert 2-D Rotation
Read and display an image.
I = imread('pout.tif');
imshow(I)
Create an affine2d
object that defines a 30 degree clockwise rotation around the origin. View the transformation matrix stored in the T
property.
theta = 30; tform = affine2d([cosd(theta) sind(theta) 0; -sind(theta) cosd(theta) 0; 0 0 1]); tform.T
ans = 3×3
0.8660 0.5000 0
-0.5000 0.8660 0
0 0 1.0000
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 affine2d
object that represents a 30 degree rotation in the counterclockwise direction.
invtform = invert(tform); invtform.T
ans = 3×3
0.8660 -0.5000 0
0.5000 0.8660 0
0 0 1.0000
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
tform
— Geometric transformation
affine2d
object | affine3d
object | rigid2d
object | rigid3d
object | projective2d
object
Geometric transformation, specified as an affine2d
, affine3d
, rigid2d
, rigid3d
, or projective2d
geometric
transformation object.
Output Arguments
invtform
— Inverse geometric transformation
geometric transformation object
Inverse geometric transformation, returned as a geometric transformation
object. invtform
is the same type of object as
tform
.
Version History
See Also
Apri esempio
Si dispone di una versione modificata di questo esempio. Desideri aprire questo esempio con le tue modifiche?
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)