单应矩阵

单应矩阵

单应性: 定义为从一个平面到另一个平面的投影映射

为何单应性矩阵只有8个*度?

\[
H= \begin{bmatrix} h_{11} & h_{12} & h_{13} \\ h_{21} & h_{22} & h_{23} \\ h_{31} & h_{32} & h_{33} \end{bmatrix}
\]

\[
s\begin{bmatrix}u\\v\\1\end{bmatrix}
= \begin{bmatrix} h_{00} & h_{01} & h_{02} \\ h_{10} & h_{11} & h_{12} \\ h_{20} & h_{21} & h_{22} \end{bmatrix}\begin{bmatrix}x\\y\\1\end{bmatrix}
= \begin{equation} {h_{22}} \begin{bmatrix} \frac{h_{00}}{h_{22}} &\frac{h_{01}}{h_{22}} &\frac{h_{02}}{h_{22}} \\ \frac{h_{10}}{h_{22}} &\frac{h_{11}}{h_{22}} &\frac{h_{12}}{h_{22}} \\ \frac{h_{20}}{h_{22}} &\frac{h_{21}}{h_{22}} &1 \end{bmatrix} \end{equation}\begin{bmatrix}x\\y\\1\end{bmatrix}
\]

\[
\frac{s}{h_{22}}\begin{bmatrix}u\\v\\1\end{bmatrix}
= \begin{equation} \begin{bmatrix} \frac{h_{00}}{h_{22}} &\frac{h_{01}}{h_{22}} &\frac{h_{02}}{h_{22}} \\ \frac{h_{10}}{h_{22}} &\frac{h_{11}}{h_{22}} &\frac{h_{12}}{h_{22}} \\ \frac{h_{20}}{h_{22}} &\frac{h_{21}}{h_{22}} &1 \end{bmatrix} \end{equation}\begin{bmatrix}x\\y\\1\end{bmatrix}
\]

通过换元法可得

\[
s\begin{bmatrix}u\\v\\1\end{bmatrix}
= \begin{bmatrix} h_{00} & h_{01} & h_{02} \\ h_{10} & h_{11} & h_{12} \\ h_{20} & h_{21} & 1 \end{bmatrix}\begin{bmatrix}x\\y\\1\end{bmatrix}
\]

\[
\begin{equation} \left\{ \begin{aligned} su&=h_{00}x + h_{01}y + h_{02}\\ sv&=h_{10}x + h_{11}y + h_{12}\\ s&=h_{20}x + h_{21}y + 1 \\ \end{aligned} \right. \end{equation}
\]

化简可得

\[
\begin{equation}
\begin{bmatrix}-x & -y &-1&0&0&0&xu&yu&u \\ 0&0&0& -x & -y &-1&xv&yv&v \\ \end{bmatrix} \begin{bmatrix}h_{00}\\h_{01}\\h_{02}\\h_{h10}\\h_{11}\\h_{12}\\h_{20}\\h_{21}\\1\end{bmatrix} =0 \end{equation}
\]


\[
A = \begin{bmatrix}-x & -y &-1&0&0&0&xu&yu&u \\ 0&0&0& -x & -y &-1&xv&yv&v \\ \end{bmatrix} \\
h = \begin{bmatrix}h_{00}\\h_{01}\\h_{02}\\h_{h10}\\h_{11}\\h_{12}\\h_{20}\\h_{21}\\1\end{bmatrix} \\
\]

\(\bf{Ah=0}\), 8*度, 所以需要四个点对, 具体求解见OPENCV中常用的四点求解法, 解为A的右奇异矩阵最小特征值对应的特征向量, 具体解法见 求解Ax=0

上一篇:Matlab数字图像处理学习记录【5】——图像复原


下一篇:【吴恩达机器学习】线性回归 Linear Regression