Top Banner
Camera calibration Digital Visual Effects Yung-Yu Chuang with slides by Richard Szeliski, Steve Seitz,, Fred Pighin and Marc Pollefyes
96

Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

May 13, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Camera calibration

Digital Visual EffectsgYung-Yu Chuang

with slides by Richard Szeliski, Steve Seitz,, Fred Pighin and Marc Pollefyes

Page 2: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Outline

• Camera projection modelsC lib i• Camera calibration

• Nonlinear least square methods• A camera calibration tool• Applications• Applications

Page 3: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Camera projection modelsCamera projection models

Page 4: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Pinhole camera

Page 5: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Pinhole camera model

P(X,Y,Z)

originP

p

(x,y)

principal point

(optical center)

Page 6: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Pinhole camera model

ZfXx

ZfYy

Z

principal

X

Zprincipal point

000000YX

ff

fYfX

yx

10100000~

1Z

fZfYy

1

Page 7: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Pinhole camera model

principal

X

principal point

00100001

0000

YX

ff

fYfX

yx

101000010

10000~

1Z

fZfYy

1

Page 8: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Principal point offset

principal point

intrinsic matrix

X XIKx 0~

only related to camera projection

00100001

00 0 Y

X

yfxf

fYfX

yx

101000010

1000~

10 Zyf

ZfYy

1

Page 9: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Intrinsic matrix

0 0xfIs this form of K good enough?

100

0 0yfK 100

• non-square pixels (digital video)• skew xsfa• radial distortion

0 0

0

yfxsfa

K

100

Page 10: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Distortion

No distortion Pin cushion Barrel

• Radial distortion of the imageCa sed b imperfect lenses– Caused by imperfect lenses

– Deviations are most noticeable for rays that pass through the edge of the lensthrough the edge of the lens

Page 11: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Camera rotation and translation

XX

''

tR

ZY

ZY 33

''

0 0 Y

Xxfx XtRKx ~

1000~

10 Z

Yyfy tR

extrinsic matrix

11001

Page 12: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Two kinds of parameters

• internal or intrinsic parameters such as focal l th ti l t t tilength, optical center, aspect ratio:what kind of camera?

• external or extrinsic (pose) parameters including rotation and translation:where is the camera?

Page 13: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Other projection models

Page 14: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Orthographic projection• Special case of perspective projection

Di t f th COP t th PP i i fi it– Distance from the COP to the PP is infinite

Image World

– Also called “parallel projection”: (x, y, z) → (x, y)

Page 15: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Other types of projections• Scaled orthographic

Al ll d “ k ti ”– Also called “weak perspective”

• Affine projection– Also called “paraperspective”

Page 16: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Illusion

Page 17: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Illusion

Page 18: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Fun with perspective

Page 19: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Perspective cues

Page 20: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Perspective cues

Page 21: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Fun with perspective

Ames room

Ames video BBC storyAmes video BBC story

Page 22: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Forced perspective in LOTR

Page 23: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Camera calibrationCamera calibration

Page 24: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Camera calibration

• Estimate both intrinsic and extrinsic parameters. Two main categories:Two main categories:

1. Photometric calibration: uses reference objects ith k twith known geometry

2. Self calibration: only assumes static scene, e.g. structure from motion

Page 25: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Camera calibration approaches

1. linear regression (least squares)2 li i i i2. nonlinear optimization

Page 26: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Chromaglyphs (HP research)

Page 27: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Camera calibrationCamera calibration

Page 28: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Linear regression

MXXtRKx ~

Page 29: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Linear regression

• Directly estimate 11 unknowns in the M matrix using known 3D points (X Y Z ) and measured using known 3D points (Xi,Yi,Zi) and measured feature positions (ui,vi)

Page 30: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Linear regression

Page 31: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Linear regression

Page 32: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Linear regression

Solve for Projection Matrix M using least-square techniquesq

Page 33: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Normal equation

Given an overdetermined system

bAx the normal equation is that which minimizes the sum of the square differences between left and sum of the square differences between left and right sides

bAAxA TT

Page 34: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Linear regression

• Advantages:All ifi f th i d i t i– All specifics of the camera summarized in one matrix

– Can predict where any world point will map to in the imageimage

• Disadvantages:’ ll b l – Doesn’t tell us about particular parameters

