lecture 15: introduction to color science...cs184/284a, lecture 15 ren ng, spring 2016 metamers...

Post on 11-Jul-2020

4 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Computer Graphics and Imaging UC Berkeley CS184/284A, Spring 2016

Lecture 15:

Introduction to Color Science

credit: Science Media Group.

Physical Basis of Color

Ren Ng, Spring 2016CS184/284A, Lecture 15

The Fundamental Components of Light

• Newton showed sunlight can be subdivided into a rainbow with a prism • Resulting light cannot be further subdivided with a second prism

Ren Ng, Spring 2016CS184/284A, Lecture 10

Electromagnetic radiation

• Oscillations of different frequencies (wavelengths)

The Visible Spectrum of Light

Image credit: Licensed under CC BY-SA 3.0 via Commons https://commons.wikimedia.org/wiki/File:EM_spectrum.svg#/media/File:EM_spectrum.svg

Visible electromagnetic spectrum

Ren Ng, Spring 2016CS184/284A, Lecture 15

Spectral Power Distribution (SPD)

Salient property in measuring light

• The amount of light present at each wavelength

• Units: watts per nanometer (how much power in a narrow range of wavelengths)

• Often use “relative units” scaled to maximum wavelength for comparison across wavelengths when absolute units are not important

Ren Ng, Spring 2016CS184/284A, Lecture 15

Daylight Spectral Power Distributions Vary

Blue sky Solar disk

[Brian Wandell]

Ren Ng, Spring 2016CS184/284A, Lecture 10

Spectral Power Distribution of Light Sources

Describes distribution of energy by wavelength

Figure credit:

Ren Ng, Spring 2016CS184/284A, Lecture 15

Superposition (Linearity) of Spectral Power Distributions[Brian W

andell]

Ren Ng, Spring 2016CS184/284A, Lecture 15

What is Color?

Colors are the perceptual sensations that arise from seeing light of different wavelengths

• We are sensitive from roughly 380 to 760 nm Color is a phenomenon of human perception; it is not a universal property of light

• Technically speaking, different wavelengths of light are not “colors”

Biological Basis of Color

Ren Ng, Spring 2016CS184/284A, Lecture 15

Anatomy of The Human Eye

Ren Ng, Spring 2016CS184/284A, Lecture 15

Retinal Photoreceptor Cells: Rods and Cones

Rod cells Cone cellsRods are primary receptors in very low light (“scotopic” conditions), e.g. dim moonlight

• ~120 million rods in eye

• Perceive only shades of gray, no color

Cones are primary receptors in typical light levels (“photopic”)

• ~6-7 million cones in eye

• Three types of cones, each with different spectral sensitivity

• Provide sensation of colorhttp://ebooks.bfwpub.com/life.php Figure 45.18

Ren Ng, Spring 2016CS184/284A, Lecture 15

Retinal Photoreceptor Cells: Rods and Cones

http://webvision.med.utah.edu/photo1.html

Rods are primary receptors in very low light (“scotopic” conditions), e.g. dim moonlight

• ~120 million rods in eye

• Perceive only shades of gray, no color

Cones are primary receptors in typical light levels (“photopic”)

• ~6-7 million cones in eye

• Three types of cones, each with different spectral sensitivity

• Provide sensation of color

Ren Ng, Spring 2016CS184/284A, Lecture 15

Spatial Resolution of Rods and Cones in the Retina

• Highest density of cones in fovea (and no rods there)

• “Blind spot” at the optic disc, where optic nerve exits eye

[Roorda 1999]

Ren Ng, Spring 2016CS184/284A, Lecture 15

Fraction of Three Cone Cell Types Varies Widely

Hof

er, H

. et a

l. J.

Neu

rosc

i. 20

05;2

5:96

69-9

679

Distribution of cone cells at edge of fovea in 12 different humans with normal color vision. Note high variability of L/M cone cell percentage. (false color image)

Measuring Light and Color

Ren Ng, Spring 2016CS184/284A, Lecture 15

