+ All Categories
Home > Documents > What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue...

What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue...

Date post: 27-May-2018
Category:
Upload: lydang
View: 213 times
Download: 0 times
Share this document with a friend
62
EE637 Digital Image Processing I: Purdue University VISE Program 1 What is Color? Color is a human perception (a percept). Color is not a physical property... But, it is related the the light spectrum of a stimulus.
Transcript
Page 1: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 1

What is Color?

• Color is a human perception (a percept).

• Color is not a physical property...

• But, it is related the the light spectrum of a stimulus.

Page 2: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 2

Can We Measure the Percept of Color?

• Semantic names - red, green, blue, orange, yellow, etc.

• These color semantics are largely culturally invariant,but not precisely.

• Currently, there is no accurate model for predictingperceived color from the light spectrum of a stimulus.

• Currently, noone has an accurate model for predictingthe percept of color.

Page 3: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 3

Can We Tell if Two Colors are the Same?

• Two colors are the same if they match at all spectralwavelengths.

• However, we will see that two colors are also the sameif they match on a 3 dimensional subspace.

• The values on this three dimensional subspace arecalled tristimulus values.

• Two colors that match are called metamers.

Page 4: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 4

Matching a Color Patch

• Experimental set up:

– Form a reference color patch with a known spectraldistribution.

Reference Color ⇒ I(λ)

– Form a second adjustable color patch by addinglight with three different spectral distributions.

Red ⇒ Ir(λ) = R

Green ⇒ Ig(λ) = G

Blue ⇒ Ib(λ) = B

– Control the amplitude of each component with threeindividual positive constants r+, g+, and b+.

– The total spectral content of the adjustable patchis then

r+ Ir(λ) + g+ Ig(λ) + b+ Ib(λ) .

• Choose (r, g, b) to match the two color patches.

Page 5: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 5

Simple Color Matching with Primaries

R G B

xr+

xg+

xb+

Adjustablecolor patch

Referencecolor

• Choose (r+, g+, b+) to match the two color patches.

• The values of (r, g, b) must be positive!

• Definitions:

– R, G, and B are known as color primaries.

– r+, g+, and b+ are known as tristimulus values.

• Problem:

– Some colors can not be matched, because they aretoo “saturated”.

– These colors result in values of r+, g+, or b+ whichare 0.

– How can we generate negative values for r+, g+,or b+?

Page 6: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 6

Improved Color Matching with Primaries

Referencecolor

R G B

xr+

xg+

xb+

Adjustablecolor patch

R G B

xr-

xg-

xb-

Adjustedreference

color

• Add color primaries to reference color!

• This is equivalent to subtracting them from adjustablepatch.

• Equivalent tristimulus values are:

r = r+ − r−

g = g+ − g−

b = b+ − b−

• In this case, r, g, and b can be both positive andnegative.

• All colors may be matched.

Page 7: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 7

Grassman’s Law

• Grassman’s law: Color perception is a 3 dimensionallinear space.

• Superposition:

– Let I1(λ) have tristimulus values (r1, g1, b1), andlet I2(λ) have tristimulus values (r2, g2, b2).

– Then I3(λ) = I1(λ) + I2(λ) has tristimulus valuesof

(r3, g3, b3) = (r1, g1, b1) + (r2, g2, b2)

• This implies that tristimulus values can be computedwith a linear functional of the form

r =∫ ∞0 r0(λ) I(λ)dλ

g =∫ ∞0 g0(λ) I(λ)dλ

b =∫ ∞0 b0(λ) I(λ)dλ

for some functions r0(λ), g0(λ), and b0(λ).

• Definition: r0(λ), g0(λ), and b0(λ) are known as colormatching functions.

Page 8: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 8

Measuring Color Matching Functions

• A pure color at wavelenght λ0 is known as a line spec-trum. It has spectral distribution

I(λ) = δ(λ − λ0) .

Pure colors can be generated using a laser or a verynarrow band spectral filter.

• When the reference color is such a pure color, thenthe tristimulus values are given by

r =∫ ∞0 r0(λ) δ(λ − λ0)dλ = r0(λ0)

g =∫ ∞0 g0(λ) δ(λ − λ0)dλ = g0(λ0)

