1 of 60

CS131: Computer Vision: Foundations and Applications

Juan Carlos Niebles, Adrien Gaidon, Silvio Savarese

April 13, 2026

Lecture 5Camera Models

& Geometric

Primitives

Silvio Savarese & Jeanette Bohg

Lecture 2 -

2 of 60

13-Apr-26

  • Intro
  • Pinhole cameras
  • Cameras & lenses
  • The geometry of pinhole
  • Geometric primitives

Agenda�

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

Silvio Savarese & Jeanette Bohg

Lecture 2 -

3 of 60

3D Computer Vision

Slide credit: Andreas Geiger

Silvio Savarese

Lecture 2 -

4 of 60

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?

5 of 60

Pinhole camera

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

Aperture

6 of 60

Some history…

Milestones:

  • Leonardo da Vinci (1452-1519):

first record of camera obscura (1502)

7 of 60

Some history…

Milestones:

  • Leonardo da Vinci (1452-1519): first record of camera obscura
  • Johann Zahn (1685): first portable camera

8 of 60

Some history…

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

9 of 60

Some history…

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)

10 of 60

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

11 of 60

Pinhole perspective projection

Pinhole camera

f

f = focal length

o = aperture = pinhole = center of the camera

o

12 of 60

Pinhole camera

Derived using similar triangles

[Eq. 1]

f

13 of 60

O

P = [x, z]

P’=[x’, f ]

f

i

k

Pinhole camera

[Eq. 2]

f

14 of 60

Kate lazuka ©

Pinhole camera

Is the size of the aperture important?

15 of 60

Shrinking

aperture

size

Adding lenses!

  • What happens if the aperture is too small?
  • Less light passes through

16 of 60

  • A lens focuses light onto the film

Cameras & Lenses

image

P

P’

17 of 60

  • 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

image

P

P’

18 of 60

  • 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

19 of 60

    • 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

20 of 60

f

Paraxial refraction model

zo

-z

Z

From Snell’s law:

[Eq. 3]

P = [x,y,z]

p’ = [x’,y’]

[Eq. 1]

21 of 60

f

Paraxial refraction model

zo

-z

Z

From Snell’s law:

[Eq. 3]

[Eq. 4]

P = [x,y,z]

p’ = [x’,y’]

22 of 60

Issues with lenses: Radial Distortion

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

No distortion

Pin cushion

Barrel (fisheye lens)

Image magnification decreases with distance from the optical axis

23 of 60

13-Apr-26

  • Intro
  • Pinhole cameras
  • Cameras & lenses
  • The geometry of pinhole cameras
    • Intrinsic
    • Extrinsic
  • Geometric primitives

Agenda�

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

Silvio Savarese & Jeanette Bohg

Lecture 2 -

24 of 60

Pinhole perspective projection

Pinhole camera

f = focal length

o = center of the camera

[Eq. 1]

f

25 of 60

From retina plane to images

Pixels, bottom-left coordinate systems

f

Retina plane

Digital image

26 of 60

Coordinate systems

f

x

y

xc

yc

C’’=[cx, cy]

  1. Off set

[Eq. 5]

27 of 60

Converting to pixels

  1. Off set
  2. From metric to pixels

x

y

xc

yc

C=[cx, cy]

: pixel

Non-square pixels

f

[Eq. 6]

Units:

k,l : pixel/m

f : m

28 of 60

  • Is this a linear transformation?

x

y

xc

yc

C=[cx, cy]

Is this projective transformation linear?

f

[Eq. 7]

No — division by z is nonlinear

  • Can we express it in a matrix form?

29 of 60

Homogeneous coordinates

homogeneous image

coordinates

homogeneous scene

coordinates

  • Converting back from homogeneous coordinates

E🡪H

H🡪E

30 of 60

Projective transformation in the homogenous coordinate system

31 of 60

Projective transformation in the homogenous coordinate system

[Eq.8]

Homogenous

Euclidian

32 of 60

The Camera Matrix

Camera

matrix K

f

[Eq.9]

33 of 60

Camera Skewness

x

y

xc

yc

C=[cx, cy]

f

34 of 60

Degrees of freedom of K

x

y

xc

yc

C=[cx, cy]

How many degrees of freedom does K have?

f

5 degrees of freedom!

35 of 60

Canonical Projective Transformation

M

[Eq.10]

36 of 60

13-Apr-26

  • Pinhole cameras
  • Cameras & lenses
  • The geometry of pinhole cameras
    • Intrinsic
    • Extrinsic
  • Geometric primitives

Lecture 2�Camera Models�

Silvio Savarese & Jeanette Bohg

Lecture 2 -

37 of 60

World reference system

Ow

iw

kw

jw

R,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

38 of 60

2D Translation

P

P'

t

39 of 60

2D Translation Equation

P

x

y

tx

ty

P

t

40 of 60

2D Translation using Homogeneous Coordinates

P

x

y

tx

ty

P

t

?

41 of 60

Scaling

P

P'

42 of 60

Scaling Equation

P

x

y

sx x

P

sy y

43 of 60

Rotation

P

P'

44 of 60

Rotation Equations

 

P

x

y’

P

θ

x’

y

How many degrees of freedom?

1

45 of 60

Scale + Rotation + Translation

If sx = sy, this is a

similarity

transformation

46 of 60

3D Translation of Points

A translation vector in 3D has 3 degrees of freedom

P

x

y

Tx

Ty

P

T

z

I

47 of 60

3D Rotation of Points

Rotation around the coordinate axes, counter-clockwise:

P

x

y’

P

x’

y

z

A rotation matrix in 3D has 3 degrees of freedom

48 of 60

3D Translation and Rotation

49 of 60

World reference system

Ow

iw

kw

jw

R,T

In 4D homogeneous coordinates:

Internal parameters

External parameters

P

P’

f

[Eq.11]

[Eq.9]

50 of 60

The projective transformation

Ow

iw

kw

jw

R,T

How many degrees of freedom does M have?

5 + 3 + 3 =11!

P

P’

f

[Eq.11]

51 of 60

The projective transformation

Ow

iw

kw

jw

R,T

E

P

P’

f

[Eq.12]

52 of 60

Theorem (Faugeras, 1993)

[Eq.13]

53 of 60

Properties of projective transformations

  • Points project to points
  • Lines project to lines
  • Distant objects look smaller

54 of 60

Properties of Projection

  • Angles are not preserved
  • Parallel lines meet!

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

55 of 60

Horizon line (vanishing line)

56 of 60

One-point perspective

  • Masaccio, Trinity, Santa Maria Novella, Florence, 1425-28

Credit slide S. Lazebnik

57 of 60

Next lecture

  • How to calibrate a camera?�

58 of 60

Supplemental material

59 of 60

Thin Lenses

Snell’s law:

n1 sin α1 = n2 sin α2

Small angles:

n1 α1n2 α2

n1 = n (lens)

n1 = 1 (air)

zo

Focal length

[FP] sec 1.1, page 8.

60 of 60

Horizon line (vanishing line)

horizon