affine2d

（不推荐）使用后乘约定的二维仿射几何变换

说明

`affine2d` 对象使用后乘约定存储有关二维仿射几何变换的信息，并支持正变换和逆变换。

创建对象

语法

``tform = affine2d``
``tform = affine2d(t)``

描述

``tform = affine2d` 创建一个 `affine2d` 对象，其默认属性设置对应于恒等变换。`

``tform = affine2d(t)` 将属性 `T` 设置为指定的二维仿射变换矩阵 `t`。`

属性

`[x y 1] = [u v 1] * T`

``` [a b 0; c d 0; e f 1]; ```

`T` 的默认值为恒等变换。

对象函数

 `invert` Invert geometric transformation `isRigid` Determine if geometric transformation is rigid transformation `isSimilarity` Determine if geometric transformation is similarity transformation `isTranslation` Determine if geometric transformation is pure translation `outputLimits` Find output spatial limits given input spatial limits `transformPointsForward` Apply forward geometric transformation `transformPointsInverse` Apply inverse geometric transformation

示例

```theta = 30; tform = affine2d([ ... cosd(theta) sind(theta) 0;... -sind(theta) cosd(theta) 0; ... 0 0 1])```
```tform = affine2d with properties: T: [3x3 double] Dimensionality: 2 ```

`[x,y] = transformPointsForward(tform,10,0)`
```x = 8.6603 ```
```y = 5 ```

```plot(10,0,'bo',x,y,'ro') axis([0 12 0 12]) axis square```

`A = imread('pout.tif');`

`tform = affine2d([2 0.33 0; 0 1 0; 0 0 1])`
```tform = affine2d with properties: T: [3x3 double] Dimensionality: 2 ```

`B = imwarp(A,tform);`

```figure imshow(B); axis on equal;```

版本历史记录

R2022b: 不推荐

• 将函数名称 `affine2d` 的实例更改为 `affinetform2d`

• 将变换矩阵指定为矩阵 `T` 的转置矩阵，其中 `T``affine2d` 对象的 `T` 属性的值，或用于创建 `affine2d` 对象的变换矩阵。

```T = [2 0.33 0; 0 1 0; 0 0 1]; tformPost = affine2d(T);```

```T = [2 0.33 0; 0 1 0; 0 0 1]; tform = affinetform2d(T');```

```T = tformPost.T; tform = affinetform2d(T');```