图像的几何变换分为三类:刚性变换、仿射变换和透视变换。
[
x
′
y
′
1
]
=
[
f
x
0
0
0
f
y
0
0
0
1
]
[
x
y
1
]
[
x
′
y
′
1
]
=
[
x
y
1
]
[
f
x
0
0
0
f
y
0
0
0
1
]
x
′
=
f
x
x
x' = f_x x
x′=fxx
y
′
=
f
y
y
y' = f_y y
y′=fyy
[
x
′
y
′
1
]
=
[
1
0
Δ
x
0
1
Δ
y
0
0
1
]
[
x
y
1
]
[
x
′
y
′
1
]
=
[
x
y
1
]
[
1
0
0
0
1
0
Δ
x
Δ
y
1
]
x
′
=
x
+
Δ
x
x' = x + \Delta x
x′=x+Δx
y
′
=
y
+
Δ
y
y' = y + \Delta y
y′=y+Δy
图像宽
w
w
w,高
h
h
h
左上角为原点,向下为
x
x
x轴,向右为
y
y
y轴
[
x
′
y
′
1
]
=
[
−
1
0
w
0
1
0
0
0
1
]
[
x
y
1
]
[
x
′
y
′
1
]
=
[
x
y
1
]
[
−
1
0
0
0
1
0
w
0
1
]
水平镜像变换:先绕
y
y
y轴翻转,再沿
x
x
x轴移动
[
−
1
0
w
0
1
0
0
0
1
]
=
[
1
0
w
0
1
0
0
0
1
]
[
−
1
0
0
0
1
0
0
0
1
]
[
−
1
0
0
0
1
0
w
0
1
]
=
[
−
1
0
0
0
1
0
0
0
1
]
[
1
0
0
0
1
0
w
0
1
]
x
′
=
w
−
x
x' = w - x
x′=w−x
y
′
=
y
y' = y
y′=y
[
x
′
y
′
1
]
=
[
1
0
0
0
−
1
h
0
0
1
]
[
x
y
1
]
[
x
′
y
′
1
]
=
[
x
y
1
]
[
1
0
0
0
−
1
0
0
h
1
]
垂直镜像变换:先绕
x
x
x轴翻转,再沿
y
y
y轴移动
[
1
0
0
0
−
1
h
0
0
1
]
=
[
1
0
0
0
1
h
0
0
1
]
[
1
0
0
0
−
1
0
0
0
1
]
[
1
0
0
0
−
1
0
0
h
1
]
=
[
1
0
0
0
−
1
0
0
0
1
]
[
1
0
0
0
1
0
0
h
1
]
x
′
=
x
x' = x
x′=x
y
′
=
h
−
y
y' = h - y
y′=h−y
注:线性代数有 x A B = x ( A B ) xAB = x(AB) xAB=x(AB)
[
x
′
y
′
1
]
=
[
1
0
0
0
1
0
0
0
1
]
[
x
y
1
]
[
x
′
y
′
1
]
=
[
x
y
1
]
[
1
0
0
0
1
0
0
0
1
]
x
′
=
x
x' = x
x′=x
y
′
=
y
y' = y
y′=y
[
x
′
y
′
1
]
=
[
x
y
1
]
[
c
o
s
θ
s
i
n
θ
0
−
s
i
n
θ
c
o
s
θ
0
0
0
1
]
[
x
′
y
′
1
]
=
[
c
o
s
θ
−
s
i
n
θ
0
s
i
n
θ
c
o
s
θ
0
0
0
1
]
[
x
y
1
]
x
′
=
c
o
s
θ
x
−
s
i
n
θ
y
x' = cos \theta x - sin \theta y
x′=cosθx−sinθy
y
′
=
s
i
n
θ
x
+
c
o
s
θ
y
y' = sin \theta x + cos \theta y
y′=sinθx+cosθy
[
x
′
y
′
1
]
=
[
x
y
1
]
[
c
o
s
θ
−
s
i
n
θ
0
s
i
n
θ
c
o
s
θ
0
0
0
1
]
[
x
′
y
′
1
]
=
[
c
o
s
θ
s
i
n
θ
0
−
s
i
n
θ
c
o
s
θ
0
0
0
1
]
[
x
y
1
]
x
′
=
c
o
s
θ
x
+
s
i
n
θ
y
x' = cos \theta x + sin \theta y
x′=cosθx+sinθy
y
′
=
−
s
i
n
θ
x
+
c
o
s
θ
y
y' = -sin \theta x + cos \theta y
y′=−sinθx+cosθy
先将该点平移到原点,再绕原点进行旋转,最后将该点平移回去。
[
x
′
y
′
1
]
=
[
1
0
0
s
h
1
0
0
0
1
]
[
x
y
1
]
[
x
′
y
′
1
]
=
[
x
y
1
]
[
1
s
h
0
0
1
0
0
0
1
]
x
′
=
x
x' = x
x′=x
y
′
=
s
h
x
+
y
y' = s_h x + y
y′=shx+y
[
x
′
y
′
1
]
=
[
1
s
v
0
0
1
0
0
0
1
]
[
x
y
1
]
[
x
′
y
′
1
]
=
[
x
y
1
]
[
1
0
0
s
v
1
0
0
0
1
]
x
′
=
x
+
s
v
y
x' = x + s_v y
x′=x+svy
y
′
=
y
y' = y
y′=y