1 Chapter 4 Color in Image and Video 4.1 Color Science 4.2 Color Models in Images 4.3 Color Models...

Post on 20-Jan-2016

219 views 0 download

Tags:

Transcript of 1 Chapter 4 Color in Image and Video 4.1 Color Science 4.2 Color Models in Images 4.3 Color Models...

1

Chapter 4Color in Image and Video

4.1 Color Science4.2 Color Models in Images4.3 Color Models in Video4.4 Further Exploration

2

Chapter 4Color in Image and Video

4.1 Color Science4.2 Color Models in Images4.3 Color Models in Video4.4 Further Exploration

3

Light and Spectra Light is an electromagnetic wave. Its color is

characterized by the wavelength content of the light. Laser light:

consists of a single wavelength: e.g., a ruby laser produces a bright, scarlet-red beam.

Most light sources: produce contributions over many wavelengths.

Visible wavelengths: humans cannot detect all light, just contributions that

fall in the “visible wavelengths". From Blue to Red:

Short wavelengths produce a blue sensation, long wavelengths produce a red one.

4

E() White light contains all the colors of a rainbow.Visible light is an electromagnetic wave in the range 400 nm to 700 nm“nm” stands for nanometer (10−9 meters)

Daylight (white light)

E(): Spectral Power Distribution (SPD) or spectrum.

c.f. Human ear can hear 20 to 20K Hz.

https://www.youtube.com/watch?v=qNf9nzvnd1k

5

Spectrophotometer

device used to measure visible light, by reflecting light from a diffraction grating (a ruled surface) that spreads out the different wavelengths.

6

Human Vision Lens ( 水晶體 ) and Retina ( 視網膜 )

The eye works like a camera. Lens focus an image onto the retina

(upside-down and left-right reversed). Rods ( 柱狀體 ) and Cones ( 錐狀體 )

Rods: “all cats are gray at night!“ Three kinds of cones: most sensitive to

red (R), green (G), and blue (B) light. Eye-Brain System

The brain is good at algebra.

7

Spectral Sensitivity Functions qR(), qG() and qB()

Spectral Sensitivity Curves(1)

8

Fig 4.3 R, G, B cones, and Luminous Efficiency Curve V()

Spectral Sensitivity Curves (2)

9

6 millions of cones proportion of R:G:B ~ 40:20:1 ( 已計入 q())

Luminous Efficiency Function V () sum of the response curves for R, G, and

B. The rod sensitivity curve:

looks like the luminous-efficiency function V () but is shifted to the red end of the spectrum.

Luminous Efficiency Function

10

These spectral sensitivity functions q () = (qR(), qG(), qB())T (4.1)

The response in each color channel in the eye is proportional to the number of neurons firing.

R = E() qR() d G = E() qG() d B = E() qB() d (4.2)

Spectral Sensitivity of the Eye

11

Surface Reflectance

S(): reflectance function

12

The equations that take into account the image formation model are:

R = E() S() qR() d

G = E () S() qG() d

B = E() S() qB() d (4.3)

Image formation

13

(break)

14

Color-Matching Functions A technique evolved in psychology

Matching a combination of basic R, G, and B lights to a given shade

(even without knowing the eye-sensitivity curves of Fig.4.3)

Color Primaries 700, 546, 436 – nm (700, 546.1, 435.8) 580, 545, 440 – nm Error / mistake?

課本這段是錯的, Google “CIE 1931”

 INTERNATIONAL COMMISSION ON ILLUMINATION

15

Fig 4.8 Colorimeter experiments

700 nm 546 nm 436 nm

Colorimeter

16

Fig 4.9 CIE RGB color matching functions

CIE 1931 2° Matching Func.

700 nm 546 nm 436 nm

Radiant power72 : 1.3791 : 1

17

Spectral Sensitivity Functions qR(), qG() and qB()

Recall: Spectral Sensitivity

=560, for example

( )( )

( ) ?? ( )

( ) ( )

R

G

B

rq

q g

q b

18

Fig 4.9 CIE RGB color matching functions

Recall: CIE 1931 2°

700 nm 546 nm 436 nm

=560, for example

19

Relation Between 2 Exps.

( )( ) (700) (546) (436) 72 0 0

( ) (700) (546) (436) 0 1.38 0 ( )

( ) (700) (546) (436) 0 0 ( )

R R R R

G G G G

B B B B

rq q q q a

q q q q a g

q q q q a b

單光源刺激度

加乘轉換矩陣 (M)三色光轉換成各別刺激度再加總

指指指指指指指配色比

單位能量

M [ E() E() E() ]T

=436 r(436)=0, g(436)=0, b(436)>0=546 r(546)=0, g(546)>0, b(546)=0=700 r(700)>0, g(700)=0, b(700)=0=560 ...

=560

20

[R G B] Stimulus

( )( ) (700) (546) (436) 72 0 0

( ) (700) (546) (436) 0 1.38 0 ( )

( ) (700) (546) (436) 0 0 ( )

R R R R

