Causes of color

33
1 Computer Vision - A Modern Approach Set: Color Causes of color The sensation of color is caused by the brain. Some ways to get this sensation include: Pressure on the eyelids Dreaming, hallucinations, etc. Main way to get it is the response of the visual system to the presence/absence of light at various wavelengths. Light could be produced in different amounts at different wavelengths (compare the sun and a fluorescent light bulb). Light could be differentially reflected (e.g. some pigments). It could be differentially refracted - (e.g. Newton’s prism) Wavelength dependent specular reflection - e.g. shiny copper penny (actually most metals). Flourescence - light at invisible wavelengths is absorbed and reemitted at visible wavelengths. Computer Vision - A Modern Approach Set: Color Radiometry for color All definitions are now “per unit wavelength” All units are now “per unit wavelength” All terms are now “spectral” Radiance becomes spectral radiance watts per square meter per steradian per unit wavelength Radiosity --- spectral radiosity

Transcript of Causes of color

Page 1: Causes of color

1

Computer Vision - A Modern ApproachSet: Color

Causes of color

• The sensation of color is causedby the brain.

• Some ways to get this sensationinclude:– Pressure on the eyelids– Dreaming, hallucinations, etc.

• Main way to get it is theresponse of the visual system tothe presence/absence of light atvarious wavelengths.

• Light could be produced indifferent amounts at differentwavelengths (compare the sun anda fluorescent light bulb).

• Light could be differentiallyreflected (e.g. some pigments).

• It could be differentially refracted -(e.g. Newton’s prism)

• Wavelength dependent specularreflection - e.g. shiny copper penny(actually most metals).

• Flourescence - light at invisiblewavelengths is absorbed andreemitted at visible wavelengths.

Computer Vision - A Modern ApproachSet: Color

Radiometry for color

• All definitions are now “per unit wavelength”• All units are now “per unit wavelength”• All terms are now “spectral”• Radiance becomes spectral radiance

– watts per square meter per steradian per unit wavelength• Radiosity --- spectral radiosity

Page 2: Causes of color

2

Computer Vision - A Modern ApproachSet: Color

Black body radiators

• Construct a hot body with near-zero albedo (black body)– Easiest way to do this is to build a hollow metal object with a tiny

hole in it, and look at the hole.• The spectral power distribution of light leaving this object

is a simple function of temperature

• This leads to the notion of color temperature --- thetemperature of a black body that would look the same

E l( ) µ1l5

Ê Ë

ˆ ¯

1exp hc klT( )-1

Ê

Ë Á

ˆ

¯ ˜

Computer Vision - A Modern ApproachSet: Color

Measurements ofrelative spectral powerof sunlight, made by J.Parkkinen and P.Silfsten. Relativespectral power is plottedagainst wavelength innm. The visible range isabout 400nm to 700nm.The color names on thehorizontal axis give thecolor names used formonochromatic light ofthe correspondingwavelength --- the“colors of the rainbow”.Mnemonic is “Richardof York got blisters inVenice”.

Violet Indigo Blue Green Yellow Orange Red

Page 3: Causes of color

3

Computer Vision - A Modern ApproachSet: Color

Relative spectral powerof two standardilluminant models ---D65 models sunlight,andilluminant A modelsincandescent lamps.Relative spectral poweris plotted againstwavelength in nm. Thevisible range is about400nm to 700nm. Thecolor names on thehorizontal axis give thecolor names used formonochromatic light ofthe correspondingwavelength --- the“colors of the rainbow”.

Violet Indigo Blue Green Yellow Orange Red

Computer Vision - A Modern ApproachSet: Color

Measurements ofrelative spectral powerof four different artificialilluminants, made byH.Sugiura. Relativespectral power is plottedagainst wavelength innm. The visible range isabout 400nm to 700nm.

Page 4: Causes of color

4

Computer Vision - A Modern ApproachSet: Color

Spectral albedoes forseveral different leaves,with color namesattached. Notice thatdifferent colorstypically have differentspectral albedo, but thatdifferent spectralalbedoes may result inthe same perceivedcolor (compare the twowhites). Spectralalbedoes are typicallyquite smooth functions.Measurements byE.Koivisto.

Computer Vision - A Modern ApproachSet: Color

The appearance of colors

• Color appearance is stronglyaffected by (at least):

