主要内容

transformPointsInverse

应用逆几何变换

描述

例子

uv) = transformPointsInverse (tformxy应用二维几何变换的逆变换tform到坐标所指定的点xy

uvw) = transformPointsInverse (tformxyz应用三维几何变换的逆变换tform到坐标所指定的点xy,z

U= transformPointsInverse (tformX应用的逆变换tform到输入坐标矩阵X并返回坐标矩阵UtransformPointsInverse地图的kth点Xk说到点子上Uk:)。

例子

全部折叠

创建一个affine2d对象,该对象定义转换。

θ= 10;Tform = affine2d([cosd(theta) -sind(theta) 0;信德(θ)cosd(θ)0;0 0 1])
tform = affine2d with properties: T: [3x3 double]维数:2

对输入点应用二维几何变换的前向变换。

(X, Y) = transformPointsForward (tform 5 10)
X = 6.6605 y = 8.9798

对上一步的输出点进行二维几何变换的逆变换,恢复原始坐标。

(U, V) = transformPointsInverse (tform, X, Y)
U = 5.0000 v = 10

指定五个输入点的压缩(x,y)坐标。打包后的坐标存储在一个5 × 2的矩阵中x每个点的-坐标在第一列,并且y每个点的坐标在第二列。

Xy = [10 15;11 32;15 34;2 7;2 10];

定义逆映射函数。函数接受和返回打包的(x,y)格式的点。

Inversefn = @(c) [c(:,1)+c(:,2),c(:,1)]
inversefn =function_handle与价值:@ (c) [c (: 1) + c (:, 2), c (: 1) - c (:, 2))

创建一个二维几何变换对象,tform,它存储了逆映射函数。

tform = geometricTransform2d (inversefn)
tform = geometricTransform2d with properties: InverseFcn: @(c)[c(:,1)+c(:,2),c(:,1)-c(:,2)] ForwardFcn: [] dimension: 2

对输入点应用反几何变换。

紫外线= transformPointsInverse (tform XY)
紫外线=5×225 -5 43 -21 49 -19 9 -5 12 -8

创建一个affine3d对象,该对象定义转换。

Tform = affine3d([3 1 2 0;4 5 8 0;6 2 1 0;0 0 0 1])
tform = affine3d with properties: T: [4×4 double

将三维几何变换的前向变换应用到输入点。

[X, Y, Z] = transformPointsForward (tform, 2、3、5)
X = 48 y = 27 z = 33

对上一步的输出点进行三维几何变换的逆变换,恢复原始坐标。

[U, V, W] = transformPointsInverse (tform X, Y, Z)
U = 2.000 v = 3 w = 5.0000

注明已包装(xyz)五个输入点的坐标。打包的坐标存储为一个5 × 3的矩阵,其中第一、第二和第三列包含x-,y- - - - - -,z -坐标,分别。

Xyz = [5 25 20;10 5 25;15 10 5;

定义一个逆映射函数,它接受和返回packed (xyz)的格式。

inverseFcn = @ (c) [c (: 1) + c (:, 2), c (: 1) - c (:, 2), c(:, 3)。^ 2];

创建一个三维几何变换对象,tform,它存储了这个逆映射函数。

tform = geometricTransform3d (inverseFcn)
tform = geometricTransform3d属性:InverseFcn: @ (c) [c (: 1) + c (:, 2), c (: 1) - c (:, 2), c(:, 3)。^2] ForwardFcn:[]维数:3

将这个三维几何变换的逆变换应用到输入点上。

UVW = transformPointsInverse (tform XYZ)
UVW =5×330 -20 400 15 5 625 25 5 25 35 5 100 45 5 225

输入参数

全部折叠

几何变换,指定为一个几何变换对象。

对于二维几何变换,tform可以是一个rigid2daffine2dprojective2dgeometricTransform2dLocalWeightedMeanTransformation2DPiecewiseLinearTransformation2D,或PolynomialTransformation2D几何变换对象。

对于三维几何变换,tform可以是一个affine3drigid3d,或geometricTransform3d几何变换对象。

x-要转换的点的坐标,指定为——- - - - - -n——- - - - - -n——- - - - - -p数字数组。的维数x匹配的维度tform

数据类型:|

y-要转换的点的坐标,指定为——- - - - - -n——- - - - - -n——- - - - - -p数字数组。的大小y必须匹配的尺寸x

数据类型:|

z-要转换的点的坐标,指定为——- - - - - -n——- - - - - -p数字数组。z仅在以下情况下使用tform是一个三维几何变换。的大小z必须匹配的尺寸x

数据类型:|

要变换的点的坐标,指定为l——- - - - - -2l——- - - - - -3.数字数组。的列数X匹配的维度tform

第一列列出x要转换的每个点的-坐标,第二列列出y协调。如果tform表示一个三维几何变换,X有大小l——- - - - - -3.第三列是z要变换的点的坐标。

数据类型:|

输出参数

全部折叠

x-变换后点的坐标,返回为——- - - - - -n——- - - - - -n——- - - - - -p数字数组。的维数u匹配的维度tform

数据类型:|

y-变换后点的坐标,返回为——- - - - - -n——- - - - - -n——- - - - - -p数字数组。的大小v匹配的大小u

数据类型:|

z-变换后点的坐标,返回为——- - - - - -n——- - - - - -p数字数组。的大小w匹配的大小u

数据类型:|

转换后的点坐标,以数字数组的形式返回。的大小U匹配的大小X

第一列列出x-坐标,第二列列出y协调。如果tform表示一个三维几何变换,第三列列出z-变换后点的坐标。

数据类型:|

介绍了R2013a