lecture 11: camera models - github pages · focalpoint f •a lens focuses light onto thefilm...

27
Lecture 11: Camera Models CSE 152: Computer Vision Hao Su Credit: CS231a, Stanford, Silvio Savarese

Upload: others

Post on 27-Jun-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

Lecture 11: Camera Models

CSE 152: Computer VisionHao Su

Credit: CS231a, Stanford, Silvio Savarese

Page 2: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

Agenda• Pinhole cameras• Cameras & lenses• The geometry of pinhole cameras

Page 3: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

Agenda• Pinhole cameras• Cameras & lenses• The geometry of pinhole cameras

Page 4: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

Pinhole camera

f

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

o

Page 5: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

ï

ï í yïîy'= f z

zìx'= f x

Pinhole camera

Derived using similar triangles

[Eq. 1]

f

Page 6: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

O

P = [x, z]

P’=[x’, f ]

f xf z

=x¢

i

k

Pinhole camera

[Eq. 2]

f

Page 7: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

Kate lazuka ©

Is the size of the apertureimportant?

Pinhole camera

Page 8: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

Shrinking aperture

size

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

-Less light passes through

Page 9: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

Agenda• Pinhole cameras• Cameras & lenses• The geometry of pinhole cameras

Page 10: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

Cameras & Lenses

• A lens focuses light onto the film

imageP

P’

Page 11: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

focal point

f

• 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

Cameras & Lenses

Page 12: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

Pin cushion

Barrel (fisheye lens)

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

edge of the lens

No distortion

Image magnification decreases with distance from the optical axis

Page 13: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

Agenda• Pinhole cameras• Cameras & lenses• The geometry of pinhole cameras

– Intrinsic– Extrinsic

Page 14: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

Pinhole camera

f = focal lengtho = center of the camera

 3®Â2E

ï

ïí yïîy'= f z

zìx'= f x

f

Page 15: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

From retina plane to images

Pixels, bottom-left coordinate systems

fRetina plane

Digital image

Page 16: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

Coordinate systems

x

y

xc

yc

C’’=[cx, cy]z zx y(x, y, z)® (f x + c , f y + c )

[Eq. 5]

1. Offset

Page 17: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

Converting to pixels

Page 18: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

x

y

xc

yc

C=[cx, cy]

z zx yP = (x, y, z)→P '= (α x +c , β y +c )

Is this projective transformation linear?

f

[Eq. 7]

• Is this a linear transformation?No — division by z is nonlinear

• Can we express it in a matrix form?

Page 19: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

Homogeneous coordinates

homogeneous image coordinates

homogeneous scene coordinates

• Converting back from homogeneous coordinates

Page 20: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

Projective transformation in the homogenous coordinate system

Page 21: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

Camera Skewness

Page 22: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

World reference system

intrinsic extrinsic

Page 23: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

The projective transformation

Page 24: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

Properties of projective transformations• Points project to points• line project to lines, rays or degenerate into points• Distant objects look smaller

Page 25: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

Properties of Projection

• Angles are not preserved• Parallel lines meet (except for

horizontal lines)

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

Page 26: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

Horizon line (vanishing line)

• Angles are not preserved• Parallel lines meet (except for

horizontal lines)

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

Page 27: Lecture 11: Camera Models - GitHub Pages · focalpoint f •A lens focuses light onto thefilm –All rays parallel to the optical (or principal) axis converge to one point (the focal

Horizon line (vanishing line)