Lecture 03 Calibration
Lecture 03 Calibration
Lecture
Camera Calibration
Liangliang Nan
Today’s Agenda
c
2
Images
c
“vector-valued” function
3
Pinhole camera model
c
4
Pinhole camera model
c
camera coordinate
system
𝑋 𝑌
𝑥=𝑓 , y=𝑓
𝑍 𝑍
5
Perspective projection model
c
𝑋 𝑌
• Pinhole camera 𝑥=𝑓 ,
𝑍
y=𝑓
𝑍
• Change of unit: physical measurements -> pixels
– If k = l, camera sensor’s pixels are exactly square
𝑋 𝑌
𝑥 = 𝑘𝑓 , y = 𝑙𝑓
𝑍 𝑍
Denote 𝛼 = 𝑘𝑓, 𝛽 = 𝑙𝑓
𝑋 𝑌
𝑥=𝛼 , y=𝛽 - x, y: image coordinates (pixels)
𝑍 𝑍
- k, l: scale parameters (pixels/mm)
- f : focal length (mm) 6
Perspective projection model
c
𝑋 𝑌
• Pinhole camera 𝑥=𝑓 ,
𝑍
y=𝑓
𝑍 𝑋 𝑌
• Change of unit: physical measurements -> pixels 𝑥=𝛼 ,
𝑍
y=𝛽
𝑍
• Change of coordinate system
– Image plane coordinates have origin at image center
– Digital image coordinates have origin at top-left corner
7
Perspective projection model
c
𝑋 𝑌
• Pinhole camera 𝑥=𝑓 ,
𝑍
y=𝑓
𝑍 𝑋 𝑌
• Change of unit: physical measurements -> pixels 𝑥=𝛼 ,
𝑍
y=𝛽
𝑍
• Change of coordinate system
• Account for skewness
– Image frame may not be exactly rectangular due to sensor manufacturing errors
8
Perspective projection model
c
(homogeneous coordinates)
𝛼 −𝛼 cot 𝜃 𝑐𝑥 𝑓𝑥 𝑠 𝑐𝑥
!
𝐩 = 𝐾𝐏, 𝐾 = 0 𝑐𝑦 = 0 𝑓𝑦 𝑐𝑦
"#$ %
0 0 1 0 0 1
Intrinsic parameter matrix 9
Perspective projection model
c
• Camera motion
– World frame may not align with the camera frame
– Camera can move and rotate
Camera frame
&
𝐏 & = 𝑅' 𝐏 ' + 𝐭 &'
World frame
1 3 2 4
10
Perspective projection model
c
- R: rotation matrix of the world coordinate system defined in the camera coordinate system
- t: the position of world coordinate system’s origin in camera coordinate system
(Note: t is often mistakenly interpreted as the position of the camera position in the world coordinate system) 11
Today’s Agenda
c
12
General Idea
c
14
General Idea
c
𝑓𝑥 𝑠 𝑐𝑥
𝐾= 0 𝑓𝑦 𝑐𝑦 Internal (intrinsic) parameters
0 0 1
16
General Idea
c
19
General Idea
c
20
General Idea
c
21
m1, m2, m3: the three rows of the projection matrix M
General Idea
c
22
m1, m2, m3: the three rows of the projection matrix M
General Idea
c
12 x 1
2n x 12
• The equations
24
Details: the derivation of the linear system
c
• The equations
25
Details: the derivation of the linear system
c
• The equations
For every pair of 3D-2D corresponding points
26
Details: the derivation of the linear system
c
• The equations
Simplified notation
27
General Idea
c
28
General Idea
c
29
General Idea
c
30
SVD
c
𝑈: an m by m orthogonal matrix
𝐷: an m by n diagonal matrix; entries on diagonal called singular values
𝑉: an n by n orthogonal matrix
31
SVD
c
• Geometric meaning
A U D VT
Transformation Rotation Scaling Rotation
Calibration: solve for projection matrix
c
SVD of P
Page 593 of Hartley & Zisserman. Multiple View Geometry in Computer Vision 34
Camera parameters from project matrix
c
35
Camera parameters from project matrix
c
36
Camera parameters from project matrix
c
37
Find 3D-2D corresponding points
c
tape measure
38
Find 3D-2D corresponding points
c
39
Find 3D-2D corresponding points
c
40
Calibration
c
• Always solvable?
41
Calibration
c
• Always solvable?
– {Pi} cannot lie on the same plane
– {Pi} cannot lie on the intersection curve of two quadric surfaces
42
See Section 1.3 of Forsyth & Ponce. Computer Vision: A Modern Approach
A1: Camera calibration
c
43
Next lecture
c
• Epipolar geometry
44