等距变换(Isometries)
[
x
′
y
′
1
]
=
[
σ
cos
?
θ
?
sin
?
θ
x
0
σ
sin
?
θ
cos
?
θ
y
0
0
0
1
]
[
x
y
1
]
\left[\begin{matrix}x'\\y'\\1\\\end{matrix}\right]= \left[\begin{matrix}\sigma\cos\theta&-\sin\theta&x_0\\\sigma\sin\theta&\cos\theta&y_0\\0&0&1\\\end{matrix}\right] \left[\begin{matrix}x\\y\\1\\\end{matrix}\right]
???x′y′1????=???σcosθσsinθ0??sinθcosθ0?x0?y0?1???????xy1????
σ
=
±
1
\sigma=\pm1
σ=±1
欧式变换(Euclidean)
在等距变换(1.4.1)中,如果矩阵 U 是一个旋转矩阵,则这个等距变换称为欧氏变换。
[
x
′
y
′
1
]
=
H
e
x
=
[
R
t
0
1
]
[
x
y
1
]
\left[\begin{matrix}x'\\y'\\1\\\end{matrix}\right]=H_e\mathbf{x}= \left[\begin{matrix}R&t\\0&1\end{matrix}\right] \left[\begin{matrix}x\\y\\1\\\end{matrix}\right]
???x′y′1????=He?x=[R0?t1?]???xy1????
相似变换(Similarity)
相似变换是等距变换与均匀伸缩变换的合成变换,所谓均匀伸缩变换是指下述变换:
[
x
′
y
′
1
]
=
[
s
0
0
0
s
0
0
0
1
]
[
x
y
1
]
\left[\begin{matrix}x'\\y'\\1\\\end{matrix}\right]= \left[\begin{matrix}s&0&0\\0&s&0\\0&0&1\\\end{matrix}\right] \left[\begin{matrix}x\\y\\1\\\end{matrix}\right]
???x′y′1????=???s00?0s0?001???????xy1????
其中 s 是均匀伸缩因子。
相似变换,顾名思义,它是保持图形相似的变换。在初等几何中,相似分为旋转相似(保向)和对称相似(逆向)。旋转相似是欧氏变换与均匀伸缩变换的合成,而对称相似是反射等距变换与均匀伸缩变换的合成。
在计算机视觉中最关心的是旋转相似,它可用下面的矩阵形式来表示:
[
x
′
y
′
1
]
=
[
s
cos
?
θ
?
s
sin
?
θ
x
0
s
sin
?
θ
s
cos
?
θ
y
0
0
0
1
]
[
x
y
1
]
\left[\begin{matrix}x'\\y'\\1\\\end{matrix}\right]= \left[\begin{matrix}s\cos\theta&-s\sin\theta&x_0\\s\sin\theta&s\cos\theta&y_0\\0&0&1\\\end{matrix}\right] \left[\begin{matrix}x\\y\\1\\\end{matrix}\right]
???x′y′1????=???scosθssinθ0??ssinθscosθ0?x0?y0?1???????xy1????
x
′
=
H
e
x
=
[
s
R
t
0
1
]
x
\mathbf{x'}=H_e\mathbf{x}= \left[\begin{matrix}sR&t\\0&1\end{matrix}\right]\mathbf{x}
x′=He?x=[sR0?t1?]x
旋转相似变换有 4 个自由度,因为它比欧氏变换多一个均匀伸缩因子。
仿射变换(Affine)
[
x
′
y
′
1
]
=
[
A
t
0
1
]
[
x
y
1
]
=
[
a
b
x
0
c
d
y
0
0
0
1
]
[
x
y
1
]
\left[\begin{matrix}x'\\y'\\1\\\end{matrix}\right]= \left[\begin{matrix}A&t\\0&1\end{matrix}\right] \left[\begin{matrix}x\\y\\1\\\end{matrix}\right]= \left[\begin{matrix}a&b&x_0\\c&d&y_0\\0&0&1\\\end{matrix}\right] \left[\begin{matrix}x\\y\\1\\\end{matrix}\right]
???x′y′1????=[A0?t1?]???xy1????=???ac0?bd0?x0?y0?1???????xy1????
其中 A 是一个 2 阶可逆矩阵。仿射变换有 6 个自由度, 3 个不共线的点对应唯一确定仿射变换。仿射变换的全体也构成一个变换群,称为仿射变换群。 相似变换群是它的子群。
射影变换(Projective)
x
′
=
H
x
=
[
A
t
v
T
k
]
x
\mathbf{x'}=H\mathbf{x}= \left[\begin{matrix}A&t\\v^T&k\end{matrix}\right]\mathbf{x}
x′=Hx=[AvT?tk?]x
H
=
H
S
H
A
H
P
=
[
s
R
t
/
k
0
1
]
[
K
0
0
1
]
[
I
0
v
T
k
]
H=H_SH_AH_P= \left[\begin{matrix}sR&t/k\\0&1\end{matrix}\right] \left[\begin{matrix}K&0\\0&1\end{matrix}\right] \left[\begin{matrix}I&0\\v^T&k\end{matrix}\right]
H=HS?HA?HP?=[sR0?t/k1?][K0?01?][IvT?0k?]
矩阵
H
S
H
A
H
P
H_SH_AH_P
HS?HA?HP?分别是相似变换、仿射变换和射影变换
变换
H
P
H_P
HP?属于节A5.3 ( p430)所介绍的一种有约束的透视变换
单应变换(Homography)、透视变换(Perspective)
单应变换即是指具有对应关系的两幅图像之间的映射关系,一般的,单应变换的变换矩阵是一个3*3的矩阵H,H虽然具有9个元素,但是具有8个自由度。
[
u
2
v
2
1
]
=
H
[
u
1
v
1
1
]
=
[
h
1
h
2
h
3
h
4
h
5
h
6
h
7
h
8
h
9
]
[
u
1
v
1
1
]
\left[\begin{matrix}u_2\\v_2\\1\\\end{matrix}\right]=H \left[\begin{matrix}u_1\\v_1\\1\\\end{matrix}\right]= \left[\begin{matrix}h_1&h_2&h_3\\h_4&h_5&h_6\\h_7&h_8&h_9\\\end{matrix}\right] \left[\begin{matrix}u_1\\v_1\\1\\\end{matrix}\right]
???u2?v2?1????=H???u1?v1?1????=???h1?h4?h7??h2?h5?h8??h3?h6?h9????????u1?v1?1????
{
u
2
=
h
1
u
1
+
h
2
v
1
+
h
3
h
7
u
1
+
h
8
v
1
+
h
9
v
2
=
h
4
u
1
+
h
5
v
1
+
h
6
h
7
u
1
+
h
8
v
1
+
h
9
\left\{\begin{matrix}u_2=\frac{h_1u_1+h_2v_1+h_3}{h_7u_1+h_8v_1+h_9}\\v_2=\frac{h_4u_1+h_5v_1+h_6}{h_7u_1+h_8v_1+h_9}\\\end{matrix}\right.
{u2?=h7?u1?+h8?v1?+h9?h1?u1?+h2?v1?+h3??v2?=h7?u1?+h8?v1?+h9?h4?u1?+h5?v1?+h6???
在实际处理中通常乘以一个非零因子使得h_9=1,于是有:
{
h
1
u
1
+
h
2
v
1
+
h
3
?
h
7
u
1
u
2
?
h
8
v
1
u
2
=
v
2
h
4
u
1
+
h
5
v
1
+
h
6
?
h
7
u
1
v
2
?
h
8
v
1
v
2
=
v
2
\left\{\begin{matrix}h_1u_1+h_2v_1+h_3-h_7u_1u_2-h_8v_1u_2=v_2\\h_4u_1+h_5v_1+h_6-h_7u_1v_2-h_8v_1v_2=v_2\\\end{matrix}\right.
{h1?u1?+h2?v1?+h3??h7?u1?u2??h8?v1?u2?=v2?h4?u1?+h5?v1?+h6??h7?u1?v2??h8?v1?v2?=v2??
这样一组匹配点对就可以构造出两项约束,于是自由度为8的单应矩阵可以通过4对匹配特征点算出(注意,这些特征点不能有三点共线的情况)。
参考文献
Multiple View Geometry in Computer Vision (Second Edition) 计算机视觉中的多视图几何
计算机视觉中的数学方法-吴福朝
视觉SLAM十四讲:从理论到实践
学习OpenCV 3