Camera models

  • Projective camera recap: $P’=K\begin{bmatrix}R&T\end{bmatrix}P_w$

Weak perspective model

1

  • 기존 모델은 normal camera model, projective, perspective model이라고 하는 것 같다.
  • Weak perspective model에선 먼저 WRS의 점들을 reference plane $\Pi$에 직교투사한다. $P, Q, R$이 $P_{-},Q_{-},R_{-}$로 직교투사 되었다고 한다면, 이제 이 점들을 projective transformation을 통해 image plane위의 점 $p’, q’, r’$으로 옮긴다.
  • 카메라까지의 거리가 직교투사하는 거리에 비해 엄청 크기 때문에, 나쁘지 않은 근사치다.
  • 이 경우의 maginfication은 $m=\frac{f’}{z_0}$이며, projection matrix는

\( M=\begin{bmatrix}A&b\\0&1\end{bmatrix} \) 고 증명은 생략한다. 왜??? \( M=K\begin{bmatrix}1&0&0&0\\0&1&0&0\\0&0&0&1\end{bmatrix}\begin{bmatrix}R&T\\0&1\end{bmatrix} \)

같은 꼴로 나오기 때문(정확하진 않음; 중간 행렬이 좀 이상한데?)

  • projection matrix가 단순해졌으므로, $P’=(m_1 P, m_2 P)$로 기존 perspective model 케이스보다 훨씬 간결해진다. z축 값을 고정해서 나온 효과.

Orthogonal projection model

  • 아예 한 술 더 떠서 사물에서 이미지 평면까지의 거리가 무한하다고 가정하자. 그럼 입사각은 수평해지게 된다.

2

  • 이 결과 아예 각도를 무시하므로, 맺힌 상의 좌표=사물의 좌표가 된다. 즉, $(x’, y’)=(x,y)$

이 부정확한 모델들의 장단점

  • 수학적 계산이 간단함
  • 사물이 작고 카메라로부터 먼 경우에 주로 사용
  • 이해가 쉬움
  • 핀홀 perspective model이 3d-2d 매핑을 모델링함에 있어 훨씬 정확함

    →동작의 구조나 SLAM(Simultaneous localization and mapping)등에 사용됨

Camera Calibration Problem

  • 카메라의 intrinsic parameter값을 바로 알 수 있지는 않지만, 그 카메라가 찍은 사진은 구할 수 있다.
  • 즉, 주어진 이미지로부터 extrinsic, intrinsic parameter를 구한다→Camera Calibration Problem
  • 여러 점으로부터 식이 $p_i=(u_i, v_i)=(\frac{m_1 P_i}{m_3 P_i}, \frac{m_2 P_i}{m_3 P_i})$로 2개씩 주어지고, 카메라 행렬은 11개의 DoF를 갖고 있으므로, 최소 6개의 점이 필요하단 계산이 나온다.
  • 실제론 노이즈가 심하므로 더 많은 점을 사용한다.
  • $n$개의 점으로 유도된 식을 $(m_1, m_2, m_3)$에 대해 식으로 쓰면,

\( \begin{bmatrix}P_1^\top&0^\top&-u_1P_1^\top\\0^\top&P_1^\top&-v_1P_1^\top\\ &\vdots&\\P_n^\top&0^\top&-u_nP_n^\top\\0^\top&P_n^\top&-v_nP_n^\top\end{bmatrix}\begin{bmatrix}m_1^\top\\m_2^\top\\m_3^\top\end{bmatrix}=\mathbf{P}m=0 \)

  • 해가 trivial해지거나 not unique할 경우를 막기 위해, 다음 조건으로 계산한다

\( \min_{||m||^2=1}||\mathbf{P}m||^2 \)

  • 이 경우 해는 $\mathbf{P}$를 SVD해서 나온 $V$행렬의 마지막 열

풀이:

\( \min_{||m||^2=1}||\mathbf{P}m||^2\\ =\min_{||V^\top m||^2=1}||UDV^\top m||\\ =\min_{||y||^2=1}||Dy||^2 \)

대각행렬의 singular value가 desescending order이므로, 이를 만족하는 $y=(0, \cdots, 0, 1)^\top=V^\top m$. 즉 $m=V\cdot (0,\cdots,0,1)^\top=\text{last column of }V$

  • 행렬은 구했다. 각 paramter도 이제 구해야지?
    Intrinsic parameter: \( \rho=\pm\frac{1}{||a_3||}\\ c_x=\rho^2(a_1\cdot a_3)\\ c_y=\rho^2(a_2\cdot a_3)\\ \theta=\cos^{-1}(\frac{(a_1\times a_3)\cdot(a_2\times a_3)}{||a_1\times a_3||\cdot||a_2\times a_3||})\\ c_x=\rho^2||a_1\times a_3||\sin\theta \\ c_y=\rho^2||a_2\times a_3||\sin\theta \) Extrinsic parameter: \( r_1=\frac{a_2\times a_3}{||a_2\times a_3||}\\ r_2=r_3\times r_1\\ r_3=\rho a_3\\ T=\rho K^{-1} b \)

  • 주의할 점: 점들이 같은 평면에 있다거나 해서 식이 안풀리는 degenerate case가 있음

Camara Calibration with Radial Distortion

  • 실제 렌즈는 distortion이 발생한다.

3

  • distortion이 xy축에 대해 보통 대칭이므로, 다음과 같이 모델링 할 수 있다.

\( QP_i=\begin{bmatrix}\frac{1}{\lambda}&0&0\\0&\frac{1}{\lambda}&0\\0&0&1\end{bmatrix}MP_i=\begin{bmatrix}u_i\\v_i\end{bmatrix}=p_i \)

  • 이 경우 얻어지는 식은 비선형 방정식이라, 뉴턴법, 레벤버그-마쿠르트 법 등을 사용하여 해결
  • $u_i/v_i$를 이용하는 방법도 있다. 이 경우 비슷하게 SVD를 통해 $M$의 첫 두 열을 계산할 수 있으며, 세번째 열과 distortion에 비선형 방정식 풀이를 적용한다.