A Simple Model of a Light DetectorCredit: M

arschner

Ren Ng, Spring 2016CS184/284A, Lecture 15

Mathematics of Light Detection

Same math carries over to power distributions

• Spectrum entering the detector has its spectral power distribution, s(λ)

• Detector has its spectral sensitivity or spectral response, r(λ)

measured signal

input spectrum

detector’s sensitivity

Ren Ng, Spring 2016CS184/284A, Lecture 15

Mathematics of Light Detection

If we think of s and r as vectors, this operation is a dot product (aka inner product) or

• in fact, the computation is done exactly this way, using sampled representations of the spectra.

• let λi be regularly spaced sample points Δλ apart; then:

• this sum is very clearly a dot product

Tristimulus Theory of Color

Ren Ng, Spring 2016CS184/284A, Lecture 15

Spectral Response of Human Cone Cells

Three types of cones: S, M, and L cones (corresponding to peak response at short, medium, and long wavelengths)

Nor

mal

ized

resp

onse

Wavelength (nm)

Ren Ng, Spring 2016CS184/284A, Lecture 15

Response of S,M,L Cones to Monochromatic Light

Figure visualizes cone’s response to monochromatic light (light with energy in a single wavelength) as points in 3D space This is a plot of S, M, L response functions as a point in 3D space.

S

M

L

Marc Levoy

Ren Ng, Spring 2016CS184/284A, Lecture 15

The Human Visual System

• Human eye does not measure and brain does not receive measure of each wavelength of light

• Rather, the eye measures three response values = (S, M, L).

• The result of integrating the incoming spectrum against response functions of S, M, L cones

Kayvon Fatahalian

Ren Ng, Spring 2016CS184/284A, Lecture 15

Metamers

Metameters are two different spectra that integrate to the same (S,M,L) response.

• These will appear to have the same color The existence of metamers is critical to color reproduction

• Don’t have to reproduce the full spectrum of a real world scene

• A metamer can reproduce the perceived appearance of the scene on a monitor, for example

Ren Ng, Spring 2016CS184/284A, Lecture 15

MetamerismColor matching is an important illusion that is understood quantitatively

Brian Wandell

Ren Ng, Spring 2016CS184/284A, Lecture 15

Metamerism is a Big EffectBrian W

andell

Ren Ng, Spring 2016CS184/284A, Lecture 15

Pseudo-Geometric Interpretation

Response of each cone is a dot product (a projection) We are projecting a high dimensional vector (a spectrum) onto three vectors

• Differences that are perpendicular to all 3 vectors are not detectable

For intuition, we can imagine a 3D analog

• 3D stands in for high-D vector of SPD

• 2D stands in for 3D

• Then vision is analogous to projection onto a plane

Slide credit: Steve Marschner

Ren Ng, Spring 2016CS184/284A, Lecture 15

Pseudo-Geometric Interpretation

The information available to the visual system about a spectrum is just three values

• This amounts to aloss of informationanalogous toprojection on a plane

Two spectra thatproduce the sameresponse aremetamers

Slide credit: Steve Marschner

Color Reproduction

Ren Ng, Spring 2016CS184/284A, Lecture 15

Want to match appearance of a spectrum s on an RGB monitor

• Any spectrum that projects to the same point in the visual color space is a good reproduction

Must find a spectrum that the monitor can produce that is a metamer of s

Color Reproduction

r, g, b?

Ren Ng, Spring 2016CS184/284A, Lecture 15

CRT Display Primaries

•Curves determined by phosphor emission propertieswavelength (nm)

Em

issi

on (w

atts

/m2 )

Ren Ng, Spring 2016CS184/284A, Lecture 15

LCD Display Primaries

•Curves determined by (fluorescent) backlight and filters

Ren Ng, Spring 2016CS184/284A, Lecture 15

Pseudo-Geometric Interpretation

In color reproduction, we want to computethe combination ofr, g, b that will projectto the same visualresponse as s. Slide credit: Steve M

arschner

Ren Ng, Spring 2016CS184/284A, Lecture 15