b =∫ ∞0 b0(λ) δ(λ − λ0)dλ = b0(λ0)

• Method for Measuring Color Matching Functions:

– Color match to a reference color generated by apure spectral source at wavelenth λ0.

– Record the tristimulus values of r0(λ0), g0(λ0), andb0(λ0) that you obtain.

– Repeat for all values of λ0.

Page 9: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 9

CIE Standard RGB Color MatchingFunctions

• An organization call Commission Internationale del’Eclairage (CIE) defined all practical standards forcolor measurements (colorimetery).

• CIE 1931 Standard 2o Observer:

– Uses color patches that subtended 2o of visual an-gle.

– R,G,B color primaries are defined by pure linespectra (delta functions in wavelength) at 700nm,546.1nm, and 435.8nm.

– Reference color is a spectral line at wavelength λ.

• CIE 1965 10o Observer: A slightly different standardbased on a 10o reference color patch and a differentmeasurement technique.

Page 10: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 10

RGB Color Matching Functions for CIEStandard 2o Observer

Tunable spectralline source at

wavelength λ

xr+

xg+

xb+

Adjustablecolor patch

Rλ = 700nm

Rλ = 700nm

Bλ = 435.8nm

Bλ = 435.8nm

Gλ = 546.1nm

Gλ = 546.1nm

xr-

xg-

xb-

Adjustedreference

color

• The color matching functions are then given by

r0(λ) = r+ − r−

g0(λ) = g+ − g−

b0(λ) = b+ − b−

where λ is the wavelength of the reference line spec-trum.

Page 11: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 11

RGB Color Matching Functions for CIEStandard 2o Observer

• Plotting the values of r0(λ), g0(λ), and b0(λ) resultsin the following.

400 450 500 550 600 650 700−0.05

0

0.05

0.1

0.15

0.2CIE RGB color matching functions

Wavelenght(nanometers)

r0 color matching function

g0 color matching function

b0 color matching function

• Notice that the functions take on negative values.

Page 12: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 12

Review of Colorimetry Concepts

1. R,G,B are color primaries used to generate colors.

2. (r, g, b) are tristimulus values used as weightings forthe primaries.

Color = rR + gG + bB

= [R,G,B]

rgb

3. (r0(λ), g0(λ), b0(λ)) are the color matching functionsused to compute the tristimulus values.

r =∫ ∞0 r0(λ) I(λ)dλ

g =∫ ∞0 g0(λ) I(λ)dλ

b =∫ ∞0 b0(λ) I(λ)dλ

Page 13: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 13

Problems with CIE RGB

• Some colors generate negative values of (r, g, b).

• This results from the fact that the color matchingfunctions r0(λ), g0(λ), b0(λ) can be negative.

• The color primaries corresponding to CIE RGB arevery difficult to reproduce. (pure spectral lines)

• Partial solution: Define new color matching functionsx0(λ), y0(λ), z0(λ) such that:

– Each function is positive

– Each function is a linear combination of r0(λ),g0(λ), and b0(λ).

Page 14: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 14

CIE XYZ Definition

• CIE XYZ in terms of CIE RGB so that

x0(λ)y0(λ)z0(λ)

= M

r0(λ)g0(λ)b0(λ)

where

M =

0.490 0.310 0.2000.177 0.813 0.0100.000 0.010 0.990

• This transformation is chosen so that

x0(λ) ≥ 0

y0(λ) ≥ 0

z0(λ) ≥ 0

Page 15: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 15

CIE XYZ Color Matching functions

400 450 500 550 600 650 7000

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

0.18XYZ color matching functions

Wavelenght(nanometers)

x0 color matching function

y0 color matching function

z0 color matching function

Page 16: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 16

XYZ Tristimulus Values

• The XYZ tristimulus values may be calculated as:

XYZ

=

∫ ∞0

x0(λ)y0(λ)z0(λ)

I(λ)dλ

=∫ ∞0 M

r0(λ)g0(λ)b0(λ)

I(λ)dλ

= M∫ ∞0

r0(λ)g0(λ)b0(λ)

I(λ)dλ

= M

rgb

Page 17: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 17

XYZ/RGB Color Transformations

