114
Lenses, exposure, and (de)focus 15-463, 15-663, 15-862 Computational Photography Fall 2017, Lecture 15 http://graphics.cs.cmu.edu/courses/15-463

Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Lenses, exposure, and (de)focus

15-463, 15-663, 15-862Computational Photography

Fall 2017, Lecture 15http://graphics.cs.cmu.edu/courses/15-463

Page 2: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Course announcements

• Homework 4 is out.- Due October 26th.- Bilateral filter will take a very long time to run.- Final teams are on sign-up spreadsheet.- Drop by Yannis’ office to pick up cameras any time.

• Yannis has extra office hours on Wednesday, 2-4pm.- You can come to ask questions about HW4 (e.g., “how do I use a DSLR camera?”).- You can come to ask questions about final project.

• Project ideas are due on Piazza on Friday 20th.

Page 3: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Overview of today’s lecture

• Motivation for using lenses.

• The thin lens model.

• Real lenses and aberrations.

• Field of view.

• Lens designations.

• Exposure control.

• Lens camera and pinhole camera.

• Telecentric lenses.

Page 4: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Slide credits

Most of these slides were adapted from:

• Kris Kitani (15-463, Fall 2016).• Fredo Durand (MIT).

Some slides borrowed from:

• Gordon Wetzstein (Stanford).

Page 5: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Motivation for using lenses

Page 6: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Pinhole camera

Small (ideal) pinhole:1. Image is sharp.2. Signal-to-noise ratio is low.

Page 7: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Pinhole camera

Large pinhole: 1. Image is blurry.2. Signal-to-noise ratio is high.

Can we get best of both worlds?

Page 8: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Almost, by using lenses

How does this mapping work exactly?Lenses map “bundles” of rays from points on the scene to the sensor.

Page 9: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

The thin lens model

Page 10: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Thin lens modelSimplification of geometric optics for well-designed lenses.

Two assumptions: 1. Rays passing through lens center are unaffected.

Page 11: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Thin lens modelSimplification of geometric optics for well-designed lenses.

Two assumptions: 1. Rays passing through lens center are unaffected.2. Parallel rays converge to a single point located on focal plane.

focal length f

Page 12: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Thin lens modelSimplification of geometric optics for well-designed lenses.

Two assumptions: 1. Rays passing through lens center are unaffected.2. Parallel rays converge to a single point located on focal plane.

focal length f

Page 13: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Thin lens modelSimplification of geometric optics for well-designed lenses.

Two assumptions: 1. Rays passing through lens center are unaffected.2. Parallel rays converge to a single point located on focal plane.

focal length f

Page 14: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Tracing rays through a thin lens

object distance D

Consider an object emitting a bundle of rays. How do they propagate through the lens?

focal length f

Page 15: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Tracing rays through a thin lens

object distance D focal length f

Consider an object emitting a bundle of rays. How do they propagate through the lens?

1. Trace rays through lens center.

Page 16: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Tracing rays through a thin lens

object distance D focal length f

Consider an object emitting a bundle of rays. How do they propagate through the lens?

1. Trace rays through lens center.

2. For all other rays:

Page 17: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Tracing rays through a thin lens

object distance D focal length f

Consider an object emitting a bundle of rays. How do they propagate through the lens?

1. Trace rays through lens center.

2. For all other rays:a. Trace their

parallel through lens center.

Page 18: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Tracing rays through a thin lens

object distance D focal length f

Consider an object emitting a bundle of rays. How do they propagate through the lens?

1. Trace rays through lens center.

2. For all other rays:a. Trace their

parallel through lens center.

b. Connect on focal plane.

Page 19: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Tracing rays through a thin lens

object distance D focal length f

Consider an object emitting a bundle of rays. How do they propagate through the lens?

1. Trace rays through lens center.

2. For all other rays:a. Trace their

parallel through lens center.

b. Connect on focal plane.

Page 20: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Tracing rays through a thin lens

object distance D focal length f

Consider an object emitting a bundle of rays. How do they propagate through the lens?

1. Trace rays through lens center.

2. For all other rays:a. Trace their

parallel through lens center.

b. Connect on focal plane.

