1
EC 500 A1: �Camera Modeling (Cont.)
& Image Processing
2
Self introduction
Today
3
What is the data structure of images?
4
Regular spatial grid
Homogeneous and heterogeneous coordinates
5
heterogeneous
homogeneous
Chaining transformations, using homogeneous system
6
From 3D to 2D and back: two 3D coordinate systems
7
Image
Image formation
Know how to convert coordinates
Know how to convert coordinates back
Homogeneous coordinates for 3D points
8
heterogeneous
homogeneous
Perspective projection in homogeneous coordinates
9
Camera-intrinsic parameters
10
(X, Y, Z)
n
m
11
Questions?
Camera-extrinsic parameters
12
R: 3D rotation between coordinate systems
T: 3D translation between coordinate systems
Camera-extrinsic parameters
13
heterogeneous
homogeneous
Camera-extrinsic parameters
14
homogeneous
15
Questions?
Full camera model (intrinsic + extrinsic)
16
Full camera model (intrinsic + extrinsic)
Camera
3D
Intrinsic
Rotation
Translation
18
Questions?
Glance at camera calibration
19
Going from 2D to 3D
20
What is 3D reconstruction nowadays?
What is 3D reconstruction nowadays?
[Image credit: Sooyoung Jeon]
[Image credit: Sooyoung Jeon]
Today
25
Today
26
Notations (self-check)
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Signal and system
28
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Neural network image classifier
Continue and discrete signal
29
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Sampling
Sampling period
Image?
Image is a discrete signal
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
…
…
…
…
…
Why do we study images as signals?
32
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Why do we study images as signals?
33
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Geometric transformation vs. image processing
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Today
35
System is to process signal
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Linear system
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Linear system (mathematical definition)
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
You saw this before
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Linear system: 1D & 2D
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
2D signal (e.g., image)
1D signal (e.g., sound)
n
k
[n, m]
k
l
Today
41
Linear translation invariant (LTI) system
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Linear translation invariant (LTI) system
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Linear translation invariant (LTI) system
Bird detection
[140, 25; 30, 20]
Bird detection
[40, 100; 30, 20]
Bird detection
Convolution is an LTI system
45
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Relationship?
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Linear
LTI
Relationship?
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Linear
LTI
Relationship?
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Linear
LTI
Relationship
Linear
Convolutional
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
50
Questions?
LTI system: 1D & 2D
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
1D signal (e.g., sound)
n
k
n
LTI system: 1D & 2D
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
2D signal (e.g., image)
2D convolutions
53
Convolution kernel
(3-by-3)
1 | 1 | 1 |
1 | 1 | 0 |
1 | 0 | 0 |
0 | 0 | 0 | 0 | 1 |
0 | 0 | 0 | 1 | 1 |
0 | 0 | 1 | 1 | 1 |
0 | 1 | 1 | 1 | 1 |
1 | 1 | 1 | 1 | 1 |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
Convolutions =
Flip + Inner product
6
Input image
Output image
0 | 0 | 1 |
0 | 1 | 1 |
1 | 1 | 1 |
2D convolutions
0 | 0 | 0 | 0 | 1 |
0 | 0 | 0 | 1 | 1 |
0 | 0 | 1 | 1 | 1 |
0 | 1 | 1 | 1 | 1 |
1 | 1 | 1 | 1 | 1 |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
1
0 | 0 | 1 |
0 | 1 | 1 |
1 | 1 | 1 |
Convolutions =
Flip + Inner product
Input image
Output image
2D convolutions
55
Convolution kernel
(3-by-3)
1 | 1 | 1 |
0 | 0 | 0 |
1 | 1 | 1 |
0 | 0 | 0 | 0 | 1 |
0 | 0 | 0 | 1 | 1 |
0 | 0 | 1 | 1 | 1 |
0 | 1 | 1 | 1 | 1 |
1 | 1 | 1 | 1 | 1 |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
Convolutions =
Flip + Inner product
4
Input image
Output image
Convolution example
56
1 | 1 | 1 |
0 | 0 | 0 |
1 | 1 | 1 |
57
Questions?
The convolution computation
n
k
n
The convolution computation
n=0
n=0
The convolution computation
n=0
n=0
n=0
n=6
61
Questions?
Convolution for translation
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Some examples
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Some examples
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Some examples
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Some examples
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Some examples
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Some examples
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
69
Questions?
Convolution
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Template Matching
Which one can be achieved by convolutions?
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Today
72
Music and frequency
Music and frequency
Fourier transform
Fourier transform
75
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Fourier transform
76
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Fourier transform
77
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
A signal can be represented by a linear combination of “periodic” functions!
78
Questions?
Frequency in images
Frequency in images
Goal
Spatial
DFT: frequency
Amplitude: A
Today
82
Fourier transform
83
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
A signal can be represented by a linear combination of “periodic” functions!
Fourier transform
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Fourier transform
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
“inner products”
“periodic” functions!
Continuous and discrete waves
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Discrete waves
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
k = 1
k = 2
k = 3
88
Questions?
Sine and cosine in 2D
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Sine and cosine in 2D
[Figure credit: A. Torralba, P. Isola, and W. T. Freeman, Foundations of Computer Vision.]
Frequency response: amplitude and phases
91
m
n
m
Fourier-like
transform
Amplitude
Phase
u
u
v
v
u
u
v
v
n