一、线性变换
放射变换包括如下所有变换,以及这些变换任意组合:
- 平移(translation)和 旋转(rotation),两者的组合称之为 欧式变换(Euclidean transformation)或 刚体变换(rigid transformation);
- 缩放(scaling)可分为 uniform scaling 和 non-uniform scaling,uniform scaling:每个坐标轴放缩系数相同(各向同性),non-uniform scaling:不同;如果放缩系数为负,则会变成 反射(reflection)—— reflection可以看成是特殊的scaling;
- 刚体变换 + uniform scaling 称之为,相似变换(similarity transformation),即平移 + 旋转 + 各向同性的放缩;
- 剪切变换(shear mapping)将所有点沿某一指定方向成比例地平移。
二、变换矩阵形式
由坐标(x,y)变换成(
x
′
{x}'
x′,
y
′
{y}'
y′)
[
x
′
y
′
]
=
[
a
b
c
d
]
[
x
y
]
\begin{bmatrix} {x}'\\ {y}' \end{bmatrix}= \begin{bmatrix} a & b \\ c & d \end{bmatrix} \begin{bmatrix} x\\ y \end{bmatrix}
[x′y′]=[acbd][xy]
为了引入平移变换,因此引入齐次坐标
[
x
′
y
′
1
]
=
[
a
b
c
d
e
f
0
0
1
]
[
x
y
1
]
\begin{bmatrix} {x}'\\ {y}'\\ 1 \end{bmatrix}= \begin{bmatrix} a & b & c \\ d & e & f \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x\\ y\\ 1 \end{bmatrix}
⎣⎡x′y′1⎦⎤=⎣⎡ad0be0cf1⎦⎤⎣⎡xy1⎦⎤
矩阵变换如下图所示:
刚体变换 = 旋转 * 平移,有三个自由度(θ,
t
x
t_x
tx,
t
y
t_y
ty),旋转方向为逆时针,与图中的正负号不同:
[
x
′
y
′
1
]
=
[
c
o
s
(
θ
)
−
s
i
n
(
θ
)
t
x
s
i
n
(
θ
)
c
o
s
(
θ
)
t
y
0
0
1
]
[
x
y
1
]
\begin{bmatrix} {x}'\\ {y}'\\ 1 \end{bmatrix}= \begin{bmatrix} cos(\theta) & -sin(\theta) & t_x\\ sin(\theta) & cos(\theta) & t_y\\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x\\ y\\ 1 \end{bmatrix}
⎣⎡x′y′1⎦⎤=⎣⎡cos(θ)sin(θ)0−sin(θ)cos(θ)0txty1⎦⎤⎣⎡xy1⎦⎤
如果再乘上uniform scaling得到相似变换,有4个自由度(s,θ,tx,ty):
[
x
′
y
′
1
]
=
[
s
∗
c
o
s
(
θ
)
−
s
∗
s
i
n
(
θ
)
t
x
s
∗
s
i
n
(
θ
)
s
∗
c
o
s
(
θ
)
t
y
0
0
1
]
[
x
y
1
]
\begin{bmatrix} {x}'\\ {y}'\\ 1 \end{bmatrix}= \begin{bmatrix} s*cos(\theta) & -s*sin(\theta) & t_x\\ s*sin(\theta) & s*cos(\theta) & t_y\\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x\\ y\\ 1 \end{bmatrix}
⎣⎡x′y′1⎦⎤=⎣⎡s∗cos(θ)s∗sin(θ)0−s∗sin(θ)s∗cos(θ)0txty1⎦⎤⎣⎡xy1⎦⎤
放射变换矩阵有6个自由度(a,b,c,d,e,f)。
三、变换矩阵的参数估计
给定两个对应的点集,如何估计变换矩阵的参数?
一对对应点可以得到两个线性方程,两个对应的点集可以得到线性方程组,对应点的数目至少为自由度的一半,求解方程组的参数可以使用基于最小二乘或者SVD分解等。