Top Banner
1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY
31

1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

Dec 21, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

1

Computer Science 631Lecture 6: Color

Ramin ZabihComputer Science DepartmentCORNELL UNIVERSITY

Page 2: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

2

Outline

The visible spectrum and human color perception

Color cameras How color is encoded in images

Page 3: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

3

The visible spectrum

Page 4: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

4

Evolution’s camera

Page 5: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

5

Human color perception

There are two kinds of cells in the retina• Rods and cones

– What kind of cells are they?

Most retinal cells are in the fovea (center) Rods sense luminance (black and white)

• Concentrated in the fovea, but not exclusively Cones sense color

Page 6: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

6

Spatial distribution (cross-section)

Page 7: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

7

Rods versus cones Rods are more tolerant in terms of handling

low light conditions• You don’t see color when it’s night

Cones give you better spatial acuity

Page 8: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

8

Different overall light sensitivity

rodscones

Results in thePurkinje shift:What appearsbrightest changesas the sun sets!

Page 9: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

9

Cones come in three flavors

Blue Green

Red

Page 10: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

10

How we see color

It all depends on how much the different cones are stimulated

It is possible to have two different spectra that stimulate cones the same way• Called a metamer

To a person, these colors look the same, but they are (in some sense) completely different

Page 11: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

11

Some colors do not come from a single wavelength

There will never be a purple laser Purple comes from blue (short wavelength)

and red (long wavelength) light• More precisely, the sensation that we call

purple comes from the blue and red cones being stimulated

– And no others!

Page 12: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

12

Blue cones are “odd”

Page 13: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

13

Non-uniform distribution

Blue cones are least dense in the fovea• 3-5%, versus about 8% elsewhere

Red cones are about 33%, fairly evenly distributed

Green are 64% in the fovea, about 55% elsewhere

Page 14: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

14

Another way to see this

Page 15: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

15

Color constancy

As the spectrum of the illuminating light changes, so does the pattern of cone stimulus• Yet your red coat looks the same as you walk

outside!• No one has a good (computational)

understanding of this problem

Page 16: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

16

How many colors can we see?

Humans can discriminate about• 200 hues• 20 saturation values• 500 brightness steps

The NBS lists 267 color names What about across languages?

• Seem to be about 11 basic ones– white, black, red, green, yellow, blue, brown, purple,

pink, orange, gray

Page 17: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

17

Just noticeable difference

These results are for adjacent colors!With a several-second pause, answer is about 12

Page 18: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

18

Additive versus subtractive colors

Paint is colored because of the spectrum it absorbs (subtracts from the incident light)• Red paint absorbs non-red photons• Color filters are another example

Lights have colors because of the spectrum they emit• Televisions and monitors work this way

The two obey different rules!

Page 19: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

19

Subtractive colors

Page 20: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

20

Additive colors

Yellow light plus blue light = what?

Page 21: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

21

Cheap versus expensive cameras

Cheap color (video) cameras have a single CCD• Mask in front of the imaging array• Reduces spatial resolution

More expensive cameras have 3 different video cameras• Color output really is 3 different (independent)

signals

Page 22: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

22

Different wavelengths, different focal lengths

Note: expensive (achromatic) lenses don’t do this

Page 23: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

23

Consequences of different focal lengths

On a single-CCD system, only one color is really in focus• Typically, it’s the green channel

What about the human visual system?

Page 24: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

24

Colorspace

The colorspace is obviously 3-dimensional• Different ways to represent this space• One goal: distance in color space corresponds

to human notion of “similar” colors– Perceptually uniform colorspaces are hard!

The obvious solution is to have one dimension per cone type• Additive, using red, green and blue

Page 25: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

25

RGB color space

Page 26: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

26

How to represent a pure color in RGB

There’s a BIG problem here…

Page 27: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

27

Another way to think about color

RGB maps nicely onto the way monitors phosphors are designed• Cameras naturally provide something like RGB• 3 different wavelengths

But there is a more natural way to think about color• Hue, saturation, brightness

Page 28: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

28

Hue, saturation and brightness

H dominant

wavelength

Spurity

% white

Bluminance

Page 29: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

29

Color wheel (constant brightness)

In this view of color,there is a color cone

(this is a cross-section)

Page 30: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

30

CIE colorspace

Page 31: 1 Computer Science 631 Lecture 6: Color Ramin Zabih Computer Science Department CORNELL UNIVERSITY.

31

CIE color chart

X+Y+Z is more or less luminosity• Let’s look at the plane X+Y+Z = 1