• So we have that XYZ can be computed from RGB as:

XYZ

= M−1

rgb

• Alternatively, RGB can be computed from XYZ as:

rgb

= M−1

XYZ

• Comments:

– Always use upper case letters for XYZ!

– Y value represents luminance component of image

– X is related to red.

– Z is related to blue.

Page 18: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 18

XYZ Color Primaries

• The XYZ color primaries are computed as

Color = [X,Y,Z]

XYZ

= [R,G,B]

rgb

= [R,G,B]M−1

XYZ

• So, theoretically

[X,Y,Z] = [R,G,B]M−1

where

M−1 =

1.3644 −0.8958 −0.4686−0.5148 1.4252 0.08960.0052 −0.0144 1.0092

Page 19: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 19

Problem with XYZ Primaries

[X,Y,Z] = [R,G,B]

1.3644 −0.8958 −0.4686−0.5148 1.4252 0.08960.0052 −0.0144 1.0092

• Negative values in matrix imply that spectral distri-bution of XYZ primaries will be negative.

• The XYZ primaries can not be realized from physicalcombinations of CIE RGB.

• Fact: XYZ primaries are imaginary!

Page 20: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 20

Chromaticity Coordinates

• Tristimulus values X, Y, Z specify a color’s:

– Lightness - light or dark

– Huge - red, orange, yellow, green, blue, purple

– Saturation - pink-red; pastel-fluorescent; baby blue-deep blue

• The chromaticity specifies the hue and saturation,but not the lightness.

x =X

X + Y + Z

y =Y

X + Y + Z

z =Z

X + Y + Z

Page 21: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 21

Properties of Chromaticity Coordinates

x =X

X + Y + Z

y =Y

X + Y + Z

z =Z

X + Y + Z

• x + y + z = 1 - Third component can always becomputed from first two.

• Typically, (x, y) are specified

• Let α be any positive constant. Then (X, Y, Z) and(αX,αY, αZ) have the same chromaticity coordinates.

• Projection property: Straight lines in XY Z map tostraight lines in (x, y).

Page 22: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 22

Projection Property of ChromaticityCoordinates

• Fact: Straight lines in (X,Y, Z) space project to straightlines in (x, y) chromaticity space.

Proof:

– Let C1 = (X1, Y1, Z1) and C2 = (X2, Y2, Z2) betwo different colors, and let C3 = (X3, Y3, Z3) fallon a line connecting C1 and C2.

– In this case, we know that

C3 = αC1 + βC2

(X3, Y3, Z3) = α(X1, Y1, Z1) + β(X2, Y2, Z2)

whereα + β = 1

– In order to show that (x3, y3) falls on a straightline connecting (x1, y1) and (x2, y2), we must showthat

(x3, y3) = α′(x1, y1) + β′(x2, y2)

whereα′ + β′ = 1

Page 23: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 23

Projection Property (2)

(x3, y3)

= αX1 + βX2

X3 + Y3 + Z3,

αY1 + βY2

X3 + Y3 + Z3

= αX1

X3 + Y3 + Z3,

αY1

X3 + Y3 + Z3

+ βX2

X3 + Y3 + Z3,

βY2

X3 + Y3 + Z3

=X1 + Y1 + Z1

X3 + Y3 + Z3

αX1

X1 + Y1 + Z1,

αY1

X1 + Y1 + Z1

+X2 + Y2 + Z2

X3 + Y3 + Z3

βX2

X2 + Y2 + Z2,

βY2

X2 + Y2 + Z2

= αX1 + Y1 + Z1

X3 + Y3 + Z3(x1, y1) + β

X2 + Y2 + Z2

X3 + Y3 + Z3(x2, y2)

= α′(x1, y1) + β′(x2, y2)

Page 24: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 24

Projection Property (3)

• Then α′ and β′ are given by

α′ =α(X1 + Y1 + Z1)

α(X1 + Y1 + Z1) + β(X2 + Y2 + Z2)

β′ =β(X2 + Y2 + Z2)

α(X1 + Y1 + Z1) + β(X2 + Y2 + Z2)

So we have thatα′ + β′ = 1

QED

Page 25: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 25

Chromaticity Diagrams