Additive Color Matching Experiment

Show test light spectrum on left Mix “primaries” on right until they match The primaries need not be RGB

Ren Ng, Spring 2016CS184/284A, Lecture 15

Experiment 1

Slide from Durand and Freeman 06

Ren Ng, Spring 2016CS184/284A, Lecture 15

Experiment 1

p1 p2 p3

Slide from Durand and Freeman 06

Ren Ng, Spring 2016CS184/284A, Lecture 15

Experiment 1

p1 p2 p3

Slide from Durand and Freeman 06

Ren Ng, Spring 2016CS184/284A, Lecture 15

Experiment 1

p1 p2 p3

The primary color amounts needed for a match

p1 p2 p3

The primary color amounts needed for a match

Slide from Durand and Freeman 06

Ren Ng, Spring 2016CS184/284A, Lecture 15

Experiment 2

Slide from Durand and Freeman 06

Ren Ng, Spring 2016CS184/284A, Lecture 15

Experiment 2

p1 p2 p3

Slide from Durand and Freeman 06

Ren Ng, Spring 2016CS184/284A, Lecture 15

Experiment 2

p1 p2 p3

Slide from Durand and Freeman 06

Ren Ng, Spring 2016CS184/284A, Lecture 15

Experiment 2

p1 p2 p3 p1 p2 p3

We say a “negative” amount of p2 was needed to make the match, because we added it to the test color’s side.

The primary color amounts needed for a match:

p1 p2 p3

Slide from Durand and Freeman 06

The Color Matching Experiment is Linear

If matches

and matches

matchesthen

Brian Wandell

Ren Ng, Spring 2016CS184/284A, Lecture 15

Additive Color Mixing

• Given three spectral primaries

• We match generic input light with

• Negative light not possible, but can add primary to test light

• Color now described by α, β, γ

p1, p2, p3

� = �p1 + ⇥p2 + ⇤p3

Ren Ng, Spring 2016CS184/284A, Lecture 15

Subtractive Color

Produce desired spectrum by subtracting from white light (usually via absorption by pigments)

Photographic media (slides, prints) work this way

Leads to C, M, Y (cyan, magenta, yellow) as primaries

Approximately, 1 – R, 1 – G, 1 – B

[sou

rce

unkn

own]

Ren Ng, Spring 2016CS184/284A, Lecture 15

Subtractive Color Describes Reflected Spectrum

[Sto

ne 2

003]

CIE RGB Color Matching Experiment

Same setup as additive color matching before, but primaries are monochromatic light (single wavelength) of the following wavelengths defined by CIE standard

The test light is also a monochromatic light

Kayvon Fatahalian

Ren Ng, Spring 2016CS184/284A, Lecture 15

CIE RGB Color Matching Functions

r(�)

g(�)

b(�)

Graph plots how much of each CIE RGB primary light must be combined to match a monochromatic light

Ren Ng, Spring 2016CS184/284A, Lecture 15

Color Reproduction with Matching Functions

r(�)

g(�)

b(�)

For any spectrum s, the perceived color is matched by the following formulas for scaling the CIE RGB primaries

Color Representation

Ren Ng, Spring 2016CS184/284A, Lecture 15

A Universal Color Space: CIE XYZ

Imaginary set of standard color primaries X, Y, Z

Designed such that

• X, Y, Z span all observable colors

• Matching functions are strictly positive

• Y is luminance (brightness absent color)

Imaginary because can only be realized with primaries that are negative at some wavelengths

CIE XYZ color matching functions

Ren Ng, Spring 2016CS184/284A, Lecture 10

Luminance (Lightness)

Integral of radiance scaled by the visual luminous efficiency

Luminous efficiency is a measure of how bright a light at a given wavelength is perceived by a human

https://upload.wikimedia.org/wikipedia/commons/a/a0/Luminosity.png

Dark adapted eye (scotopic)

Daytime adapted eye (photopic)

Y (p,!) =

Z 1

0L(p,!,�)V (�) d�

� (nm)

�v =

