lecture2 camera models - Stanford...

57
Lecture 2 - Silvio Savarese 10-Jan-18 Professor Silvio Savarese Computational Vision and Geometry Lab Lecture 2 Camera Models

Transcript of lecture2 camera models - Stanford...

Page 1: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Lecture 2 -Silvio Savarese 10-Jan-18

ProfessorSilvioSavareseComputationalVisionandGeometryLab

Lecture2CameraModels

Page 2: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Lecture 2 -Silvio Savarese 10-Jan-18

• Pinholecameras• Cameras&lenses• Thegeometryofpinholecameras

Lecture2CameraModels

Reading: [FP]Chapter1,“GeometricCameraModels”[HZ]Chapter6 “CameraModels”

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

Page 3: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

How do we see the world?

•Let’s design a camera– Idea 1: put a piece of film in front of an object– Do we get a reasonable image?

Page 4: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Pinhole camera

• Add a barrier to block off most of the rays– This reduces blurring– The opening known as the aperture

Aperture

Page 5: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Milestones: • Leonardo da Vinci (1452-1519): first record of camera obscura (1502)

Some history…

Page 6: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Milestones: • Leonardo da Vinci (1452-1519): first record of camera obscura

• Johann Zahn (1685): first portable camera

Some history…

Page 7: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Photography (Niépce, “La Table Servie,” 1822)

Milestones: • Leonardo da Vinci (1452-1519): first record of camera obscura

• Johann Zahn (1685): first portable camera

• Joseph Nicéphore Niépce(1822): first photo - birth of photography

Some history…

Page 8: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Photography (Niépce, “La Table Servie,” 1822)

Milestones: • Leonardo da Vinci (1452-1519): first record of camera obscura

• Johann Zahn (1685): first portable camera

• Joseph Nicéphore Niépce(1822): first photo - birth of photography

•Daguerréotypes (1839)• Photographic Film (Eastman, 1889)• Cinema (Lumière Brothers, 1895)• Color Photography (Lumière Brothers, 1908)

Some history…

Page 9: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Let’s also not forget…

Motzu(468-376 BC)

Aristotle(384-322 BC)

Also: Plato, Euclid

Al-Kindi (c. 801–873) Ibn al-Haitham

(965-1040)Oldest existent book on

geometry in China

Page 10: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Pinhole perspective projectionPinhole cameraf

f = focal lengtho = aperture = pinhole = center of the camera

o

Page 11: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

ïïî

ïïí

ì

=

=

zyf'y

zxf'x

úû

ùêë

颢

=¢®yx

Púúú

û

ù

êêê

ë

é=zyx

P

Pinhole camera

Derived using similar triangles

[Eq. 1]

f

Page 12: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

O

P = [x, z]

P’=[x’, f ]

f

zx

fx=¢

i

k

Pinhole camera

[Eq. 2]

f

Page 13: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Kate lazuka ©

Pinhole cameraIs the size of the aperture important?

Page 14: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Shrinkingaperture

size

Adding lenses!-What happens if the aperture is too small?

-Less light passes through

Page 15: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Cameras & Lenses

• A lens focuses light onto the film

imageP

P’

Page 16: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

• A lens focuses light onto the film– There is a specific distance at which objects are “in

focus”– Related to the concept of depth of field

Out of focus

Cameras & Lenses

imageP

P’

Page 17: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

• A lens focuses light onto the film– There is a specific distance at which objects are “in

focus”– Related to the concept of depth of field

Cameras & Lenses

Page 18: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

• A lens focuses light onto the film– All rays parallel to the optical (or principal) axis converge to

one point (the focal point) on a plane located at the focal length f from the center of the lens.

– Rays passing through the center are not deviated

focal point

f

Cameras & Lenses

Page 19: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

f

Paraxial refraction model

zy'z'y

zx'z'x

ïïî

ïïí

ì

=

= ozf'z +=

)1n(2Rf -

=

zo-z

Z’

From Snell’s law:

[Eq. 3]

[Eq. 4]

p’ = [x’,y’]

Page 20: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

No distortion

Pin cushion

Barrel (fisheye lens)

Issues with lenses: Radial Distortion– Deviations are most noticeable for rays that pass through

the edge of the lens

Image magnification decreases with distance from the optical axis

Page 21: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Lecture 2 -Silvio Savarese 10-Jan-18

• Pinholecameras• Cameras&lenses• Thegeometryofpinholecameras

• Intrinsic• Extrinsic

Lecture2CameraModels

Page 22: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Pinhole perspective projectionPinhole camera

f = focal lengtho = center of the camera

23 ®ÂE

ïïî

ïïí

ì

=

=

zyf'y

zxf'x

úû

ùêë

颢

=¢®yx

Púúú

û

ù

êêê

ë

é=zyx

P

[Eq. 1]

f

Page 23: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

From retina plane to images

Pixels, bottom-left coordinate systems

fRetina plane

Digital image

Page 24: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Coordinate systems

f

x

y

xc

yc

C’’=[cx, cy]

)czyf,c