• Compute the chromaticity of a pure spectral line atwavelength λ0.

• The XY Z values are given by

X =∫ ∞0 δ(λ − λ0)x(λ)dλ = x(λ0)

Y =∫ ∞0 δ(λ − λ0)Y (λ)dλ = y(λ0)

Z =∫ ∞0 δ(λ − λ0)Z(λ)dλ = y(λ0)

• So the chromaticity of a spectral line at wavelength λis given by

(x, y) =

x(λ)

x(λ) + y(λ) + z(λ),

y(λ)

x(λ) + y(λ) + z(λ)

• Plot this parametric curve in (x, y) as a function of λ.

Page 26: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 26

Chromaticity Diagram

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.80

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

Rcie

Gcie

Bcie

R709

G709

B709

Equal energy white point

D65 white point

• Horse shoe shape results form XYZ color matchingfunctions

Page 27: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 27

Chromaticity Diagrams

• Linear combinations of colors form straight lines.

• Any color in the interior (i.e. convex hull) of the“horse shoe” can be achieved through the linear com-bination of two pure spectral colors.

• The straight line connecting red and blue is referredto as “line of purples”.

• RGB primaries form a triangular color gamut.

• The color white falls in the center of the diagram.

Page 28: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 28

What is White Point?

• What is white point?

• There are three major functions for the concept ofwhite point.

– Calibration: Absolute scaling of (r, g, b) values re-quired for calibrated image data. This determinesthe color associated with (r, g, b) = (1, 1, 1).

– Color constancy: Color of illuminant in scene. Bychanging white point, one can partially compen-sate for changes due to illumination color. (cam-corders)

– Gammut mapping: Color of paper in printing ap-plications. Color of paper is brightest white usu-ally possible. Should a color photocopier changethe color of the paper? Usually no.

• We will focus on use of white point for calibration.

Page 29: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 29

Defining White Point?

• Ideally white point specifies the spectrum of the colorwhite.

Iw(λ)

• This specifies XYZ coordinates

Xw =∫ ∞0 x0(λ) Iw(λ)dλ

Yw =∫ ∞0 y0(λ) Iw(λ)dλ

Zw =∫ ∞0 z0(λ) Iw(λ)dλ

which in turn specifies chromaticity components

xw =Xw

Xw + Yw + Zw

yw =Yw

Xw + Yw + Zw

• Comments

– White point is usually specified in chromaticity.

– Knowing (xw, yw) does not determine Iw(λ).

Page 30: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 30

Typical White Points

• Equal energy white:

IEE(λ) = 1

(xEE, yEE, zEE) = (1/3, 1/3, 1/3)

• D65 illuminant (specified for PAL):

I65(λ) = Natural Sun Light

(x65, y65, z65) = (0.3127, 0.3290, 0.3583)

• C illuminant (specified for NTSC):

Ic(λ) = not defined

(xc, yc, zc) = (0.310, 0.316, 0.374)

• Comments:

– Equal energy white is not commonly used.

– C was the original standard for NTSC video.

– D65 has become the dominant standard.

– D65 corresponds to a color temperature of 6500oK.

Page 31: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 31

Two Example Illuminants

• Examples of D65 and Fluorescent Illuminants.

400 450 500 550 600 650 7000.3

0.4

0.5

0.6

0.7

0.8

0.9

1

1.1

1.2

1.3D65 and fluorescent LMS color matching functions

Wavelenght(nanometers)

D65 Illuminant Fluorescent Illuminant

Page 32: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 32

White Point Correction

• Standard color matching functions assume equal en-ergy white point

– Any standard color matching function assumes unitarea normalization.

1 =∫ ∞0 r0(λ)dλ

1 =∫ ∞0 g0(λ)dλ

1 =∫ ∞0 b0(λ)dλ

– Therefore:

IEE(λ) = 1 ⇒ (r, g, b) = (1, 1, 1)

• White point corrected/gamma corrected data is com-pute as:

r4=

r

rwp

1/γ

g4=

g

gwp

1/γ

b4=

b

bwp

1/γ

– So,

(r, g, b) = (1, 1, 1) ⇒ (r, g, b) = (rwp, gwp, bwp)

