60
Lecture 3 - Silvio Savarese Jan 17 th , 2018 Professor Silvio Savarese Computational Vision and Geometry Lab Lecture 3 Camera Models 2 & Camera Calibration

lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Lecture 3 -Silvio Savarese Jan17th,2018

ProfessorSilvioSavareseComputationalVisionandGeometryLab

Lecture3CameraModels2&CameraCalibration

Page 2: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Lecture 3 -Silvio Savarese Jan17th,2018

• Recapofcameramodels• Cameracalibrationproblem• Cameracalibrationwithradialdistortion• Example

Some slides in this lecture are courtesy to Profs. J. Ponce, F-F Li

Reading: [FP] Chapter 1 “Geometric Camera Calibration”[HZ] Chapter 7 “Computation of Camera Matrix P”

Lecture3CameraModels2&CameraCalibration

Page 3: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

P '3×1 =M Pw = K3×3 R T"#

$% 3×4

Pw4×1

=

m1

m2

m3

!

"

####

$

%

&&&&

PW =m1PWm2PWm3PW

!

"

####

$

%

&&&&

→ P 'E = (m1Pwm3Pw

, m2Pwm3Pw

)E

f

Projective camera

Ow

kw

jwR,T

úúú

û

ù

êêê

ë

é=

3

2

1

mmm

M

Page 4: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Exercise!

Ow

iw

kw

jwR,T

M = K R T!"

#$

P

P’

f

Suppose we have no rotation or translationZero skew, square pixels, no distortion, no off-set

= (m1Pwm3Pw

, m2Pwm3Pw

)P 'E Pw =

xwywzw1

!

"

#####

$

%

&&&&&

à

Page 5: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Exercise!

Ow

iw

kw

jwR,T

M = K R T!"

#$

= (m1Pwm3Pw

, m2Pwm3Pw

)

P

P’

f

P 'E = ( f xwzw, f yw

zw)

=

f 0 0 00 f 0 00 0 1 0

!

"

###

$

%

&&&

Pw =

xwywzw1

!

"

#####

$

%

&&&&&

à

= K I 0!"

#$

Page 6: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Canonical Projective Transformation

P ' =xyz

!

"

####

$

%

&&&&

=1 0 0 00 1 0 00 0 1 0

!

"

###

$

%

&&&

xyz1

!

"

####

$

%

&&&&

xzyz

!

"

####

$

%

&&&&

Pi ' =

P ' =M P

M3

H4 ®Â

Page 7: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Projective camera

p’q’r’ O

f’R

Q

P

Page 8: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Weak perspective projection

R

Q

P

O

f’

When the relative scene depth is small compared to its distance from the camera

zo

p’q’r’ Q_

P_

R_

π

Page 9: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Weak perspective projection

O

f’ zo

p’q’r’ Q_

P_

R_

x ' = f 'zx

y ' = f 'zy

!

"

###

$

###

x ' = f 'z0x

y ' = f 'z0y

!

"

##

$

##

Magnification m

R

Q

Page 10: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

úû

ùêë

é=

10bA

M[ ]TRKM = úû

ùêë

é=

1vbA

O

f’ zo

p’q’r’ Q_

P_

R_R

Q

P

π

à

Projective (perspective) Weak perspective

Weak perspective projection

Page 11: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

úúú

û

ù

êêê

ë

é=

úúú

û

ù

êêê

ë

é=

10002

1

3

2

1

mm

mmm

=

m1

m2

m3

!

"

####

$

%

&&&&

PW

)P,P( 21 ww mm®E

wPMP =¢úû

ùêë

é=

10bA

M

magnification

úúú

û

ù

êêê

ë

é=

3

2

1

mmm

wPMP =¢ úû

ùêë

é=

1vbA

Múúú

û

ù

êêê

ë

é=

úúú

û

ù

êêê

ë

é=

W3

W2

W1

W

3

2

1

PPP

Pmmm

mmm

)PP,