zxf()z,y,x( yx ++®

1. Off set

[Eq. 5]

Page 25: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Converting to pixels

)czylf,c

zxkf()z,y,x( yx ++®

1. Off set2. From metric to pixels

x

y

xc

yc

C=[cx, cy] Units: k,l : pixel/m

f : m : pixel

a b

,a bNon-square pixels

f

[Eq. 6]

Page 26: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

• Is this a linear transformation?

x

y

xc

yc

C=[cx, cy]

P = (x, y, z)→ P ' = (α xz+ cx, β

yz+ cy )

Is this projective transformation linear?

f

[Eq. 7]

No — division by z is nonlinear

• Can we express it in a matrix form?

Page 27: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Homogeneous coordinates

homogeneous image coordinates

homogeneous scene coordinates

•Converting back from homogeneous coordinates

EàH

HàE

Page 28: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Projective transformation in the homogenous coordinate system

xyz1

!

"

####

$

%

&&&&

M =

α 0 cx 00 β cy 0

0 0 1 0

!

"

####

$

%

&&&&

[Eq.8]

→ P ' = (α xz+ cx, β

yz+ cy )Ph '

Homogenous Euclidian

Ph ' =α x + cx zβ y+ cy z

z

!

"

####

$

%

&&&&

=

α 0 cx 00 β cy 0

0 0 1 0

!

"

####

$

%

&&&&

Ph

Page 29: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

P ' =M P

= K I 0!"

#$P

The Camera Matrix

P ' =α 0 cx 00 β cy 0

0 0 1 0

!

"

####

$

%

&&&&

xyz1

!

"

####

$

%

&&&&

Camera matrix K

f

[Eq.9]

Page 30: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Camera Skewness

x

y

xc

yc

C=[cx, cy]θHow many degree does K have?5 degrees of freedom!

f

!P =

α −α cotθ cx 0

0 βsinθ

cy 0

0 0 1 0

#

$

%%%%%

&

'