where (rwp, gwp, bwp) is the desired white point.

Page 33: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 33

Typical RGB Color Primaries

• NTSC 601 standard primaries:

(xr, yr) = (0.67, 0.33)

(xg, yg) = (0.21, 0.71)

(xb, yb) = (0.14, 0.08)

– These color primaries are not typically used any-more.

• PAL standard primaries:

(xr, yr) = (0.64, 0.33)

(xg, yg) = (0.29, 0.60)

(xb, yb) = (0.15, 0.06)

– PAL is the TV standard used in Europe

• ITU-R BT.709 standard primaries:

(xr, yr, zr) = (0.6400, 0.3300, 0.0300)

(xg, yg, zg) = (0.3000, 0.6000, 0.1000)

(xb, yb, zb) = (0.1500, 0.0600, 0.7900)

– More saturated then 601 primaries.

– Most commonly used primary colors for displaymonitors and TV’s.

Page 34: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 34

Example: 601 Color Primaries With EEWhite Point

• Find a transformation M so that

XYZ

= M

rgb

– Columns of M are proportional to color primaries.

– Rows of M sum to 1 ⇒ equal energy white point.

• Solve the equation

111

=

0.67 0.21 0.140.33 0.71 0.080.00 0.08 0.78

α1

α2

α3

• This results in [α1, α2, α3] = (0.9867, 0.8148, 1.1985),and

M =

0.67 0.21 0.140.33 0.71 0.080.00 0.08 0.78

0.9867 0 00 0.8148 00 0 1.1985

=

0.6611 0.1711 0.16780.3256 0.5785 0.0959

0 0.0652 0.9348

Page 35: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 35

Example: 601 Color Primaries With C WhitePoint

• Find a transformation M so that

XYZ

= M

rgb

where

– Columns of M are proportional to color primaries.

– Rows of M sum to [0.310, 0.316, 0.374]×constant.

– Middle rows of M sum to 1 ⇒ unit luminance.

• Solve the equation

1

0.316

0.3100.3160.374

=

0.98101

1.1835

=

0.67 0.21 0.140.33 0.71 0.080.00 0.08 0.78

α1

α2

α3

• This results in [α1, α2, α3] = (0.9060, 0.8259, 1.4327),and

M =

0.67 0.21 0.140.33 0.71 0.080.00 0.08 0.78

0.9060 0 00 0.8259 00 0 1.4327

=

0.6070 0.1734 0.20060.2990 0.5864 0.1146

0 0.0661 1.1175

Page 36: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 36

The International Color Consortium (ICC)(www.color.org)

• Sets industry standards for color management

• ICC color management standard

– Uses point to point transformation techniques tocalibrate color capture and rendering devices withthe best possible fidelity.

– Based on Apples ColorSync system.

– Requires color profiles for each input and outputdevice.

– Requires that each image have an associated colorprofile.

– But most image file formats do not support colorprofile embedding.

– Difficult for non-professionals to use.

• ICC color management system does not specify a sin-gle universal color space for interchange of data.

Page 37: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 37

sRGB: The New Industry Color Standard(www.color.org/sRGB.html)

• Industry standard color space proposed by Hewlett-Packard and Microsoft through the ICC organization.

• Defines a standard color space for images in RGB for-mat.

• Basic sRGB standard:

– Gamma corrected format with γ = 2.2. (approxi-ately)

– 709 Primaries

– D65 white point

Page 38: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 38

sRGB Color Transformations

• Find a transformation M so that

XYZ

= M

rgb

– Columns of M are proportional to color primaries.

– Rows of M sum to [0.3127, 0.3290, 0.3583]×constant.

– Middle row of M sums to 1 ⇒ unit luminance.

• Solve the equation

1

0.3290

0.31270.32900.3583

=

0.98101

1.1835

=

0.6400 0.3000 0.15000.3300 0.6000 0.06000.0300 0.1000 0.7900

α1

α2

α3

• This results in [α1, α2, α3] = (0.6444, 1.1919, 1.2032),and

M =

0.4124 0.3576 0.18050.2126 0.7152 0.07220.0193 0.1192 0.9505

Page 39: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 39

Converting From sRGB to XYZ

• First convert to linear sRGB. (approximate)