– other nearby colors,– adaptation to previous views– “state of mind”

• We show several demonstrations inwhat follows.

• Film color mode:View a colored surface

through a hole in a sheet, so thatthe color looks like a film in space;controls for nearby colors, and stateof mind.

• Other modes:– Surface color– Volume color– Mirror color– Illuminant color

Page 5: Causes of color

5

Computer Vision - A Modern ApproachSet: Color

The appearance of colors

• Hering, Helmholtz: Color appearance isstrongly affected by other nearbycolors, by adaptation to previous views,and by “state of mind”

• Film color mode: View acolored surface through a hole in asheet, so that the color looks like a filmin space; controls for nearby colors, andstate of mind.

– Other modes:• Surface color• Volume color• Mirror color• Illuminant color

• By experience, it is possible tomatch almost all colors, viewed infilm mode using only three primarysources - the principle oftrichromacy.

– Other modes may have moredimensions

• Glossy-matte• Rough-smooth

• Most of what follows discussesfilm mode.

Computer Vision - A Modern ApproachSet: Color

Page 6: Causes of color

6

Computer Vision - A Modern ApproachSet: Color

Computer Vision - A Modern ApproachSet: Color

Page 7: Causes of color

7

Computer Vision - A Modern ApproachSet: Color

Why specify color numerically?

• Accurate color reproduction iscommercially valuable

