ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [18] Camera Calibration (2)
    Multiple View Geometry 2021. 4. 21. 11:05

    본 포스트는 학습한 것을 정리할 목적으로 작성되었습니다.

     

    해당 포스트의 내용 및 그림, 수식 등은 'Multiple View Geometry in Computer Vision' 책을 참고하였습니다. 

     

    (1) Zhang's method

     

    Checker board

     

    여기에서는 일반적으로 널리 쓰이는 camera calibration 방법인 Zhang's method에 대하여 설명한다. 이 방법은 checker board를 이용하여 camera matrix를 구한다.

     

    위 checker board의 그림에서 붉은 색 원으로 표시된 점을 coner point라고 한다. 이 checker board의 한 사각형의 길이를 알고 있다는 가정 하에서 가장 왼쪽 위의 coner point를 origin으로 하고 해당 plane을 $Z=0$인 것으로 설정 하여 world coordinate에서의 coner point들의 값을 알 수 있다. 즉 coner point들의 world coordinate system에서의 homogeneous coordinate 값은 $[x \ y \ 0 \ 1]^T$ 이다. 

     

    구하고자 하는 homography는 checker board 평면에서 image 평면으로 투사하는 homography이고 이를 다음과 같은 수식으로 표현할 수 있다.

     

    $$ P \begin{bmatrix} x \\ y \\ 0 \\ 1 \end{bmatrix} = K[R | \textbf{t}] \begin{bmatrix} x \\ y \\ 0 \\ 1 \end{bmatrix} $$

     

    위 수식을 통해 checker board를 고정한 채로 카메라를 움직여 여러 pose에서의 결과들을 활용하여 homography를 추정한다. 이 과정은 아래와 같다.

     

    <Step 1>

     

    $$ K \begin{bmatrix} \textbf{r}_1 & \textbf{r}_2 & \textbf{t} \end{bmatrix} = H \ : \ \boldsymbol{\pi}_0 \rightarrow \boldsymbol{\pi}_{img} $$

     

    $$ K \begin{bmatrix} \textbf{r}_1 & \textbf{r}_2 & \textbf{t} \end{bmatrix} = \begin{bmatrix} \textbf{h}_1 & \textbf{h}_2 & \textbf{h}_3 \end{bmatrix}$$

     

    $$ \begin{bmatrix} \textbf{r}_1 & \textbf{r}_2 & \textbf{t} \end{bmatrix} = K^{-1} \begin{bmatrix} \textbf{h}_1 & \textbf{h}_2 & \textbf{h}_3 \end{bmatrix}$$

     

    $$ K^{-1}\textbf{h}_1 = \textbf{r}_1 $$

    $$ K^{-1}\textbf{h}_2 = \textbf{r}_2 $$

     

    $$ (a) \ \ \textbf{r}_1^T \textbf{r}_2 = \textbf{h}_1^T K^{-T} K^{-1} \textbf{h}_2 = 0 $$

    $$ (b) \ \ \textbf{r}_1^T \textbf{r}_1 = \textbf{r}_2^T \textbf{r}_2 \Leftrightarrow \textbf{h}_1^T K^{-T} K^{-1} \textbf{h}_1 - \textbf{h}_2^T K^{-T} K^{-1} \textbf{h}_2 = 0 $$

     

    $$ K = \begin{bmatrix} f_{m_x} & \rho & x_0 \\ 0 & f_{m_y} & y_0 \\ 0 & 0 & 1 \end{bmatrix} $$

     

    각각의 pose에서 얻은 위 두 방정식 $(a), \ (b)$를 통해 K를 결정하는데, K는 위와 같이 5개의 변수로 결정되는 matrix이다. 따라서 최소 3개의 pose에서의 데이터가 필요하다.

     

    <Step 2>

     

    Step 1에서 $K^{-T}K^{-1}$을 구한 뒤 다음과 같이 Cholesky decomposition을 이용하여 $K$를 구할 수 있다.

     

    $$ K^{-T}K^{-1} = S \ \ S \ is \ symmetric \ positive \ definite $$

    $$ SVD(S) = U^T D U = \bigg{(}U^T \sqrt{D}\bigg{)}\bigg{(}U \sqrt{D}\bigg{)}^T $$

     

    그런 다음, 각 camera pose의 $R$과 $\textbf{t}$를 이용하여 homography $K[R|\textbf{t}]$를 구할 수 있다.

     

     

     

     

     

    댓글

Designed by Tistory.