(((((

xyz1

#

$

%%%%

&

'

((((

Page 31: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Canonical Projective Transformation

P ' =xyz

!

"

####

$

%

&&&&

=1 0 0 00 1 0 00 0 1 0

!

"

###

$

%

&&&

xyz1

!

"

####

$

%

&&&&

xzyz

!

"

####

$

%

&&&&

Pi ' =

P ' =M P

M3

H4 ®Â

[Eq.10]

Page 32: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Lecture 2 -Silvio Savarese 10-Jan-18

• Pinholecameras• Cameras&lenses• Thegeometryofpinholecameras

• Intrinsic• Extrinsic

• Othercameramodels

Lecture2CameraModels

Page 33: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

World reference system

Ow

iw

kw

jwR,T

•The mapping so far is defined within the camera reference system•What if an object is represented in the world reference system?•Need to introduce an additional mapping from world ref system to camera ref system

f

Page 34: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

3D Rotation of PointsRotation around the coordinate axes, counter-clockwise:

úúú

û

ù

êêê

ë

é -=

úúú

û

ù

êêê

ë

é

-=

úúú

û

ù

êêê

ë

é-=

1000cossin0sincos

)(

cos0sin010

sin0cos)(

cossin0sincos0001

)(

gggg

g

bb

bbb

aaaaa

z

y

x

R

R

R

p

x

Y’p’

g

x’

y

zP '→ R 0

0 1

"

#$

%

&'4×4

xyz1

"

#

$$$$

%

&

''''

A rotation matrix in 3D has 3 degree of freedom

Page 35: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

2DTranslation

P

P'

t

Please refer to CA session on transformations for

more details

Page 36: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

2DTranslationEquation

P

x

y

tx

tyP’

t

)ty,tx(' yx ++=+= tPP

),(),(

yx ttyx

==

tP

Page 37: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

2DTranslationusingHomogeneousCoordinates

úúú

û

ù

êêê

ë

é×úúú

û

ù

êêê

ë

é=

úúú

û

ù

êêê

ë

é++

®1100

1001

1' y

xtt

tytx

y

x

y

x

P

P = (x, y)→ (x, y,1)

= I t0 1

!

"#

$

%&⋅

xy1

!

"

###

$

%

&&&=T ⋅

xy1

!

"

###

$

%

&&&

P

x

y

tx

tyP’

t

Page 38: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Scaling

P

P'

Page 39: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

ScalingEquation

P

x

y

sx x

P’sy y

úúú

û

ù

êêê

ë

é×úúú

û

ù

êêê

ë

é=

úúú

û

ù

êêê

ë

é®

11000000

1' y

xs

sysxs

y

x

y

x

P

P = (x, y)→ (x, y,1)

S

= S ' 00 1

!

"#

$

%&⋅

xy1

!

"

###

$

%

&&&= S ⋅

xy1

!

"

###

$

%

&&&

)ys,xs(')y,x( yx=®= PP

Page 40: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Rotation

P

P'

Page 41: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

RotationEquations• Counter-clockwiserotationbyanangle𝜃

úû

ùêë

éúû

ùêë

é -=ú

û

ùêë

éyx

yx

qqqq

cossinsincos

''P

x

y’P’

q

x’y PRP' =

' cos sinx x yq q= -

' cos siny y xq q= +

Howmanydegreesoffreedom? 1 P '→cosθ −sinθ 0sinθ cosθ 00 0 1

#

$

%%%

&

'

(((

xy1

#

$

%%%

&

'

(((

Page 42: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Scale+Rotation+Translation

P '→

1 0 tx0 1 ty0 0 1

"

#

$$$$

%

&

''''

cosθ −sinθ 0sinθ cosθ 00 0 1

"

#

$$$

%

&

'''

sx 0 0

0 sy 0

0 0 1

"

#

$$$$

%

&

''''

xy1

"

#

$$$

%

&

'''

cos in 0 0sin cos 0 00 0 1 0 0 1 1

x x

y y

s t s xt s y

q qq q

-é ù é ù é ùê ú ê ú ê ú= ê ú ê ú ê úê ú ê ú ê úë û ë û ë û

= R t0 1

!

"#

$

%& S 00 1

!

"#

$

%&xy1

!

"

###

$

%

&&&= R S t

0 1

!

"##

$

%&&

xy1

!

"

###

$

%

&&&

Ifsx =sy,thisisasimilaritytransformation

Page 43: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

3D Rotation of PointsRotation around the coordinate axes, counter-clockwise:

úúú

û

ù

êêê

ë

é -=

úúú

û

ù

êêê

ë

é

-=

úúú

û

ù

êêê

ë

é-=

1000cossin0sincos

)(

cos0sin010

sin0cos)(

cossin0sincos0001

)(

gggg

g

bb

bbb

aaaaa

z

y

x

R

R

R

P

x

y’P’

x’

y

zP '→ R 0

0 1

"

#$

%

&'4×4

xyz1

"

#

$$$$

%

&

''''

A rotation matrix in 3D has 3 degrees of freedom

R = Rx (α) Ry (β) Rz (γ )

Page 44: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

3D Translation of Points

P '→ I T0 1

"

#$

%

&'4×4

xyz1

"

#

$$$$

%

&

''''

A translation vector in 3D has 3 degrees of freedom

P

x

y

Tx

Ty

P’

T

z

T =

TxTyTz

!

"

####

$

%

&&&&

Page 45: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

3D Translation and Rotation

P '→ R T0 1

"

#$

%

&'4×4

xyz1

"

#

$$$$

%

&

''''

T =

TxTyTz

!

"

####

$

%

&&&&

R = Rx (α) Ry (β) Rz (γ )

Page 46: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

= K R T!"

#$Pw

World reference system

Ow

iw

kw

jwR,T

P = R T0 1

!

"#

$

%&4×4

PwIn 4D homogeneous coordinates:

Internal parameters External parameters

P ' = K I 0!"

#$P =K I 0!

"#$

R T0 1

!

"%

#

$&4×4

Pw

M

P

P’

f

xwywzw1

!

"

#####

$

%

&&&&&

[Eq.11]

Page 47: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

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

$% 3×4

Pw4×1

The projective transformation

Ow

iw

kw

jwR,T

How many degrees of freedom?5 + 3 + 3 =11!

P

P’

f

Page 48: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

The projective transformation

Ow

iw

kw

jwR,T

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

$% 3×4

Pw4×1úúú

û

ù

êêê

ë

é=

3

2

1

mmm

M

=

m1

m2

m3

!

"

####

$

%

&&&&

PW =m1PWm2PWm3PW

!

"

####

$

%

&&&&

→ (m1Pwm3Pw

, m2Pwm3Pw

)E

P

P’

f

[Eq.12]

Page 49: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Theorem (Faugeras, 1993)

úúú

û

ù

êêê

ë

é=

3

2

1

aaa

A[ ] [ ] ][ bATKRKTRKM ===[Eq.13]

Page 50: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Properties of projective transformations• Points project to points• Lines project to lines• Distant objects look smaller

Page 51: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Properties of Projection•Angles are not preserved•Parallel lines meet!

Parallel lines in the world intersect in the image at a “vanishing point”

Page 52: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Horizon line (vanishing line)

Page 53: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

One-point perspective• Masaccio, Trinity,

Santa Maria Novella, Florence, 1425-28

Credit slide S. Lazebnik

Page 54: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Next lecture

•How to calibrate a camera?

Page 55: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Supplemental material

Page 56: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Thin Lenses

Snell’s law:n1 sin a1 = n2 sin a2

Small angles:n1 a1 » n2 a2

n1 = n (lens)n1 = 1 (air)

zo

zy'z'y

zx'z'x

ïïî

ïïí

ì

=

=

ozf'z +=

)1n(2Rf -

=

Focal length

[FP] sec 1.1, page 8.

Page 57: lecture2 camera models - Stanford Universityweb.stanford.edu/class/cs231a/lectures/lecture2_camera_models.pdfPhotography (Niépce, “La Table Servie,” 1822) Milestones: •Leonardo

Horizon line (vanishing line)

horizon

¥l