Z 1

0�e(�)V (�) d�

Y =

Z�(�)V (�) d�

Ren Ng, Spring 2016CS184/284A, Lecture 15

Separating Luminance, Chromaticity

Luminance: Y Chromaticity: x, y, z, defined as

• since x + y + z = 1, we only need to record two of the three

• usually choose x and y, leading to (x, y, Y) coords

Ren Ng, Spring 2016CS184/284A, Lecture 15

CIE Chromaticity DiagramPure (saturated) spectral colors

around the edge of the plot

Less pure (desaturated) colors

in the interior of the plot

White at the centroid of

the plot (1/3, 1/3)

Ren Ng, Spring 2016CS184/284A, Lecture 15

Gamut

Gamut is the set of chromaticities generated by a set of primaries Because definition of xy is linear, interpolation between chromaticities on a chromaticity plot is also linear So the gamut is the convex hull of the primary chromaticities

Ren Ng, Spring 2016CS184/284A, Lecture 15

Gamut

sRGB is a commoncolor space used throughout theinternet

CIE RGB are the monochromaticprimaries used for color matching tests described earlier

Perceptually Organized Color Spaces

Ren Ng, Spring 2016CS184/284A, Lecture 15

HSV Color Space (Hue-Saturation-Value)

Axes correspond to artistic characteristics of color

Ren Ng, Spring 2016CS184/284A, Lecture 15

Perceptual Non-Uniformity

• In the xy chromaticity diagram at left, MacAdam ellipses show regions of perceptually equivalent color (ellipses enlarged 10x)

• Must non-linearly warp the diagram to achieve uniform perceptual distances

Wikipedia

Ren Ng, Spring 2016CS184/284A, Lecture 15

CIELAB Space (AKA L*a*b*)

A commonly used color space that strives for perceptual uniformity

• L* is lightness

• a* and b* are color-opponent pairs

• a* is red-green, and b* is blue-yellow

• A gamma transform is used for warping because perceived brightness is proportional to scene intensityγ, where γ ≈ 1⁄3

Ren Ng, Spring 2016CS184/284A, Lecture 15

Opponent Color Theory

There’s a good neurological basis for the color space dimensions in CIE LAB

• the brain seems to encode color early on using three axes:

• white — black, red — green, yellow — blue

• the white — black axis is lightness; the others determine hue and saturation

• one piece of evidence: you can have a light green, a dark green, a yellow-green, or a blue-green, but you can’t have a reddish green (just doesn’t make sense)

• thus red is the opponent to green

• another piece of evidence: afterimages (following slides)

slide credit: Steve Marschner

Image Afterimage

Ren Ng, Spring 2016CS184/284A, Lecture 15

Things to Remember

Physics of Light

• Spectral power distribution (SPD)

• Superposition (linearity) Tristimulus theory of color

• Spectral response of human cone cells (S, M, L)

• Metamers - different SPDs with the same perceived color

• Color matching experiment, per-wavelength matching functions

• Color reproduction by integrating color matching functions against input spectrum

Color spaces

• CIE RGB, XYZ, xy chromaticity, LAB, HSV

• Gamut

Art Competition #2 Results

Spring 2016UC Berkeley CS184/284A

Art Competition #2 – Honorable Mention

Allen Zeng

Spring 2016UC Berkeley CS184/284A

Art Competition #2 – Honorable Mention

Annalise Hurst

Spring 2016UC Berkeley CS184/284A

Art Competition #2 – Honorable Mention

Allen Zhao

Spring 2016UC Berkeley CS184/284A

Art Competition #2 – Honorable Mention

Owen Jow

Spring 2016UC Berkeley CS184/284A

Art Competition #2 – Winner

Earth with bump mapping, atmosphere shading and more.Joseph Chen

Ren Ng, Spring 2016CS184/284A, Lecture 15

Acknowledgments

Many thanks and credit for slides to Steve Marschner, Kayvon Fatahalian, Brian Wandell, Marc Levoy, Katherine Breeden and James O’Brien.

top related