Page 21: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Tracing rays through a thin lens

object distance D focal length f

Consider an object emitting a bundle of rays. How do they propagate through the lens?

1. Trace rays through lens center.

2. For all other rays:a. Trace their

parallel through lens center.

b. Connect on focal plane.

Page 22: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Tracing rays through a thin lens

object distance D focal length f

Consider an object emitting a bundle of rays. How do they propagate through the lens?

1. Trace rays through lens center.

2. For all other rays:a. Trace their

parallel through lens center.

b. Connect on focal plane.

Page 23: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Tracing rays through a thin lens

object distance D focal length f

Consider an object emitting a bundle of rays. How do they propagate through the lens?

1. Trace rays through lens center.

2. For all other rays:a. Trace their

parallel through lens center.

b. Connect on focal plane.

Page 24: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Tracing rays through a thin lens

object distance D focal length f

Consider an object emitting a bundle of rays. How do they propagate through the lens?

1. Trace rays through lens center.

2. For all other rays:a. Trace their

parallel through lens center.

b. Connect on focal plane.

Page 25: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Tracing rays through a thin lens

object distance D focal length f

Consider an object emitting a bundle of rays. How do they propagate through the lens?

1. Trace rays through lens center.

2. For all other rays:a. Trace their

parallel through lens center.

b. Connect on focal plane.

Page 26: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Tracing rays through a thin lens

object distance D focal length f

Consider an object emitting a bundle of rays. How do they propagate through the lens?

1. Trace rays through lens center.

2. For all other rays:a. Trace their

parallel through lens center.

b. Connect on focal plane.

Focusing property:1. Rays emitted from a point on one side converge to a point on the other side.

Page 27: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Tracing rays through a thin lens

object distance D focal length f

Consider an object emitting a bundle of rays. How do they propagate through the lens?

1. Trace rays through lens center.

2. For all other rays:a. Trace their

parallel through lens center.

b. Connect on focal plane.

Focusing property:1. Rays emitted from a point on one side converge to a point on the other side.2. Bundles emitted from a plane parallel to the lens converge on a common plane.

Page 28: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Thin lens formula

object distance D focal length f

How can we relate scene-space (D, y) and image space (D’, y’) quantities?

focus distance D’

object height y

image height y’

Page 29: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Thin lens formula

object distance D focal length f

How can we relate scene-space (D, y) and image space (D’, y’) quantities?

focus distance D’

object height y

image height y’

Use similar triangles

Page 30: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Thin lens formula

object distance D focal length f

How can we relate scene-space (D, y) and image space (D’, y’) quantities?

focus distance D’

object height y

image height y’

𝑦

𝑦′= ?

Use similar triangles

Page 31: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Thin lens formula

object distance D focal length f

How can we relate scene-space (D, y) and image space (D’, y’) quantities?

focus distance D’

object height y

image height y’

𝑦

𝑦′=𝐷

𝐷′

Use similar triangles

Page 32: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Thin lens formula

object distance D focal length f

How can we relate scene-space (D, y) and image space (D’, y’) quantities?

focus distance D’

object height y

image height y’

𝑦

𝑦′=𝐷

𝐷′

𝑦

𝑦′= ?

Use similar triangles

Page 33: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

𝑦

𝑦′=

𝑓

𝐷′ − 𝑓

Thin lens formula

object distance D focal length f

How can we relate scene-space (D, y) and image space (D’, y’) quantities?

focus distance D’

object height y

image height y’

𝑦

𝑦′=𝐷

𝐷′

Use similar triangles

Page 34: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Thin lens formula

object distance D focal length f

How can we relate scene-space (D, y) and image space (D’, y’) quantities?

focus distance D’

object height y

image height y’

Use similar triangles• We call m = y / y’ the magnification

1

𝐷′+1

𝐷=1

𝑓

𝑚 =𝑓

𝐷′ − 𝑓

Page 35: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Special focus distancesD’ = f, D = ?, m = ?

1

𝐷′+1

𝐷=1

𝑓

𝑚 =𝑓

𝐷′ − 𝑓

Page 36: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Special focus distancesD’ = f, D = ∞, m = ∞ → infinity focus (parallel rays)

