Image Formation: DD2423 Image Analysis and Computer Vision
Image Formation: DD2423 Image Analysis and Computer Vision
IMAGE FORMATION
Mårten Björkman
November 8, 2013
1
Image formation
2
Image formation
3
Basic concepts
• Irradiance E: Amount of light falling on a surface, in power per unit area (watts
per square meter). If surface tilts away from light, same amount of light strikes
bigger surface (foreshortening → less irradiance).
• Radiance L: Amount of light radiated from a surface, in power per unit area
per unit solid angle. Informally “Brightness”.
4
Light source examples
Left: Forest image (left): sun behind observer, (right): sun opposite observer
Right: Field with rough surface (left): sun behind observer, (right): sun opposite observer.
5
Digital imaging
6
Imaging acqusition - From world point to pixel
7
Steps in a typical image processing system
8
Pinhole camera or “Camera Obscura”
9
Pinhole camera and perspective projection
• A mapping from a three dimensionsal (3D) world onto a two dimensional (2D)
plane in the previous example is called perspective projection.
• A pinhole camera is the simplest imaging device which captures the geometry
of perspective projection.
• Rays of light enter the camera through an infinitesimally small aperture.
• The intersection of light rays with the image plane form the image of the object.
10
Perspective projection
11
Pinhole camera - Perspective geometry
Y
X
lane
ep
ag
im
optical
center
Z
optical axis
p=(x,y,f) P=(X,Y,Z)
image coordinates world coordinates
focal length
12
Lenses
13
Imaging geometry - Basic camera models
Image Image
focal
point
14
Projection equations
Y
y
f
Z
• Perspective mapping
x X y Y
= , =
f Z f Z
• Orthographic projection
x = X, y = Y
• Scaled orthography - Z0 constant (representative depth)
x X y Y
= , =
f Z0 f Z0
15
Perspective transformation
16
Perspective transformation (cont)
parallel
lines
vanishing
point
image
camera
centre
Each set of parallel lines meet at a different vanishing point - vanishing point as-
sociated to this direction. Sets of parallel lines on the same plane lead to collinear
vanishing points - the line is called the horizon for that plane.
17
Homogeneous coordinates
18
Computing vanishing points
19
Homogeneous coordinates (cont)
xc f kX X yc f kY Y
x= = = f , y= = =f
c kZ Z c kZ Z
20
Transformations in homogeneous coordinates
• Translation
X X ∆X
Y → Y + ∆Y
Z Z ∆Z
X 1 0 0 ∆X X
Y 0 1 0 ∆Y
Y
→
Z 0 0 1 ∆Z Z
1 0 0 0 1 1
• Scaling
X SX 0 0 0 X
Y 0 SY 0 0 Y
→
Z 0 0 SZ 0 Z
1 0 0 0 1 1
21
Transformations in homogeneous coordinates II
22
Transformations in homogeneous coordinates III
23
Perspective projection - Extrinsic parameters
24
Intrinsic camera parameters
Due to imperfect placement of the camera chip relative to the lens system,
there is always a small relative rotation and shift of center position.
25
Intrinsic camera parameters
fu γ u0 fu γ u0 0
K = 0 fv v0 , P = K 0 = 0 fv v0 0
0 0 1 0 0 1 0
26
Example: Perspective mapping
27
Example: Perspective mapping in stereo
28
Mosaicing
29
Exercise
Assume you have a point at (3m, −2m, 8m) with respect to the cameras coordinate
system. What is the image coordinates, if the image has a size (w, h) = (640, 480)
and origin in the upper-left corner, and the focal length is f = 480?
30
Exercise
Assume you have a point at (3m, −2m, 8m) with respect to the cameras coordinate
system. What is the image coordinates, if the image has a size (w, h) = (640, 480)
and origin in the upper-left corner, and the focal length is f = 480?
Answer:
X w
x= f + = (480 ∗ 3/8 + 640/2) = 500
Z 2
Y h
y = f + = (−480 ∗ 2/8 + 480/2) = 120
Z 2
31
Approximation: affine camera
32
Approximation: affine camera
• Basic properties
– linear transformation (no need to divide at the end)
– parallel lines in 3D mapped to parallel lines in 2D
Angles are not preserved!
33
Planar Affine Transformation
35
Sampling and quantization
36
Sampling and quantization
37
Factors that affect quality
38
Different image resolutions
39
Different number of bits per pixel
40
Image warping
Resample image f (x, y) to get a new image g(u, v), using a coordinate trans-
formation: u = u(x, y), v = v(x, y).
Examples of transformations:
41
Image Warping
• For each grid point in (u, v) domain compute corresponding (x, y) values.
Note: transformation is inverted to avoid holes in result.
• Create g(u, v) by sampling from f (x, y) either by:
– Nearest neighbour look-up (noisy result)
– Bilinear interpolation (blurry result)
43
Summary of good questions
44
Readings
45