rlin = r

255

2.2

glin = g

255

2.2

blin = b

255

2.2

• Then convert from linear sRGB to XYZ using floatingpoint operations

XYZ

= M

rlin

glin

blin

=

0.4124 0.3576 0.18050.2126 0.7152 0.07220.0193 0.1192 0.9505

rlin

glin

blin

Page 40: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 40

Converting From XYZ to sRGB

• First convert from XYZ to linear sRGB using floatingpoint operations

rlin

glin

blin

= M−1

XYZ

=

3.2410 −1.5374 −0.4986−0.9692 1.8760 0.04160.0556 −0.2040 1.0570

XYZ

• Then gamma correct using γ = 2.2. (approximate)

r = 255 ∗ (rlin)1

2.2

g = 255 ∗ (glin)1

2.2

b = 255 ∗ (blin)1

2.2

Page 41: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 41

Analog NTSC Color Standard

• First, define the “luminance” component of the gamma-corrected RGB values

Y = 0.326r + 0.578g + 0.096b

• Then, define the YPrPb coordinates system as

YPbPr

=

Y

b − Yr − Y

• Then, YUV coordinates are defined as

YUV

=

YPb/2.03Pr/1.14

• Then, YIQ is a 33o rotation of the UV color space

YIQ

=

1 0 00 − sin 33o cos 33o

0 cos 33o sin 33o

YUV

=

0.299 0.587 0.1140.596 −0.274 −0.3220.211 −0.523 0.312

rg

b

Page 42: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 42

Comments on Analog NTSC Color Standard

• Technically, YPbPr, YUV and YIQ assume NTSC601 primaries with C white point.

• Same transformations may be used with other whitepoint and color primaries.

• In practice, people usually use the Rec. 701 primarieswith D65 white point.

• All transformations are performed on gamma correctedRGB.

• Nominal bandwidth for Y , I , and Q channels are4.2MHz, 1.5MHz, and 0.6MHz.

• This chromaticity coordinate system is approximatelyan opponent color system.

Page 43: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 43

Digital NTSC Color Standard

• Assuming that (r, g, b) are scaled from 0 to 1, then...

– First, define the “luminance” component of thegamma-corrected RGB components

Y = 0.326r + 0.578g + 0.096b

– Values of YCrCb are then given by

Yd

cb

cr

=

219Y + 16

112(b−Y )0.886 + 128

112(r−Y )0.701 + 128

• Complete transformation assuming (r, g, b) range from0 to 255

Yd

cb

cr

=

16128128

+

65.738 129.057 25.064−37.945 −74.494 112.439112.439 −94.154 −18.285

rg

b

• Again, transformations may be used with other colorprimaries and white points.

Page 44: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 44

Opponent Color Spaces

• Perception of color is usually not best represented inRGB.

• A better model of HVS is the so-call opponent colormodel

• Opponent color space is has three components:

– O1 is luminance component

– O2 is the red-green channel

O2 = G − R

– O3 is the blue-yellow channel

O3 = B − Y = B − (R + G)

• Comments:

– People don’t perceive redish-greens, or bluish-yellows.

– As we discussed, O1 is has a bandpass CSF.

– O2 and O3 have low pass CSF’s with lower fre-quency cut-off.

Page 45: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 45

Opponent Channel Contrast SensitivityFunctions (CSF)

• Typical CSF functions looks like the following.

co

ntra

stse

nsi

tivity

cycles per degree

Red-Green CSF

Luminance CSF

Blue-Yellow CSF

Page 46: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 46

Consequences of Opponent Channel CSF

• Luminance channel is

– Bandpass function

– Wide band width ⇒ high spatial resolution.

– Low frequency cut-off ⇒ insensitive to average lu-minance level.

• Chromanince channels are

– Lowpass function

– Lower band width ⇒ low spatial resolution.

– Low pass ⇒ insensitive to absolute chromaticity(hue and saturation).

Page 47: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 47

Some Practical Consequences of OpponentColor Spaces

• Analog video has less bandwidth in I and Q channels.

• Chromanance components are typically subsampled2-to-1 in image compression applications.

• Black text on white paper is easy to read. (couples toO1)

