15-463: computational photography alexei efros, cmu, fall...

44
Capturing Light… in man and machine 15-463: Computational Photography Alexei Efros, CMU, Fall 2005 Some figures from Steve Seitz, Steve Palmer, Paul Debevec, and Gonzalez et al.

Upload: others

Post on 30-Sep-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Capturing Light… in man and machine

15-463: Computational PhotographyAlexei Efros, CMU, Fall 2005Some figures from Steve Seitz, Steve

Palmer, Paul Debevec, and Gonzalez et al.

Page 2: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Image Formation

Digital Camera

The Eye

Film

Page 3: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Digital camera

A digital camera replaces film with a sensor array• Each cell in the array is light-sensitive diode that converts photons to electrons• Two common types

– Charge Coupled Device (CCD)– CMOS

• http://electronics.howstuffworks.com/digital-camera.htm

Page 4: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Sensor Array

CMOS sensor

Page 5: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Sampling and Quantization

Page 6: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Interlace vs. progressive scan

http://www.axis.com/products/video/camera/progressive_scan.htm

Page 7: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Progressive scan

http://www.axis.com/products/video/camera/progressive_scan.htm

Page 8: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Interlace

http://www.axis.com/products/video/camera/progressive_scan.htm

Page 9: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

The Eye

The human eye is a camera!• Iris - colored annulus with radial muscles• Pupil - the hole (aperture) whose size is controlled by the iris• What’s the “film”?

– photoreceptor cells (rods and cones) in the retina

Page 10: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

The Retina

Cross-section of eye

Ganglion cell layer

Bipolar cell layer

Receptor layer

Pigmentedepithelium

Ganglion axons

Cross section of retina

Page 11: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Retina up-close

Light

Page 12: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

© Stephen E. Palmer, 2002

Conescone-shaped less sensitiveoperate in high lightcolor vision

Two types of light-sensitive receptors

cone

rod

Rodsrod-shapedhighly sensitiveoperate at nightgray-scale vision

Page 13: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Rod / Cone sensitivity

The famous sock-matching problem…

Page 14: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

© Stephen E. Palmer, 2002

Distribution of Rods and Cones

0

150,000100,00050,000

020 40 60 8020406080

Visual Angle (degrees from fovea)

Rods

Cones Cones

Rods

FoveaBlindSpot

# R

ecep

tors

/mm

2

Night Sky: why are there more stars off-center?

Page 15: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Electromagnetic Spectrum

http://www.yorku.ca/eye/photopik.htm

Human Luminance Sensitivity Function

Page 16: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Why do we see light of these wavelengths?

© Stephen E. Palmer, 2002

.

0 1000 2000 3000

Ene

rgy

Wavelength (nm)

400 700

700 C

2000 C

5000 C

10000 C

VisibleRegion

…because that’s where theSun radiates EM energy

Visible Light

Page 17: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

The Physics of Light

Any patch of light can be completely describedphysically by its spectrum: the number of photons (per time unit) at each wavelength 400 - 700 nm.

400 500 600 700

Wavelength (nm.)

# Photons(per ms.)

© Stephen E. Palmer, 2002

Page 18: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

The Physics of Light

# P

hoto

ns

D. Normal Daylight

Wavelength (nm.)

B. Gallium Phosphide Crystal

400 500 600 700

# P

hoto

ns

Wavelength (nm.)

A. Ruby Laser

400 500 600 700

400 500 600 700

# P

hoto

ns

C. Tungsten Lightbulb

400 500 600 700

# P

hoto

ns

Some examples of the spectra of light sources

© Stephen E. Palmer, 2002

Page 19: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

The Physics of Light

Some examples of the reflectance spectra of surfaces

Wavelength (nm)

% P

hoto

ns R

efle

cted

Red

400 700

Yellow

400 700

Blue

400 700

Purple

400 700

© Stephen E. Palmer, 2002

Page 20: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

The Psychophysical Correspondence

There is no simple functional description for the perceivedcolor of all lights under all viewing conditions, but …...

A helpful constraint:Consider only physical spectra with normal distributions

area

Wavelength (nm.)

# Photons

400 700500 600

mean

variance

© Stephen E. Palmer, 2002

Page 21: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

