digital image processingdigital image...

20
Digital Image Processing Digital Image Processing 6. Color Transforms Computer Engineering, Sejong University 비선형 공간(Non linear color space) 비선형 공간(Non-linear color space) 인간 눈의 시각 특성을 반영 인간 눈의 시각 특성을 반영 균등(uniform) 색 공간을 위해 도입 인간이 끼는 색의 차이가 공간에서의 거리 차이와 비례하M ll Munsell 색을 광원의 색이 아닌 물체의 표면색(Surface color)로 표현 정확한 표면색을 표현하기 위해서는 고정된 조명 환경에서 측정 정확한 표면색을 표현하기 위해서는 고정된 조명 환경에서 측정 필요 HSI Color space(HSI 색 공간) 색을 Hue(색상), Saturation(채도), Intensity(명도)로 표현 XYZ l 비선형 함수 관계 XYZ color space비선형 함수 관계 2/39

Upload: buidat

Post on 03-Feb-2018

225 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Digital Image ProcessingDigital Image Processingdasan.sejong.ac.kr/~dihan/dip/D06_ColorTransforms_not… ·  · 2008-06-02Digital Image ProcessingDigital Image Processing 6. Color

Digital Image ProcessingDigital Image Processing

6. Color Transforms

Computer Engineering, Sejong University

비선형 색 공간(Non linear color space)비선형 색 공간(Non-linear color space)

인간 눈의 시각 특성을 반영인간 눈의 시각 특성을 반영

• 균등(uniform) 색 공간을 위해 도입

• 인간이 느끼는 색의 차이가 색 공간에서의 거리 차이와 비례하도록인간이 끼는 색의 차이가 색 공간에서의 거리 차이와 비례하 록함

M llMunsell• 색을 광원의 색이 아닌 물체의 표면색(Surface color)로 표현

• 정확한 표면색을 표현하기 위해서는 고정된 조명 환경에서 측정• 정확한 표면색을 표현하기 위해서는 고정된 조명 환경에서 측정필요

HSI Color space(HSI 색 공간)• 색을 Hue(색상), Saturation(채도), Intensity(명도)로 표현

XYZ l 와 비선형 함수 관계• XYZ color space와 비선형 함수 관계

2/39

Page 2: Digital Image ProcessingDigital Image Processingdasan.sejong.ac.kr/~dihan/dip/D06_ColorTransforms_not… ·  · 2008-06-02Digital Image ProcessingDigital Image Processing 6. Color

Munsell의 색 입체Munsell의 색 입체

• Color = Hue(H) + Saturation(S) + Intensity(I)White

• Color = Hue(H) + Saturation(S) + Intensity(I)

5R 10R10RP1 2

34

67

89

10R

5YR

10YR10P

5RP

10RP

Red

Red

Purp

leYellowRed

5R6/10YR6/12

5Y

10Y10PB

5P

Yello

wG

Yel

ple

ue

Purp

le

5R5/125GY

10GY10B

5PB

Gre

en

llow

Green

BlueGreenBlue

Purp blu

5R4/14 5G

10G5BG

10BG

5B

Blue

3/39

Black Hue Value

명도(Intensity)명도(Intensity)

• white : 10 , black : 0 사이 값으로 표현

4/39

Page 3: Digital Image ProcessingDigital Image Processingdasan.sejong.ac.kr/~dihan/dip/D06_ColorTransforms_not… ·  · 2008-06-02Digital Image ProcessingDigital Image Processing 6. Color

색상(Hue)• 전체 영역을 인간이 가장 잘 인지하는 5개의 principal

색상(Hue)

hues (5P, 5B, 5G, 5Y, and 5R )로 나눔

5R 10R10R5YR

10YR

5Y5P

5G5B

5/39

Hue circle in the Munsell system

채도(Saturation)

채도가 높아짐에 따라서 순색이

채도(Saturation)

• 채도가 높아짐에 따라서 순색이

되며 채도가 낮을 수록 흰색이

섞임섞임

• 시각적으로 일정한 차이 값을

갖도록 배치갖도록 배치

• 명도와 색상 값에 의해서 최대

명도

채도 값이 달라짐

• Ex. 5R,5Y and 5YR :14

5RP :12

5BG : 8 5BG : 8

채도

6/39

a Intensity/Saturation plane

of constant hue

Page 4: Digital Image ProcessingDigital Image Processingdasan.sejong.ac.kr/~dihan/dip/D06_ColorTransforms_not… ·  · 2008-06-02Digital Image ProcessingDigital Image Processing 6. Color

은무슨색입니까 ?은무슨색입니까 ?Munsell 기호 7.5YR 7/12

