ぱたへね

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

2次元変換の階層

Multiple View Geometry in Computer Vision 2.4から。2次元の画像変換における階層構造のまとめ。座標は全て同次座標(homogeneous coordinate)。

Class I Isometries transformations

対象物の移動、再配置。

行列表現

\begin{pmatrix} x' \\ y' \\ z' \end{pmatrix} =\begin{pmatrix} \epsilon \cos \theta  & -\epsilon \sin \theta  & t_{x} \\ \epsilon \sin \theta  & \epsilon \cos \theta  & t_{y} \\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} x \\ y \\ 1 \end{pmatrix}

ベクトル表現

 {\mathbf{x\/}'=H_{E} \mathbf{x\/}=\begin{pmatrix} \mathbf{R\/} & \mathbf{t\/} \\ \mathbf{0\/}^{\mathbf{T\/}} & 1 \end{pmatrix} \mathbf{x\/}

特徴
  • εは±1の値を取る。εが1の時、ユークリッド変換(移動と回転)と同じ。εが-1の時向きが反転する。
  • Rは2x2の回転行列
  • 長さ、角度、面積が不変量
  • 自由度は3

Class II Similarity transformations

Isometries transformations に拡大縮小を追加。

行列表現

\begin{pmatrix} x' \\ y' \\ z' \end{pmatrix} =\begin{pmatrix} s \cos \theta  & - s \sin \theta  & t_{x} \\ s \sin \theta  & s \cos \theta  & t_{y} \\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} x \\ y \\ 1 \end{pmatrix}

ベクトル表現

\mathbf{x\/}'=H_{S}\mathbf{x\/}=\begin{pmatrix} s \mathbf{R\/} & \mathbf{t\/} \\ \mathbf{0\/}^{\mathbf{T\/}} & 1 \end{pmatrix} \mathbf{x\/}

特徴
  • sはスケーリングの係数
  • 角度と長さの比が不変量
  • 自由度は4

Class III Affine transformations

アフィン変換

行列表現

\begin{pmatrix} x' \\ y' \\ z' \end{pmatrix} =\begin{pmatrix} a_{11} & a_{12} & t_{x} \\ a_{21} & a_{22} & t_{y} \\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} x \\ y \\ 1 \end{pmatrix}

ベクトル表現

\mathbf{x\/}'=H_{A}\mathbf{x\/}=\begin{pmatrix} \mathbf{A\/} & \mathbf{t\/} \\ \mathbf{0\/}^{\mathbf{T\/}} & 1 \end{pmatrix} \mathbf{x\/}

特徴
  • Aは2x2の非正則行列
  • 面積の比が不変量。平行な直線は変換後も平行。平行線の一部である直線の長さの比も不変。
  • 自由度は6

Class IV Projective transformations

投影変換

行列表現

\begin{pmatrix} x_{1}' \\ x_{2}' \\ x_{3}' \end{pmatrix} =\begin{pmatrix} h_{11} & h_{12} & h_{13} \\ h_{21} & h_{22} & h_{23} \\ h_{31} & h_{32} & h_{33} \end{pmatrix} \begin{pmatrix} x_{1} \\ x_{2} \\ x_{3} \end{pmatrix}

ベクトル表現

\mathbf{x\/}'=H_{P}\mathbf{x\/}=\begin{pmatrix} \mathbf{R\/} & \mathbf{t\/} \\ \mathbf{v\/}^{\mathbf{T\/}} & v\end{pmatrix}\mathbf{x\/}

特徴
  • ベクトルv=(v1,v2)^T
  • Hpの各係数をスカラー倍(0を除く)しても同じ意味を持つ。
  • 交差比(cross-rate)が不変量
  • 自由度は8 (Hpの係数が9個だが、係数の定数倍は同じ意味をもつので)