G G G G

B B B B

rq q q q a

q q q q a g

q q q q a b

( ) ( )

( ) ( )

( ) ( )

R

G

B

E q dR

G E q d

B E q d

72 (700) ( )

( ) ( ) ( ) 1.38 (546) ( ) ( ) ( ( ))

(436) ( )

R

R R

R

a q r

R E q d E a q g d E F r d

a q b

(1) RGB 單一色彩的刺激 也是暫定三原色的組合

( 紅色的刺激不能只靠暫定紅光模擬 )

21

645 nm 526 nm 444 nm

Normalized byRadiant powerto 1 : 1 : 1

CIE 1964 10° Matching Func.

(2) 另取「暫定三原色」亦無法改變紅光的負值

22

Grassman's Law Additive color

results from self-luminous sources lights projected on a white screen phosphors glowing on the monitor glass

Additive color matching is linear. color1 a linear combinations of lights color2 another set of weights, then combined color: color1+color2 the sum of the two sets of weights.

(3) 配色函數無法呈現色光的加法定理

23

Grassman's Law (Example) Example

color1 0.2 X + 0.6 Y + 1.2 Z color2 1.8 X + 0.9 Y + 0.3 Z color1+color2 2 X + 1.5 Y + 1.5 Z

Example 2 ( 線性內插 : 假設色彩有坐標 ) color1 (0.2 X + 0.6 Y + 1.2 Z) /2 color2 (1.8 X + 0.9 Y + 0.3 Z) /3 (1/2) color1+ (1/2) color2 0.35 X + 0.3 Y + 0.35 Z

24

Drawback of the RGB Color Matching Functions

RGB stimuli are dependent on linear combinations of r(), g() , b() , but not purely respective values of them.

r() color-matching curve has a negative lobe

Thus we cannot conveniently indicate a combined color following Grassman’s law

qR(575)!= qR(550)/2+qR600)/2

25

Fig 4.10 CIE standard XYZ color matching Functions x(), y(), z().

CIE-RGB to CIT-XYZ

下一頁:改用「坐標軸」來看待「調色」

26

Linear Transform (RGB-XYZ)

( ) ( )2.7689 1.7517 1.1302

( ) 1 4.5907 0.0601 ( )

0 0.0565 5.5943( ) ( )

x r

y g

z b

由「暫定三原色」經線性轉換,定義出「虛擬三原色」。

27

Fictitious Primaries

A 3 x 3 matrix away from r, g, b curves, and are denoted x(), y(), z(), as shown in Fig. 4.10

XYZ color-matching functions with only positives values

The middle standard color-matching function y() exactly equals the luminous-efficiency curve V () shown in Fig. 4.3.

The area under Each curve is the same.

28

Orthogonal XYZ Color Space

Original Coordinate before Normalization

Pure Colors without Combination

29

CIE Chromaticity Diagram

z = 1 – x – y

( ) ( )

( ) ( )

( ) ( )

E x dX R

Y E y d T G

Z BE z d

(4.7)

(4.8)

(4.6)

(4.9)

(4.10)

30

Fig 4.11

SpectrumLocushorseshoe

Line ofpurples

Recall:Grassman’s Law

A

B

C

(x,y) Chromaticities

31

Chromaticities and White points of Monitor Specification

Table 4.1

4.1.9

32

Out-of-Gamut Colors

Fig. 4.13: Approximating an out-of-gamut color

4.1.10

33

(break)

34

Out-of-Gamut Colors

Fig. 4.13: Approximating an out-of-gamut color

4.1.10

35

More Color Models

YUV system (additive) YUV, YIQ, YCbCr color Models

Munsell system (additive) L*a*b* (CIELAB), Munsell color naming system

HSI -- Hue, Saturation and Intensity; HSI, HSL, HSV, HSD, HCI color models Lightness/Value/Darkness/Chroma

CMY system CMY, CMYK color models Cyan/Magenta/Yellow/blacK

36

More Color Models

YUV system (additive) YUV, YIQ, YCbCr color Models

Munsell system (additive) L*a*b* (CIELAB), Munsell color naming system

HSI -- Hue, Saturation and Intensity; HSI, HSL, HSV, HSD, HCI color models Lightness/Value/Darkness/Chroma

CMY system CMY, CMYK color models Cyan/Magenta/Yellow/blacK

傳輸格式

37

RGB YUV Y= 0.229 R + 0.587 G + 0.114 B

U=B-Y V=R-Y

Y 0.229 0.587 0.114 R

U = -0.147 -0.289 0.436 G

V 0.615 -0.515 -0.100 B

R 1 0 1.14 Y

G = 1 -0.39 -0.58 U

B 1 2.03 0 V

Y=1 0.229 0.587 0.114 R=1

U=0 = -0.147 -0.289 0.436 G=1

V=0 0.615 -0.515 -0.100 B=1

38

YUV Decomposition

39

Y channel (R+G+B)/3

40

YIQ Color Model YIQ is used in NTSC color TV broadcasting

