计算机视觉说白了也就是在和图像打交道, 而图像就是一个投影空间.
现实世界中的物体在照片中会改变大小形状.
但是有一些东西是不变的, 就比如点还是点, 直线还是直线,圆还是圆(可能是椭圆)
对一幅图旋转和平移不会改变它的长度和体积,距离角的比值,几何中心,平行关系以及和
均匀缩放
不均匀缩放,剪切
重合几何(incidence)
主要就是包含点的共线和线的相交. 也就是说,经过投影后, 如果原来点
X
1
\mathbf{X}_{1}
X1,
X
2
\mathbf{X}_{2}
X2,
X
3
\mathbf{X}_{3}
X3在同一条直线
l
\mathbf{l}
l上,那么它们变换后还是在同一条直线上.
如果原来线
l
1
\mathbf{l}_{1}
l1,
l
2
\mathbf{l}_{2}
l2,
l
3
\mathbf{l}_{3}
l3相交于同一点
X
\mathbf{X}
X,那么它们变换后还是相交于用一个点.
交比(Cross Ratio)
主要就是说,共线的四个点,经过投影变换后,点
X
1
\mathbf{X}_{1}
X1和点
X
3
\mathbf{X}_{3}
X3之间的距离乘上点
X
2
\mathbf{X}_{2}
X2和点
X
4
\mathbf{X}_{4}
X4之间的距离, 再除以(点
X
1
\mathbf{X}_{1}
X1和点
X
4
\mathbf{X}_{4}
X4之间的距离乘以点
X
2
\mathbf{X}_{2}
X2)和点
X
3
\mathbf{X}_{3}
X3),这个比值是不变的.
C
R
(
x
1
,
x
2
,
x
3
,
x
4
)
=
d
(
x
1
,
x
3
)
⋅
d
(
x
2
,
x
4
)
d
(
x
1
,
x
4
)
⋅
d
(
x
2
,
x
3
)
C R\left(\mathbf{x}_{1}, \mathbf{x}_{2}, \mathbf{x}_{3}, \mathbf{x}_{4}\right)=\frac{d\left(\mathbf{x}_{1}, \mathbf{x}_{3}\right) \cdot d\left(\mathbf{x}_{2}, \mathbf{x}_{4}\right)}{d\left(\mathbf{x}_{1}, \mathbf{x}_{4}\right) \cdot d\left(\mathbf{x}_{2}, \mathbf{x}_{3}\right)}
CR(x1,x2,x3,x4)=d(x1,x4)⋅d(x2,x3)d(x1,x3)⋅d(x2,x4)
什么是齐次坐标系呢?
其实就是点和线在投影空间中的表示.
投影空间的特点就是一个向量,和这个向量的倍数代表的是同一个实体.
一个图像点
(
x
,
y
)
T
(x, y)^{\mathrm{T}}
(x,y)T在投影空间
P
2
\mathbb{P}^{2}
P2可以用一个3-vector表示:
x
=
λ
⋅
(
x
,
y
,
1
)
T
=
(
u
,
v
,
w
)
T
\mathbf{x}=\lambda \cdot(x, y, 1)^{\mathrm{T}}=(u, v, w)^{\mathrm{T}}
x=λ⋅(x,y,1)T=(u,v,w)T
∥
x
∥
=
u
2
+
v
2
+
w
2
≠
0
\|\mathbf{x}\|=\sqrt{u^{2}+v^{2}+w^{2}} \neq 0
∥x∥=u2+v2+w2=0
这个w被叫做齐次分部.
x,y是欧几里得分部.
x
=
u
w
and
y
=
v
w
for
w
≠
0
x=\frac{u}{w} \quad \text { and } \quad y=\frac{v}{w} \quad \text { for } \quad w \neq 0
x=wu and y=wv for w=0
点的表达: Euclidean normalized
x
=
1
w
(
u
v
w
)
=
(
x
y
1
)
\mathbf{x}=\frac{1}{w}\left(\begin{array}{c} {u} \\ {v} \\ {w} \end{array}\right)=\left(\begin{array}{c} {x} \\ {y} \\ {1} \end{array}\right)
x=w1⎝⎛uvw⎠⎞=⎝⎛xy1⎠⎞
线的表达:HESSIAN normal form (except for the sign of d )
l
=
1
1
a
2
+
b
2
(
a
b
c
)
=
(
cos
ϕ
sin
ϕ
d
)
\mathbf{l}=\frac{1}{\sqrt{\frac{1}{a^{2}+b^{2}}}}\left(\begin{array}{l} {a} \\ {b} \\ {c} \end{array}\right)=\left(\begin{array}{c} {\cos \phi} \\ {\sin \phi} \\ {d} \end{array}\right)
l=a2+b211⎝⎛abc⎠⎞=⎝⎛cosϕsinϕd⎠⎞
这里好像也没说线的其次分部必须为0,不过在其它资料上看到的都是其次分部为0.
一些性质:点和线的二元性
重合关系:
x
⊤
l
=
l
⊤
x
=
a
u
+
b
v
+
c
w
=
0
\mathbf{x}^{\top} \mathbf{l}=\mathbf{l}^{\top} \mathbf{x}=a u+b v+c w=0
x⊤l=l⊤x=au+bv+cw=0
线的相交:
x
=
l
1
×
l
2
det
[
l
1
l
2
l
3
]
=
0
\begin{aligned} &\mathbf{x}=\mathbf{l}_{1} \times \mathbf{l}_{2}\\ &\operatorname{det}\left[\begin{array}{lll} {\mathbf{l}_{1}} & {\mathbf{l}_{2}} & {\mathbf{l}_{3}} \end{array}\right]=0 \end{aligned}
x=l1×l2det[l1l2l3]=0
点的共线:
l
=
x
1
×
x
2
det
[
x
1
x
2
x
3
]
=
0
\begin{aligned} &\mathbf{l}=\mathbf{x}_{1} \times \mathbf{x}_{2}\\ &\operatorname{det}\left[\begin{array}{lll} {\mathbf{x}_{1}} & {\mathbf{x}_{2}} & {\mathbf{x}_{3}} \end{array}\right]=0 \end{aligned}
l=x1×x2det[x1x2x3]=0
另外一个特别重要的就是理想点(无限远点)和理想线(无限远线).
理想点:
x
∞
=
(
u
,
v
,
0
)
⊤
\mathbf{x}_{\infty}=(u, v, 0)^{\top}
x∞=(u,v,0)⊤
理想线:
I
∞
=
(
0
,
0
,
c
)
⊤
\mathbf{I}_{\infty}=(0,0, c)^{\top}
I∞=(0,0,c)⊤
两条平行线相交于无限远点:
l
1
×
l
2
=
(
b
,
−
a
,
0
)
⊤
\mathbf{l}_{1} \times \mathbf{l}_{2}=(b,-a, 0)^{\top}
l1×l2=(b,−a,0)⊤
投影空间:
P
2
=
R
2
∪
x
∞
∪
l
∞
\mathbf{P}^{2}=\mathbf{R}^{2} \cup \mathbf{x}_{\infty} \cup \mathbf{l}_{\infty}
P2=R2∪x∞∪l∞
还有一个比较重要的:
如果H是从一个投影空间到令一个空间的转化.那么
对于点的转化是:
x
′
=
H
x
\mathbf{x}^{\prime}=\mathbf{H} \mathbf{x}
x′=Hx
对于线的转化是:
l
′
=
(
H
−
1
)
⊤
l
=
H
−
T
l
\mathbf{l}^{\prime}=\left(\mathbf{H}^{-1}\right)^{\top} \mathbf{l}=\mathbf{H}^{-\mathbf{T}} \mathbf{l}
l′=(H−1)⊤l=H−Tl
参考:
https://en.wikipedia.org/wiki/Cross-ratio
https://en.wikipedia.org/wiki/Incidence_(geometry)