D’ = f

D’ = D = ?, m = ?1

𝐷′+1

𝐷=1

𝑓

𝑚 =𝑓

𝐷′ − 𝑓

Page 37: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Special focus distances

1

𝐷′+1

𝐷=1

𝑓

𝑚 =𝑓

𝐷′ − 𝑓

D’ = f, D = ∞, m = ∞ → infinity focus (parallel rays)

D’ = f

D’ = D = 2 f, m = 1 → object is reproduced in real-life size

D’ = 2 fD = 2 f

Page 38: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Are all our problems solved?

Page 39: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Are all our problems solved?

Page 40: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Are all our problems solved?

objects at a one depth are in focus

objects at all other depths are out of focus

Page 41: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Are all our problems solved?

objects at one depth are in focus

objects at all other depths are out of focus

circle of confusion (i.e., blur kernel)

Is the circle of confusion constant?

Page 42: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Are all our problems solved?

objects at one depth are in focus

objects at all other depths are out of focus

circle of confusion (i.e., blur kernel)

How do we change the depth where objects are in focus?

Page 43: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Real lenses and aberrations

Page 44: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Thin lenses are a fiction

The thin lens model assumes that the lens has no thickness, but this is never true…

To make real lenses behave like ideal thin lenses, we have to use combinations of multiple lens elements (compound lenses).

Page 45: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Thin lenses are a fiction

The thin lens model assumes that the lens has no thickness, but this is never true…

To make real lenses behave like ideal thin lenses, we have to use combinations of multiple lens elements (compound lenses).

Page 46: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Aberrations

glass has dispersion (refractive index changes with wavelength)

focal length shifts with wavelength

glasses of different refractive index

one lens cancels out dispersion of other

Deviations from ideal thin lens behavior (i.e., imperfect focus).

• Example: chromatic aberration.

Using a doublet (two-element compound lens), we can reduce chromatic aberration.

Page 47: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

AberrationsDeviations from ideal thin lens behavior (i.e., imperfect focus).

• Example: chromatic aberration.

