Title: Camera calibration
1Camera calibration
- Digital Visual Effects
- Yung-Yu Chuang
with slides by Richard Szeliski, Steve Seitz,,
Fred Pighin and Marc Pollefyes
2Outline
- Camera projection models
- Camera calibration
- Nonlinear least square methods
- A camera calibration tool
- Applications
3Camera projection models
4Pinhole camera
5Pinhole camera model
(X,Y,Z)
P
origin
p
(x,y)
principal point
(optical center)
6Pinhole camera model
principal point
7Pinhole camera model
principal point
8Principal point offset
principal point
intrinsic matrix
only related to camera projection
9Intrinsic matrix
Is this form of K good enough?
- non-square pixels (digital video)
- skew
- radial distortion
10Distortion
No distortion
Pin cushion
Barrel
- Radial distortion of the image
- Caused by imperfect lenses
- Deviations are most noticeable for rays that pass
through the edge of the lens
11Camera rotation and translation
extrinsic matrix
12Two kinds of parameters
- internal or intrinsic parameters such as focal
length, optical center, aspect ratiowhat kind
of camera? - external or extrinsic (pose) parameters including
rotation and translationwhere is the camera?
13Other projection models
14Orthographic projection
- Special case of perspective projection
- Distance from the COP to the PP is infinite
- Also called parallel projection (x, y, z) ?
(x, y)
Image
World
15Other types of projections
- Scaled orthographic
- Also called weak perspective
- Affine projection
- Also called paraperspective
16Illusion
17Illusion
18Fun with perspective
19Perspective cues
20Perspective cues
21Fun with perspective
Ames room
Ames video
BBC story
22Forced perspective in LOTR
23Camera calibration
24Camera calibration
- Estimate both intrinsic and extrinsic parameters.
Two main categories - Photometric calibration uses reference objects
with known geometry - Self calibration only assumes static scene, e.g.
structure from motion
25Camera calibration approaches
- linear regression (least squares)
- nonlinear optimization
26Chromaglyphs (HP research)
27Camera calibration
28Linear regression
29Linear regression
- Directly estimate 11 unknowns in the M matrix
using known 3D points (Xi,Yi,Zi) and measured
feature positions (ui,vi)
30Linear regression
31Linear regression
32Linear regression
Solve for Projection Matrix M using least-square
techniques
33Normal equation
- Given an overdetermined system
the normal equation is that which minimizes the
sum of the square differences between left and
right sides
34Linear regression
- Advantages
- All specifics of the camera summarized in one
matrix - Can predict where any world point will map to in
the image - Disadvantages
- Doesnt tell us about particular parameters
- Mixes up internal and external parameters
- pose specific move the camera and everything
breaks - More unknowns than true degrees of freedom
35Nonlinear optimization
- A probabilistic view of least square
- Feature measurement equations
- Probability of M given (ui,vi)
P
36Optimal estimation
- Likelihood of M given (ui,vi)
- It is a least square problem (but not necessarily
linear least square) - How do we minimize L?
P
L
37Optimal estimation
- Non-linear regression (least squares), because
the relations between ûi and ui are non-linear
functions of M - We can use Levenberg-Marquardt method to minimize
it
unknown parameters
known constant
38Nonlinear least square methods
39Least square fitting
number of data points
number of parameters
40Linear least square fitting
y
t
41Linear least square fitting
y
t
42Linear least square fitting
y
model
parameters
t
43Linear least square fitting
y
model
parameters
t
44Linear least square fitting
y
model
parameters
t
45Nonlinear least square fitting
model
parameters
residuals
46Function minimization
Least square is related to function minimization.
- It is very hard to solve in general. Here, we
only consider a simpler problem of finding local
minimum.
47Function minimization
48Quadratic functions
Approximate the function with a quadratic
function within a small neighborhood
49Quadratic functions
A is positive definite. All eigenvalues are
positive. For all x, xTAxgt0.
negative definite
A is singular
A is indefinite
50Function minimization
- Why?
- By definition, if is a local minimizer,
-
is small enough
51Function minimization
52Function minimization
53Descent methods
54Descent direction
55Steepest descent method
the decrease of F(x) per unit along h direction
?
hsd is a descent direction because hTsd F(x)
-F(x)2 lt0
56Line search
57Line search
58Steepest descent method
isocontour
gradient
59Steepest descent method
- It has good performance in the initial stage of
the iterative process. Converge very slow with a
linear rate.
60Newtons method
?
?
?
?
61Newtons method
- Another view
- Minimizer satisfies
62Newtons method
- It requires solving a linear system and H is not
always positive definite. - It has good performance in the final stage of the
iterative process, where x is close to x.
63Gauss-Newton method
- Use the approximate Hessian
- No need for second derivative
- H is positive semi-definite
64Hybrid method
- This needs to calculate second-order derivative
which might not be available.
65Levenberg-Marquardt method
- LM can be thought of as a combination of steepest
descent and the Newton method. When the current
solution is far from the correct one, the
algorithm behaves like a steepest descent method
slow, but guaranteed to converge. When the
current solution is close to the correct
solution, it becomes a Newtons method.
66Nonlinear least square
67Levenberg-Marquardt method
68Levenberg-Marquardt method
- µ0 ? Newtons method
- µ?8 ? steepest descent method
- Strategy for choosing µ
- Start with some small µ
- If F is not reduced, keep trying larger µ until
it does - If F is reduced, accept it and reduce µ for the
next iteration
69Recap (the Rosenbrock function)
Global minimum at (1,1)
70Steepest descent
71(No Transcript)
72(No Transcript)
73In the plane of the steepest descent direction
74Steepest descent (1000 iterations)
75Gauss-Newton method
- With the approximate Hessian
- No need for second derivative
- H is positive semi-definite
76(No Transcript)
77Newtons method (48 evaluations)
78Levenberg-Marquardt
- Blends steepest descent and Gauss-Newton
- At each step, solve for the descent direction h
- If µ large, , steepest descent
- If µ small, ,
Gauss-Newton
79Levenberg-Marquardt (90 evaluations)
80A popular calibration tool
81Multi-plane calibration
Images courtesy Jean-Yves Bouguet, Intel Corp.
- Advantage
- Only requires a plane
- Dont have to know positions/orientations
- Good code available online!
- Intels OpenCV library http//www.intel.com/rese
arch/mrl/research/opencv/ - Matlab version by Jean-Yves Bouget
http//www.vision.caltech.edu/bouguetj/calib_doc/i
ndex.html - Zhengyou Zhangs web site http//research.micros
oft.com/zhang/Calib/
82Step 1 data acquisition
83Step 2 specify corner order
84Step 3 corner extraction
85Step 3 corner extraction
86Step 4 minimize projection error
87Step 4 camera calibration
88Step 4 camera calibration
89Step 5 refinement
90Optimized parameters
91Applications
92How is calibration used?
- Good for recovering intrinsic parameters It is
thus useful for many vision applications - Since it requires a calibration pattern, it is
often necessary to remove or replace the pattern
from the footage or utilize it in some ways
93Example of calibration
94Example of calibration
95Example of calibration
- Videos from GaTech
- DasTatoo, MakeOf
- P!NG, MakeOf
- Work, MakeOf
- LifeInPaints, MakeOf
96PhotoBook
PhotoBook
MakeOf