– Mixes up internal and external parameters ifi h d hi b k• pose specific: move the camera and everything breaks

– More unknowns than true degrees of freedom

Page 35: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Nonlinear optimization

• A probabilistic view of least squareF i• Feature measurement equations

• Probability of M given {(ui,vi)}

PP

Page 36: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Optimal estimation

• Likelihood of M given {(ui,vi)}

It i l t bl (b t t il

PL

• It is a least square problem (but not necessarily linear least square)

• How do we minimize L?

Page 37: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Optimal estimation

• Non-linear regression (least squares), because the relations between û and u are non linear the relations between ûi and ui are non-linear functions of M

unknown parameters

We could have terms like in thiscosf

unknown parameters

XtRKuuu ~ˆ XtRKuuu

known constant

• We can use Levenberg-Marquardt method to

known constant

minimize it

Page 38: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Nonlinear least square methodsNonlinear least square methods

Page 39: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Least square fitting

number of data pointsnumber of data points

number of parametersnumber of parameters

Page 40: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Linear least square fitting

y

tt

Page 41: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Linear least square fitting

y model parameters

txxtMty );()( x

t

txxtMty 10);()( x

t

Page 42: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Linear least square fitting

y model parameters

txxtMty );()( x

t

txxtMty 10);()( x

t

Page 43: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Linear least square fitting

y model parameters

txxtMty );()( x

t

txxtMty 10);()( x

);()( xtMyxf t );()( xiii tMyxf

predictionresidual

prediction

Page 44: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Linear least square fitting

y model parameters

txxtMty );()( x

t

txxtMty 10);()( x

);()( xtMyxf t );()( xiii tMyxf

predictionresidual

prediction

3);( txtxxtM x i li t 210);( txtxxtM x is linear, too.

Page 45: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Nonlinear least square fitting

txtx exextM 2143);( xmodel

Txxxx ],,,[ 4421xparameters

);()( xx iii tMyf

txtx exexy 21

residuals

i exexy 43

Page 46: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Function minimizationLeast square is related to function minimization.

It is very hard to solve in general Here we only consider It is very hard to solve in general. Here, we only consider a simpler problem of finding local minimum.

Page 47: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Function minimization

Page 48: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Quadratic functions

Approximate the function with a quadratic function within a quadratic function within a small neighborhood

Page 49: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Quadratic functions

A is positive definite.All eigenvalues

negative definiteAll eigenvalues are positive.For all x, xTAx>0.

A is indefiniteA is singular

Page 50: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Function minimization

Why?By definition, if is a local minimizer,*xy , ,

h )F(xh)F(x ** is small enough

)hO()(xF'h)F(xh)F(x 2*T**

Page 51: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Function minimization

Page 52: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Function minimization

Page 53: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Descent methods

Page 54: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Descent direction

Page 55: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Steepest descent method

the decrease of F(x) per the decrease of F(x) per unit along h direction

→→hsd is a descent direction because hT

sd F’(x) = -F’(x)2 <0

Page 56: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Line search

that so Find

minimumis)( 0 h)F(x α

minimumis

)(0 0 h)F(x α )(0 0

xF

)(

T

)(' 0 hxFhxxF T α

)(xF'h 0

Page 57: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Line search

0)(' 0 hxFhT α

)(xF'h )(xFh 0

)()(

)(''''

0

hFFh

hxFhTT

T α

0

)()( 00

Hhhhh

hxFxFhTT

TT

α

α

hhT

HhhT

Page 58: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Steepest descent method

isocontour gradientisocontour gradient

Page 59: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Steepest descent method

It has good performance in the initial stage of the iterative It has good performance in the initial stage of the iterative process. Converge very slow with a linear rate.

Page 60: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Newton’s method

→→

Page 61: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Newton’s method• Another view

1 Hhhghxhxh TT

21)()()( FFE

• Minimizer satisfies 0)(' * hE

0)(' HhghE

gHh 1

Page 62: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Newton’s method

gHh 1

• It requires solving a linear system and H is not

gHh

always positive definite.• It has good performance in the final stage of g p g

the iterative process, where x is close to x*.

Page 63: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Gauss-Newton method• Use the approximate Hessian

JJH T

• No need for second derivative• No need for second derivative• H is positive semi-definite

Page 64: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Hybrid method

This needs to calculate second-order derivative which i h b il bl might not be available.

Page 65: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Levenberg-Marquardt method

• LM can be thought of as a combination of steepest descent and the Newton method steepest descent and the Newton method. When the current solution is far from the correct one the algorithm behaves like a correct one, the algorithm behaves like a steepest descent method: slow, but guaranteed to converge When the current solution is close to converge. When the current solution is close to the correct solution, it becomes a Newton’s methodmethod.

Page 66: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Nonlinear least square

find try to, tsmeasuremen ofset aGiven x

Hereminimalisdistancesquared that theso vector parameter best the p

T).(ˆ with ,ˆ

Here,minimal.isdistance squaredpxxx f

Page 67: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Levenberg-Marquardt method

Page 68: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Levenberg-Marquardt method

gI)hJ(JT • μ=0 → Newton’s method

gI)hJ(J

• μ→∞ → steepest descent method

• Strategy for choosing μSt t ith ll – Start with some small μ

– If F is not reduced, keep trying larger μ until it doesIf F i d d t it d d f th t – If F is reduced, accept it and reduce μ for the next iteration

Page 69: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Recap (the Rosenbrock function)( )

2222 )(100)1()(f 2222 )(100)1(),( xyxyxfz

Gl b l i i (1 1)Global minimum at (1,1)

Page 70: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Steepest descent

gxx gxx k1k

T

Hhhhh

T

T

Hhh

Page 71: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

kx

F '

1kx

1x

xminx

g kF x'

1kx 2x

Page 72: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

kx

1x

x

g

1kx minx

2x 1kx

Page 73: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

In the plane of the steepest descent direction

hhT

Hhhhh

T

x x1kx kx

Page 74: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Steepest descent (1000 iterations)( )

Regularized Least-

Page 75: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Gauss-Newton method

gHxx 1 gHxx k1k

• With the approximate Hessian

TJJH T

• No need for second derivative• H is positive semi-definite

Page 76: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

H 1

kx

1x

x

gH- 1

1kx minx

2x 1kx

Page 77: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Newton’s method (48 evaluations)( )

Regularized Least-

Page 78: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Levenberg-Marquardt• Blends steepest descent and Gauss-Newton

A h l f h d di i h• At each step, solve for the descent direction h

gI)hJ(JT • If μ large steepest descent

gI)hJ(J gh • If μ large, , steepest descent

If ll G N t

gh

J)(Jh T 1• If μ small, , Gauss-NewtongJ)(Jh T 1

Page 79: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Levenberg-Marquardt (90 evaluations)

Regularized Least-

Page 80: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

A popular calibration toolA popular calibration tool

Page 81: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Multi-plane calibration

Images courtesy Jean-Yves Bouguet, Intel Corp.

Advantage• Only requires a plane• Don’t have to know positions/orientations

G d d il bl li !• Good code available online!– Intel’s OpenCV library: http://www.intel.com/research/mrl/research/opencv/

– Matlab version by Jean-Yves Bouget: y ghttp://www.vision.caltech.edu/bouguetj/calib_doc/index.html

– Zhengyou Zhang’s web site: http://research.microsoft.com/~zhang/Calib/

Page 82: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Step 1: data acquisition

Page 83: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Step 2: specify corner order

Page 84: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Step 3: corner extraction

Page 85: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Step 3: corner extraction

Page 86: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Step 4: minimize projection error

Page 87: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Step 4: camera calibration

Page 88: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Step 4: camera calibration

Page 89: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Step 5: refinement

Page 90: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Optimized parameters

Page 91: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

ApplicationsApplications

Page 92: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

How is calibration used?

• Good for recovering intrinsic parameters; It is thus useful for many vision applicationsthus useful for many vision applications

• Since it requires a calibration pattern, it is ft t l th often necessary to remove or replace the

pattern from the footage or utilize it in some ways…

Page 93: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Example of calibration

Page 94: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Example of calibration

Page 95: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

Example of calibration

• Videos from GaTechD T M k Of• DasTatoo, MakeOf

• P!NG, MakeOf• Work, MakeOf• LifeInPaints MakeOf• LifeInPaints, MakeOf

Page 96: Digital Visual Effects Yung-Yu Chuangcyy/courses/vfx/10spring/lectures/handouts/lec09... · Orthographic projection • Special case of perspective projection – Di t f th COP t

PhotoBook

M k Of

PhotoBook

MakeOf