48
CSCI 1290: Comp Photo Fall 2018 @ Brown University James Tompkin Many slides thanks to James Hays’ old CS 129 course, along with all of its acknowledgements.

CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

CSCI 1290: Comp PhotoFall 2018 @ Brown University

James Tompkin

Many slides thanks to James Hays’ old CS 129 course, along with all of its acknowledgements.

Page 2: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Questions from Tuesday

• Ishaan: what is quantum efficiency?• https://en.wikipedia.org/wiki/Quantum_efficiency

• Literally “the percentage of photons hitting the device's photoreactive surface that produce charge carriers. It is measured in electrons per photon or amps per watt.”

• Leslie: does the eye alias?• Spatially, apparently not. The retina (sensor) has high resolution, but the

optics of the eye cannot meet that resolution, and so the image is blurred optically before being sampled (removes high-frequency content!)

Page 3: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

[Don Pettit]

Page 4: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

[Don Pettit]

Page 5: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Lenses

Page 6: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Let’s design a camera

Idea 1: Put a sensor in front of an object

Do we get a reasonable image?

Slide source: Seitz

sensor

Page 7: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Let’s design a camera

Idea 2: Add a barrier to block most rays– Pinhole in barrier

– Only sense light from one direction.• Reduces blurring.

– In most cameras, this aperture can vary in size.

Slide source: Seitz

sensor

Page 8: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Pinhole camera model

Figure from Forsyth

f

f = Focal length

c = Optical center of the camera

c

Real

object

Page 9: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Projection: world coordinates→image coordinates

Camera

Center

(0, 0, 0)

=

Z

Y

X

P.

.

. f Z Y

=

V

Up

.V

U

Z

fXU *−=

Z

fYV *−=

What is the effect if f and Z are equal?

p = distance from

image center

Image

center

(u0, v0)

Page 10: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Camera Obscura

The first camera• Known to Aristotle

• Depth of the room is the effective focal length

Camera Obscura, Gemma Frisius, 1558

Page 11: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Home-made pinhole camera

http://www.debevec.org/Pinhole/

Why so

blurry?

Page 12: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Shrinking the aperture

Less light gets through

[Steve Seitz]

Integrate over fewer angles

Page 13: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Shrinking the aperture

Why not make the aperture as small as possible?• Less light gets through

• Diffraction effects…

Less light gets through

Slide by Steve Seitz

Page 14: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Shrinking the aperture

Page 15: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

The reason for lenses

Slide by Steve Seitz

Page 16: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Focus and Defocus

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

– other points project to a “circle of confusion” in the image

• Changing the shape of the lens changes this distance

“circle of

confusion”

Slide by Steve Seitz

Page 17: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Thin lenses

Thin lens equation:

• Any object point satisfying this equation is in focus

• What is the shape of the focus region?

• How can we change the focus region?

• Thin lens applet: https://sites.google.com/site/marclevoylectures/applets/operation-of-a-thin-lens(by Andrew Adams, Nora Willett, Marc Levoy) Slide by Steve Seitz

1

𝑓−

1

𝑑𝑜=

1

𝑑𝑖

Page 18: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Beyond Pinholes: Real apertures

Bokeh:

[Rushif – Wikipedia]

Page 19: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Depth Of Field

Page 20: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Depth of Field

http://www.cambridgeincolour.com/tutorials/depth-of-field.htm

Page 21: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Aperture controls Depth of Field

Changing the aperture size affects depth of field• A smaller aperture increases the range in which the object is

approximately in focus

• But small aperture reduces amount of light – need to

increase exposure

Page 22: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Varying the aperture

Large apeture = small DOF Small apeture = large DOF

Page 23: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Depth of Field

Page 24: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Shutters

[The Slo-Mo Guys]

Page 25: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Shutters

[The Slo-Mo Guys]

Page 26: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Shutters

[The Slo-Mo Guys]

Page 27: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Sensor ISO

ISO = old film terminology

= sensitivity to light

ISO 200 is twice as sensitive as ISO 100.

Digital Photography:

ISO = ‘gain’ or amplification of sensor signal

Page 28: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Sensors: Rolling shutter vs. global shutter

Some cameras have purely digital shutters.

[Reddit – r/educationalgifs – u/Mass1m01973]

Page 29: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

EXPOSURE AND NOISE

Page 30: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Play with these settings in lab.

Come back at end to see the relationship.

https://sites.google.com/site/marclevoylectures/applets/variables

-that-affect-exposure

Page 31: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Beyond Pinholes: Real apertures

Bokeh:

[Rushif – Wikipedia]

Page 32: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Accidental Cameras

Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture.

Antonio Torralba, William T. Freeman

Page 33: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Accidental Cameras

James Hays

Page 34: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Field of View (Zoom)

Page 35: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Field of View (Zoom)

Page 36: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Field of View (Zoom) = Cropping

Page 37: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

f

FOV depends of Focal Length

Smaller FOV = larger Focal Length

f

Page 38: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

From Zisserman & Hartley

Page 39: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Field of View / Focal Length

Large FOV, small f

Camera close to car

Small FOV, large f

Camera far from the car

Page 40: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Fun with Focal Length (Jim Sherwood)

http://www.hash.com/users/jsherwood/tutes/focal/Zoomin.mov

Page 41: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Lens Flaws

Page 42: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Lens Flaws: Chromatic Aberration

Dispersion: wavelength-dependent refractive index• (enables prism to spread white light beam into rainbow)

Modifies ray-bending and lens focal length: f()

Color fringes near edges of image

Corrections: add ‘doublet’ lens of flint glass, etc.

Page 43: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Chromatic Aberration

Near Lens Center Near Lens Outer Edge

Page 44: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Radial Distortion (e.g. ‘barrel’ and ‘pin-cushion’)

Straight lines curve around the image center

Page 45: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental

Radial Distortion

Radial distortion of the image• Caused by imperfect lenses

• Deviations are most noticeable for rays

that pass through the edge of the lens

No distortion Pin cushion Barrel

Corrected Barrel Distortion

Image from Martin Habbecke

Page 46: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental
Page 47: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental
Page 48: CSCI 1290: Comp Photo - Brown University€¦ · Accidental Pinhole and Pinspeck Cameras Revealing the scene outside the picture. Antonio Torralba, William T. Freeman. Accidental