跳转至

Lecture 2 Image Formation

Camera and Lens

Pinhole Camera

A barrier to block off most of the rays. The opening is the aperture 光圈.

lec2_0

Flaws

  • Less light gets through.
  • Diffraction effects (衍射).

Lens 透镜

lec2_1
\[ \frac{1}{i} + \frac{1}{o} = \frac{1}{f}. \]

Focal length \(f\) 焦距

If \(o = \infty\), then \(f = i\).

Magnification \(m\) 放大率

\[ m = \frac{h_i}{h_o}. \]
lec2_2

Field of View (FOV) 视野

Factor

  • Focal Length.
    • Longer focal length, Narrower angle of view. Vice versa.
lec2_3

Note

50mm / 46° (and full frame) is the most similar FOV with human eyes. Thus 50mm lens is called standard lens (标准镜头).

  • telephoto lens (长焦镜头,望远镜头): 视野小, 放大率大.
  • short focal lens (短焦镜头,广角镜头); 视野大, 放大率小.
  • Sensor Size
    • Bigger sensor size, Wider angle of view. Vice versa.
lec2_4

Aperture 光圈

The representation of aperture is its Diameter \(D\).

F-Number

\[ N = \frac{f}{D}\ \ \text{ (mostly greater than $1$, around $1.8 \sim 22$)}. \]

Lens Defocus

lec2_5

Blur Circle Diameter (光斑半径)

\[ b = \frac{D}{i'}|i' -i|,\ \ b \propto D \propto \frac{1}{N}. \]

Focusing 对焦

lec2_6

Depth of Field (DoF) 景深

lec2_7
\[ {\tt DoF} = o_2 - o_1 = \frac{2of^2cN(o-f)}{f^4-c^2N^2(o-f)^2}. \]

From the equation above, we can find that DoF is almost proportional to \(N\), and thus the Larger aperture, the Smaller F-Number and the Smaller DoF.

How to blur the background

  • Large aperture.
  • Long focal length.
  • Near foreground.
  • Far background.

Geometric Image Formation(定位)

Camera model

lec2_8

\[ \begin{bmatrix} u \\ v \end{bmatrix} = \begin{bmatrix} f \cfrac{x}{z} \\ f \cfrac{y}{z} \end{bmatrix}. \]

Homogeneous Coordinates / Projective Coordinates

Suppose that \(\begin{bmatrix} x \\ y \\ w \end{bmatrix}\) is the same as \(\begin{bmatrix} x/w \\ y/w \\ 1 \end{bmatrix}\), then we get

\[ \begin{bmatrix} f & 0 & 0 & 0 \\ 0 & f & 0 & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix} \begin{bmatrix} x \\ y \\ z \\ 1 \end{bmatrix} = \begin{bmatrix} fx \\ fy \\ z \\ \end{bmatrix} \cong \begin{bmatrix} f\cfrac{x}{z} \\ f\cfrac{y}{z} \\ 1 \end{bmatrix}. \]

For convenience of dicussion, we can also put the image plane in front of the camera (opposite to the previous picture).

lec2_9

Perspective Projection

  • What are Preserevd: Straight lines are still straight.
  • What are Lost: Length and Angle.

Vanishing Points

lec2_10
lec2_11

Properties

  • Any two parallel lines have the same vanishing point \(\bf v\).
    • \(\bf v\) can be outside the image frame or at infinity.
  • Line from \(\bf C\) to \(\bf v\) is parallel to the lines.

Vanishing Lines

Multiple vanishing points compose the vanishing lines.

The direction of the vanishing line tells us the orientation of the plane.

lec2_12

Distortion

  • Converging verticals.

lec2_13
Problem and Solution (View Camera 移轴相机)

  • Exterior columns appear bigger. (Due to lens flaws.)

    lec2_14

  • Radial distortion. (Due to imperfect lens.)

lec2_15
\[ \begin{aligned} r^2 &= {x'}_n^{2} + {y'}_n^{2}, \\ {x'}_d &= {x'}_n(1 + \kappa_1r^2 + \kappa_2r^4), \\ {y'}_d &= {y'}_n(1 + \kappa_1r^2 + \kappa_2r^4). \\ \end{aligned} \]

Solution

Take a photo of a grid at the same point and then use the mathematics to calculate and correct radial distortion.

Orthographic Projection

lec2_16
\[ \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x \\ y \\ z \\ 1 \end{bmatrix} = \begin{bmatrix} x \\ y \\ 1 \\ \end{bmatrix} \Rightarrow (x, y). \]

Photometric Image Formation(定颜色/亮度)

Image Sensor 传感器

  • CMOS
  • CCD (Charge Coupled Device)

Shutter 快门

Shutter speed controls exposure time.

Color Sensing

  • Color Spaces

    • RGB
    • HSV
  • Practical Color Sensing: Bayer Filter

lec2_17

Shading 着色

lec2_18

BRDF (Bidirectional Reflectance Distribution Function)

lec2_19
\[ L_r(\hat{\textbf{v}_r};\lambda) = \int L_i(\hat{\textbf{i}_r};\lambda)f_r(\hat{\textbf{v}_r}, \hat{\textbf{v}_i}, \hat{\textbf{n}}; \lambda)\cos^+\theta_i\ d\hat{\textbf{v}_i}. \]

Diffuse (Lambertian) Reflection

  • Shading independent of view direction.
lec2_20

Specular Term

  • Intensity depends on view direction.
lec2_21

Blinn-Phong Reflection Model

lec2_22
\[ L = L_a + L_d + L_s = k_aI_a + k_d(I/r^2)\max(0, \textbf{n}\cdot\textbf{l}) + k_s(I/r^2)\max(0, \textbf{n}\cdot\textbf{h})^p. \]

最后更新: 2023.11.21 17:00:13 CST
创建日期: 2022.11.08 20:35:08 CST