“Y “ in YIQ is the same as in YUV; I and Q are a rotated version (33° ) of U and V .

I

Q

41

YIQ Transform Matrix

42

YCbCr Color Model

ITU Standard (International Telecommunication Unit)

ITU-R BT. 601-4 (also known as “Rec. 601”) Closely related to the YUV transform

43

YCbCr Transform Matrix

Theoretical:

Digital Processing: (16~235/ ± 112+128)

44

More Color Models

YUV system (additive) YUV, YIQ, YCbCr color Models

Munsell system (additive) L*a*b* (CIELAB), Munsell color naming system

HSI -- Hue, Saturation and Intensity; HSI, HSL, HSV, HSD, HCI color models Lightness/Value/Darkness/Chroma

CMY system CMY, CMYK color models Cyan/Magenta/Yellow/blacK

美術命名

45

Fig 4.14 CIELAB Model

Max a* RedMin a* Green

Max b* YellowMin b* Blue

Outside solidMore colorful(saturate)

L*a*b* (CIELAB) Color Model

46

Munsell Color Naming System

47

More Color Models

YUV system (additive) YUV, YIQ, YCbCr color Models

Munsell system (additive) L*a*b* (CIELAB), Munsell color naming system

HSI -- Hue, Saturation and Intensity; HSI, HSL, HSV, HSD, HCI color models Lightness/Value/Darkness/Chroma

CMY system CMY, CMYK color models Cyan/Magenta/Yellow/blacK

影像處理

48

Gonzalez. Chapter 6Color Image Processing

Gonzalez. Chapter 6Color Image Processing

49

Gonzalez. Chapter 6Color Image ProcessingGonzalez. Chapter 6Color Image Processing

50

Gonzalez. Chapter 6Color Image ProcessingGonzalez. Chapter 6Color Image Processing

51

52

Gonzalez. Chapter 6Color Image ProcessingGonzalez. Chapter 6Color Image Processing

53

Gonzalez. Chapter 6Color Image ProcessingGonzalez. Chapter 6Color Image Processing

54

Gonzalez. Chapter 6Color Image ProcessingGonzalez. Chapter 6Color Image Processing

55

1

1/ 22

1( ) ( )

2cos

if

360 if

31 [min( , , )]

( )

1( )

3

( )( )( )

R G R B

B GH

B G

S R G BR G B

I R G B

R B G BR G

H.S.I 彩色轉換

If 0 H <120 ,

cos1

cos(60 - H)

3 ( )

(1 )

S HR I

G I R B

B I S

If 120 H <240 ,

(1 )

cos1

cos(60 - H

H = H-12

)

)

0

3 (

R I S

S HG I

B I R G

If 240 H 360 ,

3 ( )

(1 )

cos1

cos(60 -

H = H-24

0

H)

R I G B

G I S

S HB I

建議以上 RGB 值在實作時應取Value = min(255, floor(…))以避免 overflow 而敗給其他兩色

56

Recall: YUV Decomposition

57

HSI Decomposition (I, S, H)

58

圖 10-13 圖 10-10 之飽和度強化 (Saturation enhancement)

圖 10-10 彩色影像

彩色影像強化—增加飽和度

59

More Color Models

YUV system (additive) YUV, YIQ, YCbCr color Models

Munsell system (additive) L*a*b* (CIELAB), Munsell color naming system

HSI -- Hue, Saturation and Intensity; HSI, HSL, HSV, HSD, HCI color models Lightness/Value/Darkness/Chroma

CMY system CMY, CMYK color models Cyan/Magenta/Yellow/blacK

彩色印刷

60

(1,0,0)

(0,1,0)

(1, 1, 0)

(0,1,1) (0,1,0)(0, 0, 1)

Additive v.s. Subtractive Models

(1,0,0)

(0, 0, 1)

61

Complementary Color

I = 0.5 的平面上Hue 相差 180的補色示意環

62

RGB Color MixingColor 1 : Color 2 = a : b

Result

( ) ( )a b

a b a b

1 2

1 2

1 2

R R

G G

B B

e.g. Color 1 = (0.8, 0.4, 0.2) Color 2 = (0.5, 0.6, 0.8) …

63

CMY Color MixingDefinition:

Color 1 : Color 2 = a : b

1 ( ) ( ) ( ) ( )a b a b

a b a b a b a b

1 2 1 2

1 2 1 2

1 2 1 2

1-C 1-C C C

1-M 1-M M M

1-Y 1-Y Y Y

色料混合 = 兩色補色相加之後的補色

64

Fig 4.15

RGB cube CMY cube

RGB and CMY color cubes

65

Undercolor Removal: CMYK

Sharper and cheaper printer colors Calculate that part of the CMY mix that

would be black, Remove it from the color proportions,

and add it back as real black.CMYK Model

66

Printer Gamuts “Crosstalk" between the color channels make it

difficult to predict colors achievable in printing.

Fig 4.17 (a) Block Dyes (b) Block Dyes Gamut and NTSC Gamut