– Many products are identified bycolor (“golden” arches;

• Few color names are widelyrecognized by English speakers -

– About 10; other languages havefewer/more, but not many more.

– It’s common to disagree onappropriate color names.

• Color reproduction problemsincreased by prevalence of digitalimaging - e.g.. digital libraries ofart.

– How do we ensure that everyonesees the same color?

Computer Vision - A Modern ApproachSet: Color

Color matching experiments - I

• Show a split field to subjects; one side shows the lightwhose color one wants to measure, the other a weightedmixture of primaries (fixed lights).

• Each light is seen in film color mode.

Page 8: Causes of color

8

Computer Vision - A Modern ApproachSet: Color

Color matching experiments - II

• Many colors can be represented as a mixture of A, B, C• write

M=a A + b B + c C where the = sign should be read as “matches”• This is additive matching.• Gives a color description system - two people who agree

on A, B, C need only supply (a, b, c) to describe a color.

Computer Vision - A Modern ApproachSet: Color

Subtractive matching

• Some colors can’t be matched like this:instead, must write

M+a A = b B+c C• This is subtractive matching.• Interpret this as (-a, b, c)• Problem for building monitors: Choose R, G, B such

that positive linear combinations match a large set ofcolors

Page 9: Causes of color

9

Computer Vision - A Modern ApproachSet: Color

The principle of trichromacy

• Experimental facts:– Three primaries will work for most people if we allow subtractive

matching• Exceptional people can match with two or only one primary.• This could be caused by a variety of deficiencies.

– Most people make the same matches.• There are some anomalous trichromats, who use three

primaries but make different combinations to match.

Computer Vision - A Modern ApproachSet: Color

Grassman’s Laws

• For color matches made in film color mode:– symmetry: U=V <=>V=U– transitivity: U=V and V=W => U=W– proportionality: U=V <=> tU=tV– additivity: if any two (or more) of the statements

U=V,W=X,(U+W)=(V+X) are true, then so is the third

• These statements are as true as any biological law. Theymean that color matching in film color mode is linear.

Page 10: Causes of color

10

Computer Vision - A Modern ApproachSet: Color

Linear color spaces

• A choice of primaries yields alinear color space --- thecoordinates of a color are givenby the weights of the primariesused to match it.

• Choice of primaries isequivalent to choice of colorspace.

• RGB: primaries aremonochromatic energies are645.2nm, 526.3nm, 444.4nm.

• CIE XYZ: Primaries areimaginary, but have otherconvenient properties. Colorcoordinates are (X,Y,Z), whereX is the amount of the Xprimary, etc.– Usually draw x, y, where

x=X/(X+Y+Z)y=Y/(X+Y+Z)

Computer Vision - A Modern ApproachSet: Color

Color matching functions

• Choose primaries, say A, B, C• Given energy function,

what amounts of primaries willmatch it?

• For each wavelength, determinehow much of A, of B, and of Cis needed to match light of thatwavelength alone.

• These are colormatchingfunctions

a(l)b(l )c(l )

E(l) Then our match is:

a(l)E(l)dl Ú{ }A +

b(l)E(l)dlÚ{ }B +

c(l)E(l)dlÚ{ }C

Page 11: Causes of color

11

Computer Vision - A Modern ApproachSet: Color

RGB: primaries aremonochromatic, energies are645.2nm, 526.3nm, 444.4nm.Color matching functions havenegative parts -> some colorscan be matched onlysubtractively.

Computer Vision - A Modern ApproachSet: Color

CIE XYZ: Colormatching functions arepositive everywhere, butprimaries are imaginary.Usually draw x, y, wherex=X/(X+Y+Z)

y=Y/(X+Y+Z)

Page 12: Causes of color

12

Computer Vision - A Modern ApproachSet: Color

A qualitative rendering ofthe CIE (x,y) space. Theblobby region representsvisible colors. There aresets of (x, y) coordinatesthat don’t represent realcolors, because theprimaries are not real lights(so that the color matchingfunctions could be positiveeverywhere).

Computer Vision - A Modern ApproachSet: Color

A plot of the CIE (x,y)space. We show thespectral locus (the colorsof monochromaticlights) and the black-body locus (the colors ofheated black-bodies). Ihave also plotted therange of typicalincandescent lighting.

Page 13: Causes of color

13

Computer Vision - A Modern ApproachSet: Color

Non-linear color spaces

• HSV: Hue, Saturation, Value are non-linear functions ofXYZ.– because hue relations are naturally expressed in a circle

• Uniform: equal (small!) steps give the same perceivedcolor changes.

• Munsell: describes surfaces, rather than lights - lessrelevant for graphics. Surfaces must be viewed underfixed comparison light

Computer Vision - A Modern ApproachSet: Color

HSV hexcone

Page 14: Causes of color

14

Computer Vision - A Modern ApproachSet: Color

Uniform color spaces

• McAdam ellipses (next slide) demonstrate that differencesin x,y are a poor guide to differences in color

• Construct color spaces so that differences in coordinatesare a good guide to differences in color.

Computer Vision - A Modern ApproachSet: Color

Variations in color matches on a CIE x, y space. At the center of the ellipse is the color of atest light; the size of the ellipse represents the scatter of lights that the human observers testedwould match to the test color; the boundary shows where the just noticeable difference is.The ellipses on the left have been magnified 10x for clarity; on the right they are plotted toscale. The ellipses are known as MacAdam ellipses after their inventor. The ellipses at thetop are larger than those at the bottom of the figure, and that they rotate as they move up.This means that the magnitude of the difference in x, y coordinates is a poor guide to thedifference in color.

Page 15: Causes of color

15

Computer Vision - A Modern ApproachSet: Color

CIE u’v’ which is aprojective transformof x, y. We transformx,y so that ellipses aremost like one another.Figure shows thetransformed ellipses.

Computer Vision - A Modern ApproachSet: Color

Color receptors and color deficiency

• Trichromacy is justified - incolor normal people, there arethree types of color receptor,called cones, which vary intheir sensitivity to light atdifferent wavelengths (shownby molecular biologists).

• Deficiency can be caused byCNS, by optical problems in theeye, or by absent receptor types– Usually a result of absent

genes.

• Some people have fewer thanthree types of receptor; mostcommon deficiency is red-greencolor blindness in men.

• Color deficiency is lesscommon in women; red andgreen receptor genes are carriedon the X chromosome, andthese are the ones that typicallygo wrong. Women need twobad X chromosomes to have adeficiency, and this is lesslikely.

Page 16: Causes of color

16

Computer Vision - A Modern ApproachSet: Color

Color receptors

• Principle of univariance:cones give the same kind ofresponse, in different amounts,to different wavelengths. Theoutput of the cone is obtainedby summing over wavelengths.Responses are measured in avariety of ways (comparingbehavior of color normal andcolor deficient subjects).

• All experimental evidencesuggests that the response of thek’th type of cone can be writtenas

where is the sensitivityof the receptor and spectralenergy density of the incominglight.

rÚ k(l)E(l)dl

rk (l)

Computer Vision - A Modern ApproachSet: Color

Color receptors

• Plot shows relative sensitivityas a function of wavelength, forthe three cones. The S (forshort) cone responds moststrongly at short wavelengths;the M (for medium) at mediumwavelengths and the L (forlong) at long wavelengths.

• These are occasionally called B,G and R cones respectively, butthat’s misleading - you don’tsee red because your R cone isactivated.

Page 17: Causes of color

17

Computer Vision - A Modern ApproachSet: Color

Adaptation phenomena

• The response of your colorsystem depends both on spatialcontrast and what it has seenbefore (adaptation)

• This seems to be a result ofcoding constraints --- receptorsappear to have an operatingpoint that varies slowly overtime, and to signal some sort ofoffset. One form of adaptationinvolves changing thisoperating point.

• Common example: walk insidefrom a bright day; everythinglooks dark for a bit, then takesits conventional brightness.

Computer Vision - A Modern ApproachSet: Color

Page 18: Causes of color

18

Computer Vision - A Modern ApproachSet: Color

Computer Vision - A Modern ApproachSet: Color

Page 19: Causes of color

19

Computer Vision - A Modern ApproachSet: Color

Computer Vision - A Modern ApproachSet: Color

Page 20: Causes of color

20

Computer Vision - A Modern ApproachSet: Color

Computer Vision - A Modern ApproachSet: Color

Page 21: Causes of color

21

Computer Vision - A Modern ApproachSet: Color

Viewing colored objects

• Assume diffuse+specular model

• Specular– specularities on dielectric

objects take the color of thelight

– specularities on metals can becolored

• Diffuse– color of reflected light depends

on both illuminant and surface– people are surprisingly good at

disentangling these effects inpractice (color constancy)

– this is probably where some ofthe spatial phenomena in colorperception come from

Computer Vision - A Modern ApproachSet: Color

When one views a coloredsurface, the spectralradiance of the lightreaching the eye dependson both the spectralradiance of the illuminant,and on the spectral albedoof the surface. We’reassuming that camerareceptors are linear, likethe receptors in the eye.This is usually the case.

Page 22: Causes of color

22

Computer Vision - A Modern ApproachSet: Color

Subtractive mixing of inks

• Inks subtract light from white,whereas phosphors glow.

• Linearity depends on pigmentproperties– inks, paints, often hugely non-

linear.• Inks: Cyan=White-Red,

Magenta=White-Green,Yellow=White-Blue.

• For a good choice of inks, andgood registration, matching islinear and easy

• e.g.. C+M+Y=White-White=BlackC+M=White-Yellow=Blue

• Usually require CMY andBlack, because colored inks aremore expensive, andregistration is hard

• For good choice of inks, there isa linear transform betweenXYZ and CMY

Computer Vision - A Modern ApproachSet: Color

Finding Specularities

• Assume we are dealing with dielectrics– specularly reflected light is the same color as the source

• Reflected light has two components– diffuse– specular– and we see a weighted sum of these two

• Specularities produce a characteristic dogleg in thehistogram of receptor responses– in a patch of diffuse surface, we see a color multiplied by different

scaling constants (surface orientation)– in the specular patch, a new color is added; a “dog-leg” results

Page 23: Causes of color

23

Computer Vision - A Modern ApproachSet: Color

R

G

B

Illuminant color

Diffuse component

T

S

Computer Vision - A Modern ApproachSet: Color

R

G

B

R

G

B

Diffuseregion

Boundary ofspecularity

Page 24: Causes of color

24

Computer Vision - A Modern ApproachSet: Color

Color constancy

• Assume we’ve identified and removed specularities• The spectral radiance at the camera depends on two things

– surface albedo– illuminant spectral radiance– the effect is much more pronounced than most people think (see following

slides)• We would like an illuminant invariant description of the surface

– e.g. some measurements of surface albedo– need a model of the interactions

• Multiple types of report– The color of paint I would use is– The color of the surface is– The color of the light is

Computer Vision - A Modern ApproachSet: Color

Notice how thecolor of light atthe camera varieswith the illuminantcolor; here we havea uniform reflectanceilluminated by five different lights, andthe result plotted onCIE x,y

Page 25: Causes of color

25

Computer Vision - A Modern ApproachSet: Color

Notice how thecolor of light atthe camera varieswith the illuminantcolor; here we havethe blue flowerilluminated by five different lights, andthe result plotted onCIE x,y. Notice how itlooks significantly moresaturated under somelights.

Computer Vision - A Modern ApproachSet: Color

Notice how thecolor of light atthe camera varieswith the illuminantcolor; here we havea green leafilluminated by five different lights, andthe result plotted onCIE x,y

Page 26: Causes of color

26

Computer Vision - A Modern ApproachSet: Color

Computer Vision - A Modern ApproachSet: Color

Page 27: Causes of color

27

Computer Vision - A Modern ApproachSet: Color

Computer Vision - A Modern ApproachSet: Color

Land’s Demonstration

Page 28: Causes of color

28

Computer Vision - A Modern ApproachSet: Color

Lightness Constancy

• Lightness constancy– how light is the surface, independent of the brightness of the illuminant– issues

• spatial variation in illumination• absolute standard

– Human lightness constancy is very good• Assume

– frontal 1D “Surface”– slowly varying illumination– quickly varying surface reflectance

Computer Vision - A Modern ApproachSet: Color

Page 29: Causes of color

29

Computer Vision - A Modern ApproachSet: Color

Computer Vision - A Modern ApproachSet: Color

Lightness Constancy in 2D

• Differentiation, thresholding areeasy– integration isn’t– problem - gradient field may

no longer be a gradient field• One solution

– Choose the function whosegradient is “most like”thresholded gradient

• This yields a minimizationproblem

• How do we choose the constantof integration?– average lightness is gray– lightest object is white– ?

Page 30: Causes of color

30

Computer Vision - A Modern ApproachSet: Color

Simplest color constancy

• Adjust three receptor channels independently– Von Kries– Where does the constant come from?

• White patch• Averages• Some other known reference (faces, nose)

Computer Vision - A Modern ApproachSet: Color

Color Constancy - I

• We need a model of interactionbetween illumination andsurface color– finite dimensional linear model

seems OK

• Finite Dimensional LinearModel (or FDLM)– surface spectral albedo is a

weighted sum of basisfunctions

– illuminant spectral exitance isa weighted sum of basisfunctions

– This gives a quite simple formto interaction between the two

Page 31: Causes of color

31

Computer Vision - A Modern ApproachSet: Color

Finite Dimensional Linear Models

E l( ) = eiyi l( )i=1

m

Â

r l( ) = rjj j l( )j=1

n

Â

pk = s k l( ) e iyi l( )i=1

m

ÂÊ

Ë Á

ˆ

¯ ˜ rjj j l( )

j=1

n

ÂÊ

Ë Á Á

ˆ

¯ ˜ ˜ dlÚ

= eirj s k l( )yi l( )j j l( )dlÚi=1, j=1

m,n

Â

= eirjgijki=1, j=1

m,n

Â

Computer Vision - A Modern ApproachSet: Color

General strategies

• Determine what image wouldlook like under white light

• Assume– that we are dealing with flat

frontal surfaces– We’ve identified and removed

specularities– no variation in illumination

• We need some form ofreference– brightest patch is white– spatial average is known– gamut is known– specularities

Page 32: Causes of color

32

Computer Vision - A Modern ApproachSet: Color

Obtaining the illuminant fromspecularities

• Assume that a specularity hasbeen identified, and material isdielectric.

• Then in the specularity, wehave

• Assuming – we know the sensitivities and

the illuminant basis functions– there are no more illuminant

basis functions than receptors• This linear system yields the

illuminant coefficients.

pk = s k l( )E l( )Ú dl

= ei s k l( )yi l( )Ú dli=1

m

Â

Computer Vision - A Modern ApproachSet: Color

Obtaining the illuminant from averagecolor assumptions

• Assume the spatial averagereflectance is known

• We can measure the spatialaverage of the receptor responseto get

• Assuming– gijk are known– average reflectance is known– there are not more receptor

types than illuminant basisfunctions

• We can recover the illuminantcoefficients from this linearsystem

r l( ) = r jj j l( )j=1

n

Â

pk = ei r jgijki=1, j=1

m,n

Â

Page 33: Causes of color

33

Computer Vision - A Modern ApproachSet: Color

Computing surface properties

• Two strategies– compute reflectance

coefficients– compute appearance under

white light.• These are essentially

equivalent.• Once illuminant coefficients are

known, to get reflectancecoefficients we solve the linearsystem

• to get appearance under whitelight, plug in reflectancecoefficients and compute

pk = eirjgijki=1, j=1

m,n

Â

pk = ei

whiterjgijki=1, j=1

m,n

Â