• Yellow text on white paper is difficult to read. (cou-ples to O3)

• Blue text on black background is difficult to read.(couples to O3)

• Color variations that do not chnage O1 are called “iso-luminant”.

• Hue refers to angle of color vector in (O2, O3) space.

• Saturation refers to magnitude of color vector in (O2, O3)space.

Page 48: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 48

Opponent Color Space of Wandell

• First define the LMS color system which is approxi-mately given by

LM

S

=

0.2430 0.8560 −0.0440−0.3910 1.1650 0.08700.0100 −0.0080 0.5630

XY

Z

• The opponent color space transform is then1

O1

O2

O3

=

1 0 0−0.59 0.80 −0.12−0.34 −0.11 0.93

LM

S

• Putting these transforms together, we get the follow-ing

O1

O2

O3

=

0.2706 0.7708 0.0136−0.1484 0.2064 −0.0595−0.0904 −0.3510 0.5134

rCIE

gCIE

bCIE

• Comments:

– O1 is luminance component– O2 is referred to as the red-green channel (G-R)– O3 is referred to as the blue-yellow channel (B-Y)– Also see the work of Mullen ’852 and associated

color transforms.3

1B. A. Wandell, Foundations of Vision, Sinauer Associates, Inc., Sunderland MA, 1995.2K. T. Mullen, “The contrast sensitivity of human color vision to red-green and blue-yellow chromatic

gratings,” J. Physiol., vol. 359, pp. 381-400, 1985.3B. W. Kolpatzik and C. A. Bouman, “Optimized Error Diffusion for Image Display,” Journal of Electronic

Imaging, vol. 1, no. 3, pp. 277-292, July 1992.

Page 49: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 49

Paradox?

• Why is blue text on yellow paper is easy to read??

• Shouldn’t this be hard to read since it stimulates theyellow-blue color channel?

Page 50: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 50

Better Understanding Opponent Color Spaces

• The XYZ to opponent color transformation is:

O1

O2

O3

=

0.2430 0.8560 −0.0440−0.4574 0.4279 0.0280−0.0303 −0.4266 0.5290

XYZ

=

vy

vgr

vby

XYZ

• What are vy, vgr, and vby?

– They are row vectors in the XYZ color space.

– vgr is a vector point from red to green

– vby is a vector point from yellow to blue

– They are not orthogonal!

Page 51: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 51

Plots of vy, vgr, and vby

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.80

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

Yellow

Green

Red

blue

D65 white point

Green−Red

Yellow−Blue

Opponent Color Directions of Color Matching Functions

Page 52: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 52

Answer to Paradox

• Since vy, vgr, and vby are not orthogonal

vy

vgr

vby

[vt

y vtgr vt

by

] 6= identity matrix

• Blue text on yellow background produces and stim-mulus in the vby space.

O1

O2

O3

=

vy

vgr

vby

vt

by =

−0.3958−0.15390.4627

• This stimmulus is not isoluminant!

• Blue is much darker than yellow.

Page 53: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 53

Basis Vectors for Opponent Color Spaces

• The transformation from opponent color space to XYZis:

XYZ

=

0.9341 −1.7013 0.16770.9450 0.4986 0.05220.8157 0.3047 1.9422

O1

O2

O3

= [cy cgr cby]

O1

O2

O3

• What are cy, cgr, and cby?

– They are column vectors in XYZ space.

– cgr is a vector which has no luminance component.

– cby is a vector which has no luminance component.

– They are orthogonal to the vectors vy, vgr, and vby.

Page 54: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 54

Plots of cy, cgr, and cby

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.80

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

Yellow

Green

Red

blue

Green−Red

Yellow−Blue

Opponent Color Directions of Color Matching Functions

Page 55: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 55

Interpretation of Basis Vectors

• Since cy, cgr, and cby are orthogonal to vy, vgr, andvby, we have

vy

vgr

vby

[cy cgr cby] =

1 0 00 1 00 0 1

• Therefore, we have that

O1

O2

O3

=

vy

vgr

vby

cby

=

0.9341 −1.7013 0.16770.9450 0.4986 0.05220.8157 0.3047 1.9422

0.16770.05221.9422

=

001

• So, cby is an isoluminant color variation.