The Psychophysical Correspondence

Mean Hue

yellowgreenblue

# P

hoto

ns

Wavelength

© Stephen E. Palmer, 2002

Page 22: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

The Psychophysical Correspondence

Variance Saturation

Wavelength

high

medium

low

hi.

med.

low# P

hoto

ns

© Stephen E. Palmer, 2002

Page 23: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

The Psychophysical Correspondence

Area Brightness#

Pho

tons

Wavelength

B. Area Lightness

bright

dark

© Stephen E. Palmer, 2002

Page 24: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

© Stephen E. Palmer, 2002

400 450 500 550 600 650

RE

LATI

VE

AB

SO

RB

AN

CE

(%)

WAVELENGTH (nm.)

100

50

440

S

530 560 nm.

M L

Three kinds of cones:

Physiology of Color Vision

• Why are M and L cones so close?• Are are there 3?

Page 25: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

More Spectra

metamers

Page 26: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Color Sensing in Camera (RGB)

3-chip vs. 1-chip: quality vs. costWhy more green?

http://www.cooldihttp://www.cooldictionary.com/words/Bayertionary.com/words/Bayer--filter.wikipediafilter.wikipedia

Why 3 colors?

Page 27: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Practical Color Sensing: Bayer Grid

Estimate RGBat ‘G’ cels from neighboring values

http://www.cooldictionary.com/words/Bayer-filter.wikipedia

Page 28: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

RGB color space

RGB cube• Easy for devices• But not perceptual• Where do the grays live?• Where is hue and saturation?

Page 29: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

HSV

Hue, Saturation, Value (Intensity)• RGB cube on its vertex

Decouples the three components (a bit)Use rgb2hsv() and hsv2rgb() in Matlab

Page 30: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

White Balance

White World / Gray World assumptions

Page 31: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Programming Assignment #1

• How to compare R,G,B channels?• No right answer

• Sum of Squared Differences (SSD):

• Normalized Correlation (NCC):

Page 32: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Image Pyramids (preview)

Known as a Gaussian Pyramid [Burt and Adelson, 1983]• In computer graphics, a mip map [Williams, 1983]• A precursor to wavelet transform

Page 33: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Image Formation

f(x,y) = reflectance(x,y) * illumination(x,y)Reflectance in [0,1], illumination in [0,inf]

Page 34: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Problem: Dynamic Range

15001500

11

25,00025,000

400,000400,000

2,000,000,0002,000,000,000

The real world isHigh dynamic range

Page 35: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

pixel (312, 284) = 42pixel (312, 284) = 42

ImageImage

42 photos?42 photos?

Is Camera a photometer?

Page 36: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Long Exposure

10-6 106

10-6 106

Real world

Picture

0 to 255

High dynamic range

Page 37: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Short Exposure

10-6 106

10-6 106

Real world

Picture

0 to 255

High dynamic range

Page 38: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

sceneradiance

(W/sr/m )

scenesceneradianceradiance

(W/(W/sr/msr/m ))

∫∫sensorirradiance

sensorsensorirradianceirradiance

sensorexposuresensorsensor

exposureexposure222

ΔΔtt

LensLensLens ShutterShutterShutter

analogvoltagesanalog

voltagesdigitalvaluesdigitalvalues

pixelvaluespixel

values

CCDCCD ADCADC RemappingRemapping

Image Acquisition Pipeline

Camera is NOT a photometer!

Page 39: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Varying Exposure

Page 40: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

What does the eye sees?

The eye has a huge dynamic rangeDo we see a true radiance map?

Page 41: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Eye is not a photometer!

"Every light is a shade, compared to the higher lights, till you come to the sun; and every shade is a light, compared to the deeper shades, till you come to the night."

— John Ruskin, 1879

Page 42: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Cornsweet Illusion

Page 43: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

CampbellCampbell--Robson contrast sensitivity curveRobson contrast sensitivity curve

Sine wave

Page 44: 15-463: Computational Photography Alexei Efros, CMU, Fall 2005graphics.cs.cmu.edu/courses/15-463/2005_fall/www/... · 2005. 9. 6. · Capturing Light… in man and machine 15-463:

Metamers

Eye is sensitive to changes(more on this later…)