剔除低对比度特征点中的矩阵求导公式推导
假定
x
=
[
x
1
,
x
2
]
T
,
Δ
x
=
[
Δ
x
1
,
Δ
x
2
]
T
\mathbf{x} = [x_1,x_2]^T,\Delta \mathbf{x} = [\Delta x_1,\Delta x_2]^T
x=[x1,x2]T,Δx=[Δx1,Δx2]T
泰勒展开式:
D
(
x
+
Δ
x
)
=
D
(
x
)
+
(
∂
D
∂
x
)
T
Δ
x
+
1
2
Δ
x
T
∂
2
D
∂
x
∂
x
T
Δ
x
D(\mathbf{x}+\Delta\mathbf{x}) = D(\mathbf{x}) + (\frac{\partial D}{\partial \mathbf{x}})^T \Delta\mathbf{x} + \frac{1}{2} \Delta \mathbf{x}^T \frac{\partial^2 D}{\partial \mathbf{x} \partial \mathbf{x}^T} \Delta \mathbf{x}
D(x+Δx)=D(x)+(∂x∂D)TΔx+21ΔxT∂x∂xT∂2DΔx
其中
∂ D ∂ x = [ ∂ D ∂ x 1 , ∂ D ∂ x 2 ] T ∂ 2 D ∂ x ∂ x T = [ ∂ 2 D ∂ x 1 2 ∂ 2 D ∂ x 1 ∂ x 2 ∂ 2 D ∂ x 2 ∂ x 1 ∂ 2 D ∂ x 2 2 ] = [ ∂ 2 D ∂ x 1 2 ∂ 2 D ∂ x 1 ∂ x 2 ∂ 2 D ∂ x 1 ∂ x 2 ∂ 2 D ∂ x 2 2 ] \frac{\partial D}{\partial \mathbf{x}} = [\frac{\partial D}{\partial x_1},\frac{\partial D}{\partial x_2}]^T \\ \frac{\partial^2 D}{\partial \mathbf{x} \partial \mathbf{x}^T} = \left[ \begin{array}{cc} \frac{\partial^2 D}{\partial x_1^2} & \frac{\partial^2 D}{\partial x_1\partial x_2} \\ \frac{\partial^2 D}{\partial x_2 \partial x_1} & \frac{\partial^2 D}{\partial x_2^2} \end{array} \right] =\left[ \begin{array}{cc} \frac{\partial^2 D}{\partial x_1^2} & \frac{\partial^2 D}{\partial x_1\partial x_2} \\ \frac{\partial^2 D}{\partial x_1 \partial x_2} & \frac{\partial^2 D}{\partial x_2^2} \end{array} \right] ∂x∂D=[∂x1∂D,∂x2∂D]T∂x∂xT∂2D=[∂x12∂2D∂x2∂x1∂2D∂x1∂x2∂2D∂x22∂2D]=[∂x12∂2D∂x1∂x2∂2D∂x1∂x2∂2D∂x22∂2D]
对 Δ x \Delta \mathbf{x} Δx求导
∂ D ( x + Δ x ) ∂ Δ x = ∂ D ( x ) ∂ Δ x + ∂ ∂ Δ x [ ( ∂ D ∂ x ) T Δ x ] + ∂ ∂ Δ x [ 1 2 Δ x T ∂ 2 D ∂ x ∂ x T Δ x ] \frac{\partial D(\mathbf{x}+\Delta\mathbf{x})}{\partial \Delta \mathbf{x}} = \frac{\partial D(\mathbf{x})}{\partial \Delta \mathbf{x}} + \frac{\partial}{\partial \Delta \mathbf{x}} [(\frac{\partial D}{\partial \mathbf{x}})^T \Delta \mathbf{x}] + \frac{\partial}{\partial \Delta \mathbf{x}}[\frac{1}{2} \Delta \mathbf{x}^T \frac{\partial^2 D}{\partial \mathbf{x} \partial \mathbf{x}^T} \Delta \mathbf{x}] ∂Δx∂D(x+Δx)=∂Δx∂D(x)+∂Δx∂[(∂x∂D)TΔx]+∂Δx∂[21ΔxT∂x∂xT∂2DΔx]
其中
∂ D ( x ) ∂ Δ x = 0 ∂ ∂ Δ x [ ( ∂ D ∂ x ) T Δ x ] = ∂ D ∂ x ∂ ∂ Δ x [ 1 2 Δ x T ∂ 2 D ∂ x ∂ x T Δ x ] = 1 2 [ ∂ 2 D ∂ x ∂ x T + ( ∂ 2 D ∂ x ∂ x T ) T ] Δ x = ∂ 2 D ∂ x ∂ x T Δ x \frac{\partial D(\mathbf{x})}{\partial \Delta \mathbf{x}} = 0 \\ \frac{\partial}{\partial \Delta \mathbf{x}} [(\frac{\partial D}{\partial \mathbf{x}})^T \Delta \mathbf{x}] = \frac{\partial D}{\partial \mathbf{x}} \\ \frac{\partial}{\partial \Delta \mathbf{x}}[\frac{1}{2} \Delta \mathbf{x}^T \frac{\partial^2 D}{\partial \mathbf{x} \partial \mathbf{x}^T} \Delta \mathbf{x}] = \frac{1}{2}[\frac{\partial^2 D}{\partial \mathbf{x} \partial \mathbf{x}^T}+(\frac{\partial^2 D}{\partial \mathbf{x} \partial \mathbf{x}^T})^T]\Delta \mathbf{x} = \frac{\partial^2 D}{\partial \mathbf{x} \partial \mathbf{x}^T} \Delta \mathbf{x} ∂Δx∂D(x)=0∂Δx∂[(∂x∂D)TΔx]=∂x∂D∂Δx∂[21ΔxT∂x∂xT∂2DΔx]=21[∂x∂xT∂2D+(∂x∂xT∂2D)T]Δx=∂x∂xT∂2DΔx
用到的知识点:1. ∂ ( A B ) ∂ B = A T \frac{\partial(AB)}{\partial B} = A^T ∂B∂(AB)=AT;2. ∂ ( x T A x ) ∂ x = 1 2 ( A + A T ) x \frac{\partial(\mathbf{x}^T A \mathbf{x})}{\partial \mathbf{x}} = \frac{1}{2}(A+A^T) \mathbf{x} ∂x∂(xTAx)=21(A+AT)x;3. ∂ 2 D ∂ x ∂ x T \frac{\partial^2 D}{\partial \mathbf{x} \partial \mathbf{x}^T} ∂x∂xT∂2D是对称矩阵,所以 ∂ 2 D ∂ 2 x ∂ x T = ( ∂ 2 D ∂ x ∂ x T ) T \frac{\partial^2 D}{\partial^2 \mathbf{x} \partial \mathbf{x}^T}=(\frac{\partial^2 D}{\partial \mathbf{x} \partial \mathbf{x}^T})^T ∂2x∂xT∂2D=(∂x∂xT∂2D)T
那么
∂
D
(
x
+
Δ
x
)
∂
Δ
x
=
∂
D
∂
x
+
∂
2
D
∂
x
∂
x
T
Δ
x
\frac{\partial D(\mathbf{x}+\Delta\mathbf{x})}{\partial \Delta \mathbf{x}} = \frac{\partial D}{\partial \mathbf{x}} + \frac{\partial^2 D}{\partial \mathbf{x} \partial \mathbf{x}^T} \Delta x
∂Δx∂D(x+Δx)=∂x∂D+∂x∂xT∂2DΔx
令上面求导等于0,求出
Δ
x
\Delta \mathbf{x}
Δx为
Δ
x
=
−
(
∂
2
D
∂
x
∂
x
T
)
−
1
∂
D
∂
x
\Delta \mathbf{x} = - (\frac{\partial^2 D}{\partial \mathbf{x} \partial \mathbf{x}^T})^{-1} \frac{\partial D}{\partial \mathbf{x}}
Δx=−(∂x∂xT∂2D)−1∂x∂D
把求得的
Δ
x
\Delta\mathbf{x}
Δx代入泰勒展开式
D
(
x
^
)
=
D
(
x
+
Δ
x
)
=
D
(
x
)
+
(
∂
D
∂
x
)
T
Δ
x
−
1
2
(
∂
D
∂
x
)
T
[
(
∂
2
D
∂
x
∂
x
T
)
−
1
]
T
∂
2
D
∂
x
∂
x
T
Δ
x
=
D
(
x
)
+
(
∂
D
∂
x
)
T
Δ
x
−
1
2
(
∂
D
∂
x
)
T
[
(
∂
2
D
∂
x
∂
x
T
)
T
]
−
1
∂
2
D
∂
x
∂
x
T
Δ
x
=
D
(
x
)
+
(
∂
D
∂
x
)
T
Δ
x
−
1
2
(
∂
D
∂
x
)
T
(
∂
2
D
∂
x
∂
x
T
)
−
1
∂
2
D
∂
x
∂
x
T
Δ
x
=
D
(
x
)
+
(
∂
D
∂
x
)
T
Δ
x
−
1
2
(
∂
D
∂
x
)
T
Δ
x
=
D
(
x
)
+
1
2
(
∂
D
∂
x
)
T
Δ
x
=
D
(
x
)
−
1
2
(
∂
D
∂
x
)
T
(
∂
2
D
∂
x
∂
x
T
)
−
1
∂
D
∂
x
\begin{aligned} D(\hat{\mathbf{x}}) = D(\mathbf{x}+\Delta\mathbf{x}) &= D(\mathbf{x}) + (\frac{\partial D}{\partial \mathbf{x}})^T \Delta\mathbf{x} - \frac{1}{2} (\frac{\partial D}{\partial \mathbf{x}})^T [(\frac{\partial^2 D}{\partial \mathbf{x} \partial \mathbf{x}^T})^{-1}]^T \frac{\partial^2 D}{\partial \mathbf{x} \partial \mathbf{x}^T} \Delta \mathbf{x} \\ &= D(\mathbf{x}) + (\frac{\partial D}{\partial \mathbf{x}})^T \Delta\mathbf{x} - \frac{1}{2} (\frac{\partial D}{\partial \mathbf{x}})^T [(\frac{\partial^2 D}{\partial \mathbf{x} \partial \mathbf{x}^T})^T]^{-1} \frac{\partial^2 D}{\partial \mathbf{x} \partial \mathbf{x}^T} \Delta \mathbf{x} \\ &= D(\mathbf{x}) + (\frac{\partial D}{\partial \mathbf{x}})^T \Delta\mathbf{x} - \frac{1}{2} (\frac{\partial D}{\partial \mathbf{x}})^T (\frac{\partial^2 D}{\partial \mathbf{x} \partial \mathbf{x}^T})^{-1} \frac{\partial^2 D}{\partial \mathbf{x} \partial \mathbf{x}^T} \Delta \mathbf{x} \\ &= D(\mathbf{x}) + (\frac{\partial D}{\partial \mathbf{x}})^T \Delta\mathbf{x} - \frac{1}{2} (\frac{\partial D}{\partial \mathbf{x}})^T \Delta \mathbf{x} \\ &= D(\mathbf{x}) + \frac{1}{2} (\frac{\partial D}{\partial \mathbf{x}})^T \Delta \mathbf{x} \\ &= D(\mathbf{x}) - \frac{1}{2} (\frac{\partial D}{\partial \mathbf{x}})^T (\frac{\partial^2 D}{\partial \mathbf{x} \partial \mathbf{x}^T})^{-1} \frac{\partial D}{\partial \mathbf{x}} \end{aligned}
D(x^)=D(x+Δx)=D(x)+(∂x∂D)TΔx−21(∂x∂D)T[(∂x∂xT∂2D)−1]T∂x∂xT∂2DΔx=D(x)+(∂x∂D)TΔx−21(∂x∂D)T[(∂x∂xT∂2D)T]−1∂x∂xT∂2DΔx=D(x)+(∂x∂D)TΔx−21(∂x∂D)T(∂x∂xT∂2D)−1∂x∂xT∂2DΔx=D(x)+(∂x∂D)TΔx−21(∂x∂D)TΔx=D(x)+21(∂x∂D)TΔx=D(x)−21(∂x∂D)T(∂x∂xT∂2D)−1∂x∂D