outputLimits
Find output spatial limits given input spatial limits
Syntax
Description
[
estimates the output spatial limits corresponding to a set of input spatial limits,
xLimitsOut,yLimitsOut] = outputLimits(tform,xLimitsIn,yLimitsIn)xLimitsIn and yLimitsIn, given 2-D
geometric transformation tform.
[
estimates the output spatial limits, given 3-D geometric transformation
xLimitsOut,yLimitsOut,zLimitsOut] = outputLimits(tform,xLimitsIn,yLimitsIn,zLimitsIn)tform.
Examples
Define a 3-by-3 geometric transformation matrix. This example specifies a matrix for an affine transformation consisting of vertical shear and horizontal stretch.
A = [2 0 0; 0.33 1 0; 0 0 1];
Create an affinetform2d object from the transformation matrix.
tform = affinetform2d(A);
Read an image and calculate the size of the image.
I = imread("pout.tif");
[height,width,~] = size(I)height = 291
width = 240
Estimate the output spatial limits.
[xlim,ylim] = outputLimits(tform,[1 width],[1 height])
xlim = 1×2
2 480
ylim = 1×2
1.3300 370.2000
Define a rigid geometric transformation consisting only of translation.
t = [10 20.5 15]; tform = transltform3d(t);
Estimate the output spatial limits for a volume of size 128-by-128-by-128 voxels.
[xlim,ylim,zlim] = outputLimits(tform,[1 128],[1 128],[1 128])
xlim = 1×2
11 138
ylim = 1×2
21.5000 148.5000
zlim = 1×2
16 143
Input Arguments
Geometric transformation, specified as a geometric transformation object listed in the table.
| Geometric Transformation Object | Description |
|---|---|
| 2-D Linear 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 Linear 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 |
| Nonlinear Geometric Transformations | |
geometricTransform2d | Custom 2-D geometric transformation using point-wise mapping functions |
geometricTransform3d | Custom 3-D geometric transformation using point-wise mapping functions |
LocalWeightedMeanTransformation2D | 2-D local weighted means transformation |
PiecewiseLinearTransformation2D | 2-D piecewise linear transformation |
PolynomialTransformation2D | 2-D polynomial transformation |
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.
Input spatial limits in the x-dimension, specified as a 1-by-2 numeric vector.
Data Types: double
Input spatial limits in the y-dimension, specified as a 1-by-2 numeric vector.
Data Types: double
Input spatial limits in the z-dimension, specified as a
1-by-2 numeric vector. Specify zLimitsIn only when
tform is an object representing a 3-D geometric
transformation.
Data Types: double
Output Arguments
Output spatial limits in the x-dimension, returned as a 1-by-2 numeric vector.
Data Types: double
Output spatial limits in the y-dimension, returned as a 1-by-2 numeric vector.
Data Types: double
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 outputLimits still supports objects that use the
postmultiply convention, such as an 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.
There is no change to the support for nonlinear geometric transformation objects.
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.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- 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)