• Many other types (coma, spherical, astigmatism.

Why do we wear glasses?

Page 48: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

AberrationsDeviations from ideal thin lens behavior (i.e., imperfect focus).

• Example: chromatic aberration.

• Many other types (coma, spherical, astigmatism.

Why do we wear glasses?

• We turn our eye into a compoundlens to correct aberrations!

Page 49: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Field of view

Page 50: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

What happens as you take a closer look?

Page 51: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Field of view

also known as angle of view 𝜑

Page 52: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Field of view

change in focus

• What happens to field of view when we focus closer?

Page 53: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Field of view

• What happens to field of view when we focus closer? → It decreases.

change in focus

Page 54: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Field of view

change in focal length

• What happens to field of view when we focus closer? → It decreases.• What happens to field of view when we increase focal length?

Note: “zooming” means changing

focal length, which is different from

refocusing

Page 55: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Field of view

change in focal length

• What happens to field of view when we focus closer? → It decreases.• What happens to field of view when we increase focal length? → It decreases.

move sensor to keep focus at same distance

Note: “zooming” means changing

focal length, which is different from

refocusing

Page 56: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Field of view

Page 57: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Field of viewIncreasing the focal length is similar to cropping

f = ?

f = ?

f = ?

Page 58: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Field of viewIncreasing the focal length is similar to cropping

f = 25 mm

f = ?

f = ?

Page 59: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Field of viewIncreasing the focal length is similar to cropping

f = 25 mm

f = 50 mm

f = ?

Page 60: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Field of viewIncreasing the focal length is similar to cropping

f = 25 mm

f = 50 mm

f = 135 mm

Is this effect identical to cropping?

Page 61: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Perspective distortion

short focal length long focal lengthmid focal length

Different focal lengths introduce different perspective distortion at same magnification.

Page 62: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Field of view also depends on sensor size

• What happens to field of view when we reduce sensor size?

Page 63: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Field of view also depends on sensor size

change in focal length

• What happens to field of view when we reduce sensor size? → It decreases.

Page 64: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Field of view also depends on sensor size

• “Full frame” corresponds to standard film size.

• Digital sensors come in smaller formats due to manufacturing limitations (now mostly overcome).

• Lenses are often described in terms of field of view on film instead of focal length.

• These descriptions are invalid when not using full-frame sensor.

Page 65: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Crop factor

How much field of view is cropped when using a sensor

smaller than full frame.

Page 66: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Lens designations

Page 67: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Designation based on field of view

f = 25 mm

f = 50 mm

f = 135 mm

wide-angle

mid-range

telephoto

What focal lengths go to what category depends on sensor size.

• Here we assume full frame sensor (same as 35 mm film).

• Even then, there are no well-defined ranges for each category.

Page 68: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Wide-angle lenses

Lenses with focal length 35 mm or smaller.

They tend to have large and curvy frontal elements.

Page 69: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Wide-angle lenses

Ultra-wide lenses can get impractically wide…

Fish-eye lens: can produce (near) hemispherical field of view.

Page 70: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Telephoto lenses

Lenses with focal length 85 mm or larger.

Telephotos can get very big…

Technically speaking, “telephoto” refers to a specific lens design, not a focal length range. But that design is mostly useful for long focal lengths, so it has also come to mean any lens with such a focal length.

Page 71: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Telephoto lenses

• What is this?• What is its focal length?

Telephotos can get very big…

Page 72: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Prime vs zoom lenses

Prime lens: fixed focal length Zoom lens: variable focal length

single focal length

focus ring: changes focus

distance

focus ring: changes focus

distanceavailable focal length range

zoom ring: changes focal

length

Why use prime lenses and not always use the more versatile zoom lenses?

Page 73: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Prime vs zoom lenses

Prime lens: fixed focal length Zoom lens: variable focal length

single focal length

focus ring: changes focus

distance

focus ring: changes focus

distanceavailable focal length range

zoom ring: changes focal

length

Why use prime lenses and not always use the more versatile zoom lenses?

• Zoom lenses have larger aberrations due to the need to cover multiple focal lengths.

Page 74: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Other kinds of lens designations

Macro lens: can achieve very large magnifications (typically at least 1:1).

• Macro photography: extremely close-up photography.

Achromatic or apochromatic lens: corrected for chromatic aberration.

• Achromatic: two wavelengths have same focus.

• Apochromatic (better): three wavelengths have same focus.

Aspherical lens: manufactured to have special (non-spherical) shape that reduces aberrations.

• Expensive, often only 1-2 elements in a compound lens are aspherical.

Page 75: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Exposure control

Page 76: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Exposure controls brightness of image

Exposure

Aperture

Shutter ISO

Page 77: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Exposure controls brightness of image

Exposure

Aperture

Shutter ISO

Page 78: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Shutter speed

shutter

incoming light

Controls the length of time that shutter remains open.

closed shutter

sensor

Page 79: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Shutter speed

shutter

incoming light

Controls the length of time that shutter remains open.

open shutter

sensor

Page 80: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Shutter speed

Page 81: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Shutter speed

shutter

sensor

incoming light

Controls the period of time that shutter remains open.

open shutterWhat happens to the image as we increase shutter speed?

Page 82: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Side-effects of shutter speed

How can we “simulate” decreasing the shutter speed?

Moving scene elements appear blurry.

Page 83: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Motion deblurring

Shah et al. High-quality Motion Deblurring from a Single Image, SIGGRAPH 2008

Page 84: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Exposure controls brightness of image

Exposure

Aperture

Shutter ISO

Page 85: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Aperture

controls area of lens that receives light

Page 86: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

controls area of lens that receives light

Page 87: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model
Page 88: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Aperture size

Page 89: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Circle of confusionaperture also determines the size of circle

of confusion for out of focus objects

Page 90: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Circle of confusion

Aperture also controls size of circle of confusion for out of focus objects

Take off your glasses and squint.

Page 91: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Depth of field

Range of depths for which the circle of confusion is “acceptable”

Page 92: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model
Page 93: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Depth of field

Page 94: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Depth of fieldSharp depth of field (“bokeh”) is often desirable

Page 95: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Depth of fieldSharp depth of field (“bokeh”) is often desirable … and not just for campaigning reasons

Page 96: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Depth of fieldSharp depth of field (“bokeh”) is often desirable … and not just for campaigning reasons

Page 97: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Depth of fieldForm of bokeh is determined by shape of aperture

Page 98: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Lens “speed”A “fast” lens is one that has a very large max aperture.

Leica Noctilux 50mm f/0.95 (Price tag: > $10,000

Fast lenses tend to be bulky and expensive.

Page 99: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

How can you simulate bokeh?

Page 100: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

How can you simulate bokeh?

Barron et al., “Fast Bilateral-Space Stereo for Synthetic Defocus,” CVPR 2015

Infer per-pixel depth, then blur with depth-dependent kernel.• Example: Google camera “lens blur” feature

Page 101: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Exposure controls brightness of image

Exposure

Aperture

Shutter ISO

Page 102: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

The (in-camera) image processing pipeline

The sequence of image processing operations applied by the camera’s image signal processor (ISP) to convert a RAW image into a “conventional” image.

analog front-end

RAW image (mosaiced,

linear, 12-bit)white

balanceCFA

demosaicingdenoising

color transforms

tone reproduction

compressionfinal RGB

image (non-linear, 8-bit)

Page 103: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Analog front-end

analog amplifier (gain):• gets voltage in range

needed by A/D converter.• accommodates ISO settings.• accounts for vignetting.

look-up table (LUT):• corrects non-linearities in

sensor’s response function (within proper exposure).

• corrects defective pixels.

analog-to-digital converter (ADC):• depending on sensor,

output has 10-16 bits.• most often (?) 12 bits.

analog voltage

analog voltage

discrete signal

discrete signal

“ISO” is an initialism for the International Organization for Standardization

Page 104: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Side-effects of increasing ISOImage becomes very grainy because noise is amplified.

Page 105: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Camera modesAperture priority (“A”): you set aperture, camera sets everything else.• Pros: Direct depth of field control.• Cons: Can require impossible shutter speed (e.g. with f/1.4 for a bright scene).

Shutter speed priority (“S”): you set shutter speed, camera sets everything else.• Pros: Direct motion blur control.• Cons: Can require impossible aperture (e.g. when requesting a 1/1000 speed for a dark scene)

Automatic (“AUTO”): camera sets everything.• Pros: Very fast, requires no experience.• Cons: No control.

Manual (“M”): you set everything.• Pros: Full control.• Cons: Very slow, requires a lot of experience. generic camera mode dial

Page 106: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Lens camera and pinhole camera

Page 107: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

The pinhole camera

real-world object

camera center

image plane

focal length f

Page 108: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

The (rearranged) pinhole camera

real-world object

image plane

focal length fcamera center

Page 109: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

The (rearranged) pinhole camera

camera center

image plane

principal axis

Is this model valid for a camera using a lens?

Page 110: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Telecentric lenses

Page 111: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Orthographic vs pinhole camera

image plane

magnification changes with depth

magnification does not change with depth

What lens do we use for an orthographic camera?

Page 112: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Telecentric lens

object distance D focal length f

Place a pinhole at focal length, so that only rays parallel to primary ray pass through.

focus distance D’

Page 113: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

Regular vs telecentric lens

regular lens telecentric lens

Page 114: Lenses, exposure, and (de)focus - Computer Graphicsgraphics.cs.cmu.edu/courses/15-463/2017_fall/lectures/lecture15.pdf · • Motivation for using lenses. • The thin lens model

References

Basic reading:• Szeliski textbook, Section 2.2.3.

Additional reading:• London and Upton, “Photography,” Pearson 2013.

a great book on photography, discussing in detail many of the issues addressed in this lecture.• Ray, “Applied Photographic Optics,” Focal Press 2002.

another nice book covering everything about photographic optics.• Shah et al., “High-quality Motion Deblurring from a Single Image,” SIGGRAPH 2008.• Fergus et al., “Removing Camera Shake from a Single Image,” SIGGRAPH 2006.

two standard papers on motion deblurring for dealing with long shutter speeds.• Barron et al., “Fast Bilateral-Space Stereo for Synthetic Defocus,” CVPR 2015.

the lens blur paper.