ぱたへね

はてなダイアリーはrustの色分けができないのでこっちに来た

射影近似

写真から作る3次元CGから。

中心投影の近似の方法

  • 弱中心投影(weak perspective projection)
  • 疑似中心投影(paraperspective projectionb)
  • 平行投影(orthographic projection)は、弱中心投影の特殊なケース
  • アフィン変換は、これらの線形化射影の一般化したもの

カメラは正規化カメラ(f=1)を用い、対象物の重心の三次元座標を(Xc, Yc, Zc)とする。点の三次元座標を(Xc+ΔX, Yc+ΔY, Zc+ΔZ)とすると、投射式はこのようになる。

 \begin{pmatrix} x \\ y \end{pmatrix} =\begin{pmatrix} X_{c}+\Delta X \\ Y_{c}+\Delta Y \end{pmatrix} \frac{1}{Z_{c}+\Delta Z}

これを物体の中心において、テーラー展開をする。

中心投影の零次近似(zero-order approximation)

テーラー展開を零次項までで近似すると、弱中心投影の投射式になる。
 \begin{pmatrix} x \\ y \end{pmatrix} =\frac{1}{Z_{C}}\begin{pmatrix}  X \\ Y \end{pmatrix}

このときの投影行列はこのようになる。
 P_{pp}=\begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & Z_{C}\end{pmatrix}

Zc = 1としたとき、平行投影になる。

中心投影の一次近似(first-order approximation)

テーラー展開を一次項まで近似すると、疑似中心投影の投射式になる。

 \begin{pmatrix} x \\ y \end{pmatrix} =\frac{1}{Z_{C}}\begin{pmatrix} X-\frac{X_{C}}{Z_{C}}Z+X_{C} \\ Y-\frac{X_{C}}{Z_{C}}Z+Y_{C} \end{pmatrix}

このときの投影行列はこのようになる。
 P_{pp}=\begin{pmatrix} 1 & 0 & -\frac{X_{X}}{Z_{C}} & X_{C} \\ 0 & 1 & -\frac{Y_{C}}{Z_{C}} & Y_{C} \\ 0 & 0 & 0 & Z_{C}\end{pmatrix}