• Something like a bright saturated blue on a dark red.

Page 56: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 56

Solution to Paradox

• Why is blue text on yellow paper is easy to read??

• Solution:

– The blue-yellow combination generates the inputvby.

– This input vector stimulates all three opponentchannels because it is not orthogonal to cy, cgr,and cby.

– In particular, it strongly stimulates cy because itis not iso-luminant.

Page 57: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 57

Perceptually Uniform Color Spaces

• Problem: Small changes in XYZ may result in smallor large perceptual changes.

• Solution: Formulate a perceptually uniform color space.

– Nonlinearly transform color space so that distanceis proportional to ones ability to perceive changesin color.

– Two most common spaces are L∗a∗b∗ and Luv.

– Recently, L∗a∗b∗ has come into the most commonusage

Page 58: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 58

The Lab Color Space

• Select (X0, Y0, Z0) to be the white point or illuminant,then compute (approximate formula)

L = 100(Y/Y0)1/3

a = 500[(X/X0)

1/3 − (Y/Y0)1/3

]

b = 200[(Y/Y0)

1/3 − (Z/Z0)1/3

]

• Color errors can then be measured as:

∆E =√(∆L)2 + (∆a)2 + (∆b)2

Page 59: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 59

Warning: Don’t Abuse Lab Space

• Lab color space is designed for low spatial frequencies.

– It is very good for measuring color differences inobjects.

– It is the standard for measuring paint color.

– It is good for measuring color accuracy of printersand displays.

• Direct application to images works poorly.

– Lab does not account for high spatial frequencycontent of images.

– Lab formulation ignores different form of CSF forluminance and chromanance spaces.

– Image coding in Lab space will produce poor re-sults.

Page 60: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 60

Color Image Quality Metrics

• A number of attempts have been made to combineCSF modeling with Lab color space:

– Kolpatzik and Bouman ’95 (YCxCz/Lab color met-ric)4

– Zhang and Wandell ’97 (S-CIELAB color metric)5

• Objective:

– Combine models of spatial frequency response andcolor space nonuniformities.

– Particularly important form modeling halftone qual-ity due to high frequency content.

4B. W. Kolpatzik and C. A. Bouman, “Optimized Universal Color Palette Design for Error Diffusion,”Journal of Electronic Imaging, vol. 4, no. 2, pp. 131-143, April 1995.

5X. Zhang and B. A. Wandell, “A spatial extension of CIELAB for digital color image reproduction,”Society for Information Display Journal, 1997.

Page 61: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 61

Image Quality Metric Using YCxCz/Lab

• YCxCz color space is defined as:

Yy = 116(Y/Y0)

cx = 500 [(X/X0) − (Y/Y0)]

cz = 200 [(Y/Y0) − (Z/Z0)]

• Apply different filters for luminance and chromanancewhere f is in units of cycles/degree.

Wy(f ) =

exp {−0.4385(f − 2.2610)} f ≥ 2.26101 f < 2.2610

Wcx(f ) =

exp {−0.1761(f − 0.2048)} f ≥ 0.20481 f < 0.2048

Wcz(f ) =

exp {−0.1761(f − 0.2048)} f ≥ 0.20481 f < 0.2048

• Then transform filtered YCxCz image components toLab and compute ∆E.

Page 62: What is Color? - College of Engineering - Purdue University Digital Image Processing I: Purdue University VISE Program 1 What is Color? † Color is a human perception (a percept).

EE637 Digital Image Processing I: Purdue University VISE Program 62

Flow Diagram for YCxCz/Lab Image QualityMetric

Σ( ). 2L∆ 2

∆ 2a

∆ 2b

+

(L,a,b)∆+

_

original image, R,G,B

Luminance filter

Chrominance filter T

Chrominance filter

cz

cxT

cz

cx

b

L

a

halftoned image, R,G,B

Luminance filter

Chrominance filter T

Chrominance filter

cz

cxT

cz

cx

b

L

a

1 2

1 2

YyYy

Yy Yy

• Low pass filters are applied in linear domain ⇒ moreaccurate for color matching of halftones.

• Nonlinear Lab transformation accounts for perceptualnonuniformities of color space.


Recommended