Image Processing Toolbox | ![]() ![]() |
Apply inverse spatial transformation
Syntax
Description
U = tforminv(X,T)
applies the inverse transformation defined in T
to each row of X
, if X
is a matrix. T
is a TFORM
struct created with maketform
, fliptform
, or cp2tform
. The argument X
is an M
-by-T.ndims_out
matrix. Each row of X
represents a point in T
's output space. U
is an M
-by-T.ndims_out
matrix. Each row of U
represents a point in T
's input space, and is the inverse transformation of the corresponding row of X
.
If X
is an (N+1)-dimensional array (including an implicit trailing singleton dimension if T.ndims_out
is 1), then tforminv
applies the transformation to each point X(P1,P2,...,PN,:)
. size(X,N+1)
must equal T.ndims_in
. U
is an (N+1)-dimensional array containing the results of each transformation in U(P1,P2,...PN,:)
. size(U,I)
equals size(X,I)
for I = 1,...,N
and size(U,N+1)
equals T.ndims_in
.
Example
Create an affine transformation that maps the triangle with vertices (0,0), (6,3), (-2,5) to the triangle with vertices (-1,-1), (0,-10), (-2,5).
Validate the mapping by applying tforminv
to x.
See Also
cp2tform
, tforminv
, maketform
, fliptform
![]() | tformfwd | translate | ![]() |