7/39

RGB, HSI Color Model

8/39

Page 5: Digital Image ProcessingDigital Image Processingdasan.sejong.ac.kr/~dihan/dip/D06_ColorTransforms_not… ·  · 2008-06-02Digital Image ProcessingDigital Image Processing 6. Color

HSI C l M d lHSI Color Model

9/39

RGB to HSIRGB to HSI

RGB 신호와 HSI 신호의 관계식은

⎨⎧ ≤

=GBif

RGB 신호와 HSI 신호의 관계식은

⎩⎨ >− GBif

Hθ360

⎫⎧ −+−1 )]()[(50 BRGR

θ 값은 d 축을 기준으로 측정

⎭⎬⎫

⎩⎨⎧

−−+−+

= −2/12

1

)])(()[(

)]()[(5.0cos

BGBRGR

BRGRθ

θ 값은 red 축을 기준으로 측정

)],,[min()(

31 BGR

BGRS

++−=

)(3

1BGRI ++=

)( BGR ++

RGB 값은 [0,1] 사이의 값으로 정규화 됨

RGB 색 공간과의 비선형 함수로 HSI 색 공간이 결정됨

3

10/39

RGB 색 공간과의 비선형 함수로 HSI 색 공간이 결정됨

Page 6: Digital Image ProcessingDigital Image Processingdasan.sejong.ac.kr/~dihan/dip/D06_ColorTransforms_not… ·  · 2008-06-02Digital Image ProcessingDigital Image Processing 6. Color

HSI 색 공간

색을 인간이 이해하기 쉽도록 표현

색상(Hue) 성분은 칼라 스펙트럼을 표현

녹색 오렌지 등의 색(C l ) 정보 표현– 녹색, 오렌지 등의 색(Color) 정보 표현

채도(S t ti ) 성분은 색의 순도를 표현채도(Saturation) 성분은 색의 순도를 표현

– 색에 흰색이 섞인 정도를 표현

핑크는 빨강에 비해서 흰색이 많이 섞임– 핑크는 빨강에 비해서 흰색이 많이 섞임

명도(Intensity) 성분은 색의 밝기를 표현명도(Intensity) 성분은 색의 밝기를 표현

– 계조 영상의 밝기 성분과 일치

광원이 아닌 표면색(Surface color)의 표현에 적합

11/39

HSI C l E lHSI Color Example

12/39

Page 7: Digital Image ProcessingDigital Image Processingdasan.sejong.ac.kr/~dihan/dip/D06_ColorTransforms_not… ·  · 2008-06-02Digital Image ProcessingDigital Image Processing 6. Color

Color image and its componentsg p

13/39

Color image and its componentsg p

14/39

Page 8: Digital Image ProcessingDigital Image Processingdasan.sejong.ac.kr/~dihan/dip/D06_ColorTransforms_not… ·  · 2008-06-02Digital Image ProcessingDigital Image Processing 6. Color

균일 색 공간(Uniform color space)( p )

MacAdam(1942)의 실험 결과 xy 좌표계의 거리 차이가 인간이느끼는 색의 차이와 일치하지 않음느끼는 색의 차이와 일치하지 않음

새로운 좌표계의 도입 필요새로운 좌표계의 도입 필요

– 시각적 색의 차이가 좌표계에서 거리에 비례해서 균등하게나타나도록 변환한 색 공간 필요나타나도록 변환한 색 공간 필요

=> 균일 색 공간(Uniform color space) 도입

15/39

MacAdam의 타원xy 좌표계에서 시각 특성상 동일한 색차로 느끼는 좌표 범위를연결한 결과 타원의 형태를 나타냄(왼쪽 그림)오른쪽 그림은 이를 시각적으로 잘 보여질 수 있도록 좌표 범위를10배 확대한 그림

의 타원 같 기의 원uniform color space => MacAdam의 타원을 같은 크기의 원을갖도록 변형

16/39

Page 9: Digital Image ProcessingDigital Image Processingdasan.sejong.ac.kr/~dihan/dip/D06_ColorTransforms_not… ·  · 2008-06-02Digital Image ProcessingDigital Image Processing 6. Color

균일 색 공간(Uniform color space)

(1) CIE 1960 UCS di ( 좌표계)

균일 색 공간(Uniform color space)

ZYX

Xu

315

4

++=

Y6

(1) CIE 1960 UCS diagram(uv좌표계)

0.7

0.8 520

0 4 550nm

ZYX

Yv

315

6

++=

0.5

0.6

500nm

0.4

0.3

650nm600nm

550nm

0.3

0.4y

625

0.2

v

0.1

0.2

460

0.1

450nm

0.1 0.20 0.3 0.4 0.5 0.6 0.70

x

460

MacAdam’s ellipses of equallyperceptible color differences. (Ellipses

u0.10

00.2 0.4 0.5 0.60.3

CIE 1960 uv UCS diagram

17/39

perceptible color differences. (Ellipsesare 10 times their actual length)

균일 색 공간(Uniform color space)

(2) CIE 1976 UCS diagram(u’v’ 좌표계) : uv 좌표계를 v축으로 1 5배 확대

균일 색 공간(Uniform color space)

(2) CIE 1976 UCS diagram(u v 좌표계) : uv 좌표계를 v축으로 1.5배 확대

ZYX

Xu

315

4

++=

650nm

600nm

550nm

500nm

0.5

0.6

550

ZYX

Yv

315

9

++=

0.4

v'

500nm

0.4

0.3

650nm600nm

550nm

0.2

0.3

0.2

v

450nm

0 0

0.10.1

0450nm

0.1 0.2 0.4 0.5 0.60.3u'

0.00.0

CIE 1976 u’v’ UCS diagram

u0.10

00.2 0.4 0.5 0.60.3

CIE 1960 uv UCS diagram

18/39

gg

Page 10: Digital Image ProcessingDigital Image Processingdasan.sejong.ac.kr/~dihan/dip/D06_ColorTransforms_not… ·  · 2008-06-02Digital Image ProcessingDigital Image Processing 6. Color

균일 색 공간(Uniform color space)(3) CIE 1964 U*V*W* diagram : uv 좌표계의 3차원 직각좌표계 표현

균일 색 공간(Uniform color space)

)uu(WU n−= ∗∗ 13

)vv(WV n−= ∗∗ 13

1725 31 −=∗ /YW

un, v n : 기준 백색의 u, v

19/39

U*V* chromatic diagram at W*=50

균일 색 공간(Uniform color space)(4) CIE 1976 L*u*v* diagram : U*V*W* space의 V* scale을 50% 확장

균일 색 공간(Uniform color space)

161163/1

−⎟⎟⎠

⎞⎜⎜⎝

⎛=∗

nY

YL ⎟⎟

⎞⎜⎜⎝

⎛=∗

nYY

.L 3903 For Y/Yn< 0.008856

⎠⎝

)vv(Lv

)uu(Lu

n

n

′−′=

′−′=∗∗

∗∗

13

13

L* v*

)( n

u*

20/39

Sketch of CIE 1976 L*u*v* color spaceMacadam’s ellipses ploted in u*v* cross section of the CIE 1976 L*u*v* uniform color space

Page 11: Digital Image ProcessingDigital Image Processingdasan.sejong.ac.kr/~dihan/dip/D06_ColorTransforms_not… ·  · 2008-06-02Digital Image ProcessingDigital Image Processing 6. Color

균일 색 공간(Uniform color space)(5) CIE 1976 L*a*b* diagram

균일 색 공간(Uniform color space)

−⎟⎟⎠

⎞⎜⎜⎝

⎛=∗

nYY

fL 16116

⎥⎥⎦

⎢⎢⎣

⎡⎟⎟⎠

⎞⎜⎜⎝

⎛−⎟⎟

⎞⎜⎜⎝

⎛=

⎠⎝

nn

n

YY

fXX

fa 500

⎥⎥⎦

⎢⎢⎣

⎡⎟⎟⎠

⎞⎜⎜⎝

⎛−⎟⎟

⎞⎜⎜⎝

⎛=∗

nn ZZ

fYY

fb 200

31/q)q(f = 0088560.q>

16 0088560

for

116

167877 += q.)q(f 0088560.q ≤for

Sketch of CIE 1976 L*a*b* uniform color space with outer boundary generated byoptimal stimuli with respected to CIE standard illuminant D65 and CIE 1964 supplementary

21/39

optimal stimuli with respected to CIE standard illuminant D65 and CIE 1964 supplementary standard observer

균일 색 공간(Uniform color space)CIE 1976 L*a*b* diagram 가장 많이 사용되는 niform color space

균일 색 공간(Uniform color space)

-가장 많이 사용되는 uniform color space- 인간의 시각 특성을 가장 잘 표현- 인간이 느끼는 색의 차이가 L*a*b* 색공간에서 가장 효과적으로 표현

22/39

Page 12: Digital Image ProcessingDigital Image Processingdasan.sejong.ac.kr/~dihan/dip/D06_ColorTransforms_not… ·  · 2008-06-02Digital Image ProcessingDigital Image Processing 6. Color

Munsell 계 색의 CIE 색좌표계 표현

L*u*v* 좌표계

xy 좌표계y 좌 계

23/39 L*a*b* 좌표계

Pseudo-color Image ProcessingPseudo color Image Processing

특정 기준에 따라서 흑백 영상에 컬러를 할당하는 기법특정 기준에 따라서 흑백 영상에 컬러를 할당하는 기법

• 인간으로 하여금 시각적인 인지를 강조하기 위해 사용

• 명암의 구분을 뚜렷하게 하기 위함명암의 구분을 뚜렷하게 하기 위함

• 처리 기법 : – Intensity slicing– Gray level to color transform

24/39

Page 13: Digital Image ProcessingDigital Image Processingdasan.sejong.ac.kr/~dihan/dip/D06_ColorTransforms_not… ·  · 2008-06-02Digital Image ProcessingDigital Image Processing 6. Color

Pseudo-color Image ProcessingPseudo color Image Processing

명도 분할(Intensity slicing)명도 분할(Intensity slicing)• 특정 명도 값이나 영역에 특정 컬러를 할당

kk Vyxfifcyxf ∈= ),(),(

25/39

Intensity slicing의 예Intensity slicing의 예

26/39

Page 14: Digital Image ProcessingDigital Image Processingdasan.sejong.ac.kr/~dihan/dip/D06_ColorTransforms_not… ·  · 2008-06-02Digital Image ProcessingDigital Image Processing 6. Color

Intensity slicing의 예Intensity slicing의 예

27/39

Pseudo-color Image ProcessingPseudo color Image Processing

Gray level to color transformGray level to color transform• 특정 입력 화소의 밝기 값에 서로 다른 컬러 변환을 수행

• 그 결과를 R, G, B 영상으로 제공결과를 , G, 영상 제공

• 각 컬러별 변환식, 변환 방법에 따라서 다양한 영상 도출 가능

28/39

Page 15: Digital Image ProcessingDigital Image Processingdasan.sejong.ac.kr/~dihan/dip/D06_ColorTransforms_not… ·  · 2008-06-02Digital Image ProcessingDigital Image Processing 6. Color

Gray level to color transform 의 예Gray level to color transform 의 예

29/39

Full-color Image ProcessingFull color Image Processing

컬러 영상 처리 기법컬러 영상 처리 기법

• Individual component based processing– 컬러 영상을 각각의 성분으로 분해(예: RGB, HSI)컬러 영상을 각각의 성분 분해(예 G , )– 각 성분에 대해서 기존의 영상 처리 기법 적용

– 최종 결과를 다시 합성하여 컬러 영상 생성

• Vector-based processing – 컬러 영상을 벡터로 처리

벡터 연산을 이용해 직접 컬러 영상에 대한 처리 수행– 벡터 연산을 이용해 직접 컬러 영상에 대한 처리 수행

30/39

Page 16: Digital Image ProcessingDigital Image Processingdasan.sejong.ac.kr/~dihan/dip/D06_ColorTransforms_not… ·  · 2008-06-02Digital Image ProcessingDigital Image Processing 6. Color

Full-color Image ProcessingFull color Image Processing

Individual component based processingp p g

Vector-based processing

31/39

Component based processingComponent based processing보색 관계(Color complements)

32/39

Page 17: Digital Image ProcessingDigital Image Processingdasan.sejong.ac.kr/~dihan/dip/D06_ColorTransforms_not… ·  · 2008-06-02Digital Image ProcessingDigital Image Processing 6. Color

Component based processingComponent based processingColor correction

33/39

Component based processingComponent based processingHistogram Processing

34/39

Page 18: Digital Image ProcessingDigital Image Processingdasan.sejong.ac.kr/~dihan/dip/D06_ColorTransforms_not… ·  · 2008-06-02Digital Image ProcessingDigital Image Processing 6. Color

Component based processingComponent based processingColor image smoothing

Color image and RGB space image G pa agcomponents

35/39

Component based processingp p gColor image smoothing

HSI space image components

36/39

Page 19: Digital Image ProcessingDigital Image Processingdasan.sejong.ac.kr/~dihan/dip/D06_ColorTransforms_not… ·  · 2008-06-02Digital Image ProcessingDigital Image Processing 6. Color

Component based processingp p gImage segmentation

37/39

Vector-based processingp gImage segmentation

38/39

Page 20: Digital Image ProcessingDigital Image Processingdasan.sejong.ac.kr/~dihan/dip/D06_ColorTransforms_not… ·  · 2008-06-02Digital Image ProcessingDigital Image Processing 6. Color

Full-color Image ProcessingFull color Image Processing

Individual component based processingp p g

Vector-based processing

39/39