四点DLT (Direct Linear Transformation) 算法

\(\mathrm{x}_{i}\) 表示变化前的齐次坐标
\(\mathbf{x}_{i}^{\prime}\) 表示变化后的齐次坐标

我们需要求到一个 \(3\times3\) 的变换矩阵 \(\mathrm{H}\) , 使得

\[\mathbf{x}_{i}^{\prime} \times \mathrm{Hx}_{i}=\mathbf{0} \]

\(\mathbf{h}^{j\top}\) 表示 \(\mathrm{H}\) 的第 \(j\) 行 , 即 \(\mathrm{H}=[~\mathbf{h}^{1\top};~ \mathbf{h}^{2\top}; ~ \mathbf{h}^{3\top}~]\)

\[\mathrm{H} \mathbf{x}_{i}=\left(\begin{array}{c} \mathbf{h}^{1 \top} \mathbf{x}_{i} \\ \mathbf{h}^{2 \top} \mathbf{x}_{i} \\ \mathbf{h}^{3 \top} \mathbf{x}_{i} \end{array}\right) \]

\(\mathbf{x}_{i}^{\prime}\) 我们写成 \(\mathbf{x}_{i}^{\prime}=\left(x_{i}^{\prime}, y_{i}^{\prime}, w_{i}^{\prime}\right)^{\top}\)

\(\mathbf{x}_{i}^{\prime} \times \mathrm{Hx}_{i}\) 可改写成

\[\mathbf{x}_{i}^{\prime} \times \mathrm{Hx}_{i}=\left(\begin{array}{c} y_{i}^{\prime} \mathbf{h}^{3 \top} \mathbf{x}_{i}-w_{i}^{\prime} \mathbf{h}^{2 \top} \mathbf{x}_{i} \\ w_{i}^{\prime} \mathbf{h}^{1 \top} \mathbf{x}_{i}-x_{i}^{\prime} \mathbf{h}^{3 \top} \mathbf{x}_{i} \\ x_{i}^{\prime} \mathbf{h}^{2 \top} \mathbf{x}_{i}-y_{i}^{\prime} \mathbf{h}^{1 \top} \mathbf{x}_{i} \end{array}\right) \]

由于 \(\mathbf{h}^{j\top}\mathrm{x}_i=\mathrm{x}_{i}^{\top}\mathbf{h}^j\), 我们可以将上式改写成

\[\left[\begin{array}{ccc} \mathbf{0}^{\top} & -w_{i}^{\prime} \mathbf{x}_{i}^{\top} & y_{i}^{\prime} \mathbf{x}_{i}^{\top} \\ w_{i}^{\prime} \mathbf{x}_{i}^{\top} & \mathbf{0}^{\top} & -x_{i}^{\prime} \mathbf{x}_{i}^{\top} \\ -y_{i}^{\prime} \mathbf{x}_{i}^{\top} & x_{i}^{\prime} \mathbf{x}_{i}^{\top} & \mathbf{0}^{\top} \end{array}\right]\left(\begin{array}{c} \mathbf{h}^{1} \\ \mathbf{h}^{2} \\ \mathbf{h}^{3} \end{array}\right)=\mathbf{0} \]

简写成 \(\tilde{A}_i\mathbf{h}=\mathbf{0}\), \(\tilde{A}_i\)\(3\times9\) 矩阵, \(\mathbf{h}\) 是 9 维向量

由于 \(\tilde{A}_i\) 的前两行加到第三行会导致第三行变为零, 所以 \(\tilde{A}_i\) 只有前两行有效

所以化简为

\[\left[\begin{array}{ccc} \mathbf{0}^{\top} & -w_{i}^{\prime} \mathbf{x}_{i}^{\top} & y_{i}^{\prime} \mathbf{x}_{i}^{\top} \\ w_{i}^{\prime} \mathbf{x}_{i}^{\top} & \mathbf{0}^{\top} & -x_{i}^{\prime} \mathbf{x}_{i}^{\top} \end{array}\right]\left(\begin{array}{c} \mathbf{h}^{1} \\ \mathbf{h}^{2} \\ \mathbf{h}^{3} \end{array}\right)=\mathbf{0} \]

记成 \({A}_i\mathbf{h}=\mathbf{0}\)

由于 \(\mathbf{h}\) 有 9 个未知量, 但只有8条方程, 因此 \(\mathbf{h}\) 会有无穷个解, 这时我们只需加入限定条件 \(||\mathbf{h}||=1\) 即可将解固定

引用: Multiple View Geometry in Computer Vision Second Edition

posted @ 2022-10-03 10:23  WilliamHuang2022  阅读(142)  评论(0编辑  收藏  举报