PP(

3

2

3

1

w

w

w

w

mm

mm

®E

Perspective

Weakperspective

=

m1 PWm2 PW1

!

"

####

$

%

&&&&

Page 12: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Orthographic (affine) projectionDistance from center of projection to image plane is infinite

x ' = f 'zx

y ' = f 'zy

!

"

###

$

###

→x ' = xy ' = y

!"#

$#

Page 13: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

ProsandConsofTheseModels

• Weakperspectiveresultsinmuchsimplermath.– Accuratewhenobjectissmallanddistant.– Mostusefulforrecognition.

• Pinholeperspectiveismuchmoreaccurateformodelingthe3D-to-2Dmapping.– UsedinstructurefrommotionorSLAM.

Page 14: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

One-point perspective• Masaccio, Trinity,

Santa Maria Novella, Florence, 1425-28

Credit slide S. Lazebnik

Page 15: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

The Kangxi Emperor's Southern Inspection Tour (1691-1698)By Wang Hui

Weak perspective projection

Page 16: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Weak perspective projection

The Kangxi Emperor's Southern Inspection Tour (1691-1698)By Wang Hui

Page 17: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Lecture 3 -Silvio Savarese 18-Jan-18

• Recapofcameramodels• Cameracalibrationproblem• Cameracalibrationwithradialdistortion• Example

Some slides in this lecture are courtesy to Profs. J. Ponce, F-F Li

Lecture3CameraCalibration

Reading: [FP] Chapter 1 “Geometric Camera Calibration”[HZ] Chapter 7 “Computation of Camera Matrix P”

Page 18: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Whyisthisimportant?Estimatecameraparameterssuchposeorfocallengthfromimages!

?

Page 19: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Projective camera

úúú

û

ù

êêê

ë

é -

=

100v0

ucot

K o

o

sinqb

qaa

úúú

û

ù

êêê

ë

é

=T3

T2

T1

Rrrr

úúú

û

ù

êêê

ë

é

=

z

y

x

ttt

T

43´

wPMP =¢ [ ] wPTRK=Internal parameters

External parameters

Page 20: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Goal of calibration

Estimate intrinsic and extrinsic parameters from 1 or multiple images

Change notation:P = Pw

p = P’

wPMP =¢ [ ] wPTRK=Internal parameters

External parameters

Page 21: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Calibration Problem

•P1… Pn with known positions in [Ow,iw,jw,kw]

jC

Calibration rig

Page 22: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Calibration Problem

•P1… Pn with known positions in [Ow,iw,jw,kw]•p1, … pn known positions in the image

jC

Calibration rig

pi

Goal: compute intrinsic and extrinsic parameters

pi

image

Page 23: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

image

Calibration Problem

jC

Calibration rig

How many correspondences do we need?• M has 11 unknowns • We need 11 equations • 6 correspondences would do it

pi

jCpi

pi

image

Page 24: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Calibration Problem

jC

Calibration rig

In practice, using more than 6 correspondences enables more robust results

pi

jCpi

pi

image

Page 25: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Calibration Problem

jC

Calibration rig

pi

jCpi

pi

image

=M Pipi =uivi

!

"##

$

%&&

úúúú

û

ù

êêêê

ë

é

=

i3

i2

i3

i1

PPPP

mmmm

in pixels[Eq. 1]

úúú

û

ù

êêê

ë

é=

3

2

1

Mmmm

Page 26: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Calibration Problem

i3

i1i P

Pumm

=

i2i3i P)P(v mm =®

i1i3i P)P(u mm =®

i3

i2i P

Pvmm

=

úû

ùêë

é

i

i

vu

úúúú

û

ù

êêêê

ë

é

=

i3

i2

i3

i1

PPPP

mmmm

0P)P(v 23 =-® iii mm

→ ui (m3 Pi )−m1 Pi = 0

[Eq. 1]

[Eqs. 2]

Page 27: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Calibration Problem

……

0)( 12131 =- PPv mm

0)( 11131 =- PPu mm

0)( 23 =- iii PPv mm

0)( 13 =- iii PPu mm

0)( 23 =- nnn PPv mm

0)( 13 =- nnn PPu mm

[Eqs. 3]

Page 28: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Block Matrix Multiplication

úû

ùêë

é=ú

û

ùêë

é=

2221

1211

2221

1211

BBBB

BAAAA

A

What is AB ?

úû

ùêë

é++++

=2222122121221121

2212121121121111

BABABABABABABABA

AB

Page 29: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

÷÷÷

ø

ö

ççç

è

æ

=T3

T2

T1def

mmm

mP = def

P1T

0T0T

P1T

−u1P1T

−v1P1T

!PnT

0T0T

PnT

−unPnT

−vnPnT

"

#

$$$$$$$$

%

&

''''''''

Calibration Problem

2n x 1212x1

1x44x1

Homogenous linear system

knownunknown

0)( 12131 =+- PPv mm

0)( 11131 =+- PPu mm

0)( 23 =+- nnn PPv mm

0)( 13 =+- nnn PPu mm

0=P m [Eq. 4]

Page 30: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Homogeneous M x N Linear Systems

P m 0=

Rectangular system (M>N)

• 0 is always a solution

Minimize |P m|2

under the constraint |m|2 =1

M=number of equations = 2nN=number of unknown = 11

• To find non-zero solution

N

M

Page 31: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

• How do we solve this homogenous linear system?

Calibration Problem

• Via SVD decomposition!

0=P m

Page 32: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Calibration Problem

1212T

121212n2 VDU ´´´

Last column of V gives m

M

SVD decomposition of P

Why?Seepag 592ofHZ

÷÷÷

ø

ö

ççç

è

æ

=T3

T2

T1def

mmm

m

0=P m

Page 33: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Extracting camera parameters

M = ρ

Page 34: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Extracting camera parameters

A

úúú

û

ù

êêê

ë

é

=T3

T2

T1

Aaaa

[ ]TRK=

3

1a±

=r

úúú

û

ù

êêê

ë

é

=

3

2

1

bbb

b

Estimated values

)( 312 aa ×= rou

)(v 322

o aa ×= r

( ) ( )3231

3231cosaaaaaaaa

´×´´×´

=q

Intrinsic

b úúú

û

ù

êêê

ë

é -

=

100v0

ucot

K o

o

sinqb

qaarM =

Box 1

See [FP], Sec. 1.3.1

Page 35: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Extracting camera parameters

úúú

û

ù

êêê

ë

é

=T3

T2

T1

Aaaa

[ ]TRK=

úúú

û

ù

êêê

ë

é

=

3

2

1

bbb

b

Estimated values

Intrinsic

qra sin312 aa ´=

qrb sin322 aa ´=

A brM =

úúú

û

ù

êêê

ë

é -

=

100v0

ucot

K o

o

sinqb

qaa

Box 1

See [FP], Sec. 1.3.1

Page 36: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Theorem (Faugeras, 1993)

Page 37: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Extracting camera parameters

úúú

û

ù

êêê

ë

é

=T3

T2

T1

Aaaa

[ ]TRK=

úúú

û

ù

êêê

ë

é

=

3

2

1

bbb

b

Estimated values

A brM =

úúú

û

ù

êêê

ë

é -

=

100v0

ucot

K o

o

sinqb

qaa

Box 1

See [FP], Sec. 1.3.1

Extrinsic( )

32

321 aa

aar´´

=3

33 a

ar ±=

132 rrr ´= b1KT -= r

Page 38: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Degenerate cases

•Pi’s cannot lie on the same plane!• Points cannot lie on the intersection curve of two

quadric surfaces [FP] section 1.3

Page 39: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Lecture 3 -Silvio Savarese 18-Jan-18

• Recapofprojectivecameras• Cameracalibrationproblem• Cameracalibrationwithradialdistortion• Example

Some slides in this lecture are courtesy to Profs. J. Ponce, F-F Li

Lecture3CameraCalibration

Reading: [FP] Chapter 1 “Geometric Camera Calibration”[HZ] Chapter 7 “Computation of Camera Matrix P”

Page 40: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

No distortion

Pin cushion

Barrel

Radial Distortion– Image magnification (in)decreases with distance from the optical axis– Caused by imperfect lenses– Deviations are most noticeable for rays that pass through the edge of

the lens

Page 41: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Radial Distortion

ii

ii p

vu

PM

100

00

00

1

1

=úû

ùêë

é®

úúúúúú

û

ù

êêêêêê

ë

é

l

ld

v

vucvbuad 222 ++=

u

To model radial behavior

å±==

3

1p

2ppdκ1λ

Polynomial function

Distortion coefficient

[Eq. 5] [Eq. 6]

Image magnification decreases with distance from the optical center

How do we model that?

Page 42: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

úû

ùêë

é=

i

ii v

up

úúú

û

ù

êêê

ë

é=

3

2

1

Qqqq

úúúú

û

ù

êêêê

ë

é

=

i3

i2

i3

i1

PPPP

qqqq

ii

ii p

vu

PM

100

00

00

1

1

=úû

ùêë

é®

úúúúúú

û

ù

êêêêêê

ë

é

l

l

Q

uiq3 Pi = q1 Piviq3 Pi = q2 Pi

!"#

$#

Is this a linear system of equations?

Radial Distortion

No! why? [Eqs.7]

Page 43: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

X = f (Q)

measurements parameters

f( ) is the nonlinear mapping

-Newton Method-Levenberg-Marquardt Algorithm

• Iterative, starts from initial solution • May be slow if initial solution far from real solution • Estimated solution may be function of the initial solution (because of local minima)

• Newton requires the computation of J, H• Levenberg-Marquardt doesn’t require the computation of H

General Calibration Problem

úúúú

û

ù

êêêê

ë

é

=

i3

i2

i3

i1

PPPP

qqqq

úû

ùêë

é

i

i

vu

i=1…n

[Eq .8]

Page 44: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

A possible algorithm

1. Solve linear part of the system to find approximated solution 2. Use this solution as initial condition for the full system3. Solve full system using Newton or L.M.

General Calibration Problem

X = f (Q)

úúúú

û

ù

êêêê

ë

é

=

i3

i2

i3

i1

PPPP

qqqq

úû

ùêë

é

i

i

vu

i=1…n

measurements parameters

[Eq .8]

f( ) is the nonlinear mapping

Page 45: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Typical assumptions:

- zero-skew, square pixel- uo, vo = known center of the image

General Calibration Problem

measurements parameters

f( ) is the nonlinear mapping

úúúú

û

ù

êêêê

ë

é

=

i3

i2

i3

i1

PPPP

qqqq

úû

ùêë

é

i

i

vu X = f (Q) [Eq .8]

i=1…n

Page 46: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Can we estimate m1 and m2 and ignore the radial distortion?

Radial Distortion

úû

ùêë

é=

i

ii v

up

úúúú

û

ù

êêêê

ë

é

=

i3

i2

i3

i1

PPPP

1

mmmm

l

d

v

uHint: slopevu

i

i =

úúúú

û

ù

êêêê

ë

é

=

i3

i2

i3

i1

PPPP

qqqq

Page 47: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Estimating m1 and m2…

Radial Distortion

úû

ùêë

é=

i

ii v

up

úúúú

û

ù

êêêê

ë

é

=

i3

i2

i3

i1

PPPP

1

mmmm

l

0)()( 121111 =- PuPv mm0)()( 21 =- iiii PuPv mm

0)()( 21 =- nnnn PuPv mm…

L n = 0

n =m1

T

m2T

!

"

##

$

%

&&

Tsai [87]

i

i

i

i

i

i

i

i

PP

PPPP

vu

2

1

3

2

3

1

)()()()(

mm

mmmm

==

Getm1 andm2 bySVD

[Eq .9]

[Eq .10][Eq .11]

L = def

v1P1T −u1P1

T

v2P2T −u2P2

T

! !vnPn

T −unPnT

"

#

$$$$$$

%

&

''''''

Page 48: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Once that m1 and m2 are estimated…

Radial Distortion

úû

ùêë

é=

i

ii v

up

úúúú

û

ù

êêêê

ë

é

=

i3

i2

i3

i1

PPPP

1

mmmm

l

3m is non linear function of 1m 2m l

There are some degenerate configurations for which m1 and m2 cannot be computed

, ,

Page 49: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Lecture 3 -Silvio Savarese 18-Jan-18

Some slides in this lecture are courtesy to Profs. J. Ponce, F-F Li

Lecture3CameraCalibration• Recapofprojectivecameras• Cameracalibrationproblem• Cameracalibrationwithradialdistortion• ExampleReading: [FP] Chapter 1 “Geometric Camera Calibration”

[HZ] Chapter 7 “Computation of Camera Matrix P”

Page 50: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Calibration ProcedureCamera Calibration Toolbox for MatlabJ. Bouguet – [1998-2000]

http://www.vision.caltech.edu/bouguetj/calib_doc/index.html#examples

Page 51: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Calibration Procedure

Page 52: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Calibration Procedure

Page 53: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Calibration Procedure

Page 54: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Calibration Procedure

Page 55: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Calibration Procedure

Page 56: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Calibration Procedure

Page 57: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Calibration Procedure

Page 58: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Next lecture

•Single view reconstruction

Page 59: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

12

1

1

.--

úúúú

û

ù

êêêê

ë

é

=L= SSSSA

Nl

ll

Eigenvectors of A are columns of S

Eigenvalues and Eigenvectors

[ ]NS vv1=

Eigendecomposition

Page 60: lecture3 camera calibrationweb.stanford.edu/class/cs231a/lectures/lecture3_camera_calibration.pdfSilvio Savarese Lecture 3 - Jan 17th, 2018 •Recap of camera models •Camera calibration

Singular Value decomposition

úúúú

û

ù

êêêê

ë

é

=S

Ns

ss

.2

1

1-S= VUA

ii ls = s = singular valuel = eigenvalue of At A

U, V = orthogonal matrix