Rout = affineOutputView(sizeA,tform)
takes the size of an input image, sizeA, and an affine geometric
transformation, tform, and returns a spatial referencing object,
Rout. You can use this object as input to imwarp to control the output limits and grid spacing of a warped image.
Rout = affineOutputView(sizeA,tform,BoundsStyle=style)
also specifies constraints on the spatial limits of the output view, such as whether the
output view should completely contain the output image or whether the output view should
match the input limits.
Read and display an image. To see the spatial extents of the image, make the axes visible.
A = imread("kobi.png");
A = imresize(A,0.25);
iptsetpref("ImshowAxesVisible","on")
imshow(A)
Create a 2-D affine transformation. This example creates a randomized transformation that consists of scale by a factor in the range [1.2, 2.4], rotation by an angle in the range [-45, 45] degrees, and horizontal translation by a distance in the range [100, 200] pixels.
Affine transformation: translation, rotation, anisotropic scaling,
reflection, and shearing
Note
You can also specify tform as an affine2d object or an affine3d object. However, these objects are not recommended. For more
information, see Version History.
Bounds style, specified as one of the following values.
Style
Description
"CenterOutput"
Center the view at the center of the image in output space while allowing
translation to move the output image out of view.
"FollowOutput"
Set the limits of the output view to completely contain the output
image.
"SameAsInput"
Set the output limits to be the same as the input limits.
Spatial referencing, returned as an imref2d or imref3d object. Use
Rout as the OutputView argument of the
imwarp function to specify the spatial
referencing of the warped output.
Starting 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 or
affinetform3d
object.
Although you can still specify tform as an
affine2d or affine3d object, these objects are not
recommended because they use the postmultiply convention. You can streamline your geometric
transformation workflows by switching to objects that use the premultiply convention. For
more information, see Migrate Geometric Transformations to Premultiply Convention.
affineOutputView now supports thread-based
environments.
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.
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: United States.
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.