티스토리 뷰

728x90

자료 출처: CS5670 CamerasCMU Geometric camera models

 

저에게 해당 내용들은 굉장히 어렵고 생소합니다. 물론 열심히 공부하고 이해한 것을 바탕으로 정리를 하겠지만, 설명이 다소 장황하고 방대해질 것 같습니다. 핵심 내용만을 보고 싶다면 위의 자료 출처를 참고 부탁드립니다. 감사합니다.

 

 

 

 

 

지난 포스팅[CS5670] Lecture 10: Cameras (1) pinhole, lens camera

 

지난 포스팅의 경우, camera에 대한 기본적인 이론에 대해 정리하였고, 이번 포스팅은 camera를 배우는 이유가 되는 computer vision을 위한 geometric modeling 부분을 살펴볼 예정입니다. 

 

이제부터 Coordinate system을 통해 projection을 modeling하는 것, Perspective Projection, Orthographic projection, Camera parameters, Camera matrix, Extrinsics, Projection matrix, ... etc 에 대해 다루게 될 예정입니다.

 

homogeneous coordinate system에 대해 잘 모르신다면 Homogeneous coordinates와 Homography 개념 포스팅을 참고해주세요. 물론 제 포스팅보다 더 좋은 포스팅은 구글에 검색하면 많답니다.

 


 

Geometric Model: A Pinhole Camera

  • Center of projection
  • Principal point (=focal point)
  • Focal length
  • Principal axis

 

pinhole camera를 geometric model로 표현하면 위와 같습니다. 이미지가 투영되는 COP에서 focal point와 focal length, principal axis를 살펴볼 수 있습니다.

 

The camera as a coordinate transformation

 

camera는 사실 coordinate transformation의 일종입니다.

 

camera는 the 3D world를 2D image로 mapping합니다.

 

  • 3D world to a 2D image
  • 3D object → 3D to 2D transform(camera) → 2D image → 2D to 2D transform (image warping)

 

이를 표현해주는 것이 homogeneous coordinates입니다.

 

$x = PX$

 

  • $x, X$: homogeneous coordinates
  • $x$: 2D image point ( pixel ($x, y$))
  • $P$: camera matrix
  • $X$: 3D world point

 

뭔가 aiffine과 perspective에서 봤던 3x3 matrix 형태와 조금 다르긴 하네요. 그러면 coordinate system으로 이루어진 pinhole camera를 다시 살펴보겠습니다.

 


 

Modeling projection

 

 

The coordinate system

  • pinhole model을 approximation으로 사용한다
  • 원점에 optical center (Center of Projection, COP)을 놓는다
  • COP 앞에 image plane (Projection plane)을 놓는다
  • camera는 z-aixs를 내려다보고, y축은 아래를 가르킨다

 

Projection equations

  • $(x,y,z)$에서 COP까지의 ray인 PP(principal point)와의 intersection 계산
  • Derived using similar triangles
    • $(x,y,z)$ → $ (f\frac{x}{z}, f{y}{z}, f)$
  • 마지막 coordinate를 버리며 projection을 얻습니다.
    • $(x,y,z)$ → $ (f\frac{x}{z}, f{y}{z})$

 

아래의 형태는 linear transformation인가요?

 

homogeneous image coordinates

 

아닙니다. z-axis 방향으로는 non-linear하기 때문입니다.

 

따라서 homogeneous coordinate를 통해 non-linear함을 해결하려고 1개의 coordinate를 추가합니다.

 

homogeneous scene coordinates

 

Converting from homogeneous coordinates (반대로 차원을 줄이기 위해선 마지막 값으로 나누면 됩니다)

 

 

 


 

Perspective Projection

 

Projection is a matrix multiply using homogeneous coordinates:

 

투영은 동차좌표계를 사용하여 행렬의 곱이라 볼 수 있습니다. 

 

 

  • This is known as perspective projection
    • The matrix is the projection matrix

3x4 matirx와 4x1 matrix의 곱을 통해 3x1 matrix를 얻고, 세 번째 좌표로 나누어 2-dim으로 줄어든 좌표를 얻을 수 있습니다.

 

How does scaling the projection matrix change the transformation?

 

 

 

Scaling a projection matrix produces an equivalent projection matrix!

 


 

Orthographic camera

 

When can we assume a weak perspective camera?

 

1. When the scene (or parts of it) is very far away.

 

 

Weak perspective projection applies to the mountains.

 

2. When we use a telecentric lens.

 

 

Orthographci camera는 perspective projection의 special case라고 합니다.

 

  • constant magnification은 1이다
  • camera와 image origin 사이의 이동이 없다
  • world와 camera coodinate system이 동일하다

 

고 보는 것인데요.

 

 

행렬로 표현하면 아래와 같습니다.

 

 

(아직까진 이 matrix 세계를 다 이해하지 못하겠습니다... 이해하면 추가 보충하겠습니다)

Variants of orthographic projection

 

  • Scaled orthographic
    • Also called "weak perspective"

  • Affine projection
    • Also called "paraperspective"

 

 


 

Dimensionality Reduction Machine (3D to 2D)

 

 

3D에서 2D로 차원을 축소하게 되면 잃게 되는 정보가 2가지 있는데,

 

첫 번째로는, 각도(angle)

두 번째로는, 거리(distance or lengths)

 

입니다.

 


Projection properties

  • Many to one: any points along same ray map to same
  • point in image
  • Points → points
  • Lines → lines ( collinearity is preserved)
    • But line through focal point projects to a point
  • Planes → planes (or half planes)
    • But plane through focal point projects to line

 

  • Parallel lines converge at a vanishing point
    • Each direction in space has its own vanishing point
    • But parallel lines parallel to the image plane remain parallel

 

평행하는 선은 사진상으로 vanishing point가 되어버립니다. 공간상 각 방향은 하나의 vanishing point를 갖게 되지만, 이미지 평면에서 평행한 선은 평행이 유지됩니다.

 


 

Camera parameters

 

How can we model the geometry of a camera?

 

 

세 가지 중요한 좌표 시스템을 갖습니다.

 

1. World coordinates

2. Camera coordinates

3. Image coordinates

 

How do we project a given world point ($x, y, z$) to an image point?

 

Coordinate frames

 

 

Camera parameters

 

point ($x, y, z$)를 world coordinate에서 camera로 project 시키려면

 

1. camera coordinate로 transform한 ($x, y, z$)

2. world coordinate에서 camera position을 알아야 하고

3. world coordinate에서 camera orientation을 알아야 한다.

4. image plane으로 project 시켜서 image (pixel) coordinate를 얻어야 한다.

5. 그러기 위해 camera intrinsics를 알아야 함

 

 

 

 

 

 

 

 

728x90
댓글