transltform3d - 3-D translation geometric transformation - MATLAB (original) (raw)
3-D translation geometric transformation
Since R2022b
Description
A transltform3d
object stores information about a 3-D translation geometric transformation and enables forward and inverse transformations.
Creation
You can create a transltform3d
object in these ways:
- imregtform — Estimates a geometric transformation that maps a moving image to a fixed image using similarity optimization.
- fitgeotform3d (Medical Imaging Toolbox) — Estimates a geometric transformation that maps pairs of control points between two images.
- The
transltform3d
function described here.
Syntax
Description
[tform](#mw%5F8ff1b217-2f77-4b62-bee7-b4342d636c35) = transltform3d
creates atransltform3d
object that performs the identity transformation.
[tform](#mw%5F8ff1b217-2f77-4b62-bee7-b4342d636c35) = transltform3d([t](#mw%5F5e350499-b8c2-421e-80aa-8538a0e6aeb2))
creates a transltform3d
object that performs a translation transformation based on the specified amount of translation t
.
[tform](#mw%5F8ff1b217-2f77-4b62-bee7-b4342d636c35) = transltform3d([tx](#mw%5F20a9a7e5-db48-4c7f-8933-98d808079014),[ty](#mw%5Fd2b288f5-5a43-43ea-ac8c-4e2ec4f0a2ee),[tz](#mw%5Fc60c8fb2-cf74-4993-9983-df40864c872d))
creates a transltform3d
object that performs a translation transformation with the specified amounts of translation tx
,ty
, and tz
in the _x_-,_y_-, and _z_-directions, respectively.
[tform](#mw%5F8ff1b217-2f77-4b62-bee7-b4342d636c35) = transltform3d([translMat](#mw%5F2c111e0c-dd5c-49a1-b2c9-31be77b402a5))
creates a transltform3d
object from the specified 3-D translation transformation matrix, translMat
.
[tform](#mw%5F8ff1b217-2f77-4b62-bee7-b4342d636c35) = transltform3d([tformIn](#mw%5Fa3ba328c-6380-48c0-bbed-f1a30a277323))
creates a transltform2d
object from another geometric transformation object, tformIn
, that represents a valid 3-D translation geometric transformation.
Input Arguments
Amount of translation, specified as a 3-element numeric vector of the form [_t_x _t_y _t_z]. These amounts of translation correspond to the values _t_x,_t_y, and_t_z in the translation transformation matrix defined by A.
This argument sets the Translation property.
Data Types: double
| single
Amount of translation in the _x_-direction, specified as a numeric scalar. This argument sets the first element of the Translation property.
Amount of translation in the _y_-direction, specified as a numeric scalar. This argument sets the second element of the Translation property.
Amount of translation in the _z_-direction, specified as a numeric scalar. This argument sets the third element of the Translation property.
Forward 3-D translation transformation, specified as a 4-by-4 numeric matrix. When you create the object, you can also specify translMat
as a 3-by-4 numeric matrix. In this case, the object concatenates the row vector [0 0 0 1]
to the end of the matrix, forming a 4-by-4 matrix.
A valid 3-D translation transformation A has the form:
_t_x,_t_y, and_t_z are the amount of translation in the_x_-, _y_-, and _z_-directions, respectively, and set the Translation property.
This argument sets the A property.
Data Types: double
| single
Output Arguments
Translation 3-D geometric transformation, returned as atransltform3d
object.
Properties
Forward 3-D translation transformation, specified as a 4-by-4 numeric matrix. The default of A
is the identity matrix.
The matrix A
transforms the point (u,v, w) in the input coordinate space to the point (x, y, z) in the output coordinate space using the convention:
For a translation transformation, A
has the form:
where _t_x,_t_y, and_t_z are the amount of translation in the_x_-, _y_-, and _z_-directions, respectively, and correspond to the Translation property.
Data Types: double
| single
Amount of translation, specified as a 3-element numeric vector of the form [_t_x _t_y _t_z].
Data Types: double
| single
This property is read-only.
Dimensionality of the geometric transformation for both input and output points, returned as the value 3
.
Data Types: double
Object Functions
Examples
Specify the amount of translation.
Create a transltform3d
object that performs the specified translation.
tform = transltform3d with properties:
Dimensionality: 3
Translation: [10 20.5000 15]
A: [1.0000 0 0 10.0000
0 1.0000 0 20.5000
0 0 1.0000 15.0000
0 0 0 1.0000]
Examine the value of the A
property.
ans = 4×4
1.0000 0 0 10.0000
0 1.0000 0 20.5000
0 0 1.0000 15.0000
0 0 0 1.0000
Extended Capabilities
Usage notes and limitations:
transltform3d
supports the generation of C and C++ code (requires MATLAB® Coder™). For more information, see Code Generation for Image Processing.- When generating code, you can only specify singular objects. Arrays of objects are not supported.
- Generated code cannot return a
transltform3d
object. Instead, you can return a numeric array, such as the value of theA
property.
Version History
Introduced in R2022b