1 color chapter 12. 2 3 color models and their applications مدل های رنگ متعدی برای...

60
1 Color Chapter 12

Upload: vanessa-bishop

Post on 20-Jan-2016

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

1

Color

Chapter 12

Page 2: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

2

Page 3: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

3

Color models and their applications

مدل های رنگ متعدی برای نمایش یک سطح رنگی رویصفحه مانیتور ، چاپ تصویر رنگی ، تجزیه تحلیل و

تشخیص اطالعات رنگ و . . . ارائه شده است.

: مدلی است که بکمک آن خصوصیات و مدل رنگرفتار رنگ تحت یک شرایط خاص توصیف میشود.

: چیزی که بعنوان ” نور ” و یا رنگ خصوصیات نورهای متفاوت درک میشود ، عمال یک باند باریک از

اسپکتروم الکترو مغناطیس است.

Page 4: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

4

Color models and their applications

Page 5: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

5

Color models and their applications

Page 6: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

6

Color Spectrum seen by passing a white light through a prism

The observation by Sir Isaac Newton in 1666.

Color Spectrum divided into 6 broad regions:Violet, Blue, green, yellow, orange and red.

Note that a color ends abruptly in this spectrum.

Page 7: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

7

Wavelengths comprising the visible range of the electromagnetic spectrum

Note that each color blends smoothly in the next color.Chromatic light spans the electromagnetic spectrum from

Wavelength 400 to 700 nm (10-9m), or 4.3x1014 ~ 7.5x1014 Hertzis our visible spectrum.

Page 8: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

8

Sensing illuminated objects

نور سفيد صاطح ميكند. عموما فرض ميشود كه منبع نور ،نور سفيد نوري است كه تقريبا داراي انرژي يكساني براي

همه طول موجها در اسپكتروم قابل رويت ميباشد.

Page 9: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

9

Sensing illuminated objects

.درك رنگ يك شئي به سه فاكتور كلي بستگي دارد- Spectrum of energy in various wavelengths illuminating the object

surface.

- The spectral reflectance of object surface

- The spectral sensitivity of the sensor irradiated by the light energy from the object surface.

Page 10: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

10

Sensing illuminated objects

يك شئي آبي داراي ماد تشكيل دهنده اي در سطح ميباشد كه وقتيكه نور سفيد به آن ميتابد ، همه

فركانسهاي غير از آبي را جذب و فقط فركانس آبي را باز تاب ميدهد.

برنگ اگر نور قرمز رنگ به اين شئي آبي تابانده شود ،ارغواني ديده ميشود.

اگر اتوموبيلی در زير نور شديد خورشيد قرار گيرد ، از خود صاطح ميكند كه IRگرم ميشود و انرژي در باند

توسط چشم انسان ديده نميشود ولي توسط دوربين قابل تشخيص است. IRهاي

Page 11: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

11

Sensors in human visual system

There are 3 sets of Cone sensors sensitive to Red, Green and Blue colors in Retina of eye.

These cone sensors have relatively different response to these colors in different humans.

But they have a general behavior in the response.

Page 12: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

12

Absorption of light by the red, green and blue cones in the human eye as a function of wavelength

Note, the dominating range of green wavelength that is present in the entire visible spectrum.

Page 13: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

13

The Chromaticity diagram

مرکزی بنام1931در سال (International commission on Illumination )CIE

استاندارد ریاضی را پیشنهاد نمود که بر اساس آن کلیه رنگ ها را بتوان نمایش داد.

مقادیری که بکمک آنها رنگ ها نمایش داده میشوند ، نامیده میشوند.CIEپارامتر های

Page 14: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

14

The Chromaticity diagram

Page 15: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

The Chromaticity diagram

مینامند Chromaticity values را x, yپارامتر های

x + y + z = 1 z = 1 – (x+y)

که مقادیر کروماتیستی x , y بنا براین با استفاده از

رنگ هستند ، کلیه رنگ ها را در فضای دو بعدی بنام دیاگرام

CIE chromaticity .میتوانیم نمایش دهیم

15

Page 16: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

16

The Chromaticity diagram

Page 17: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

17

Chromaticity DiagramAny color can be located as a point on the Chromaticity Diagram

ZYX

Yy

ZYX

Xx

ZYX

Yy

The pointmarked greenhas 62% Green25% Red and approx.13% Blue.

Page 18: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

18

Typical color gamut ( محدوده) of color monitors (triangle) and color printing devices (irregular region)

The boundary of color printing gamut is irregular,

Because, color printing is acombination of additive andsubtractive color mixing.

A process that is much more difficult to control.

But display of colors on monitors is just anaddition of three highly controllable light primaries.

Page 19: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

19

Page 20: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

20

Page 21: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

قرار دارند صادق Cقاعده فوق برای نقاطی که در زیر نقطه سفید نیست.

قطع میکند.Cp را در نقطه purple line خط CC2خط هستند ، از رنگهایpurple lineکلیه رنگ هائی که بر روی

non-spectral هستند ، که طول موج آنها در اسپکتروم قابل رویت قرارندارند.

یعنی Cp از روی رنگ مکمل C2بنا بر این طول موج غالب رنگ نقطه Csp.بدست می آید

21

Page 22: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

22

Achromaticرا تصاوير Monochromeتصاوير مينامند ،

چون اطالعات رنگ در آنها وجود ندارد.

Page 23: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

23

RGB Color Model تئوری بینائیTristimulus بر این مبنا استوار است که چشم انسان

در coneدرک رنگ را بر اساس تحریک شدن سه مجموعه عصب شبکیه چشم انجام میدهد.

فرض میشود که حد اکثر طول موج حس شده توسط این سیستم بهاندازه

630 nmبرای قرمز ” برای سبز 530 ” برای آبی باشد.450

رنگ تشخیص داده بستگی به پارمتر های متعدی دارد که از جمله ”میزان روشنائی منبع نور ” است.

Page 24: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

24

RGB Color Model

تئوری فوق زیر بنای مدل رنگRGB است که برای تصویر و همچنین برای نمایش CCDبرداری توسط دوربین های

تصویر رنگی بر روی صفحه مانیتور بکار میرود.

در بسیاری از کاربرد ها مقادیرRGB:را نرماالیز میکنند  

رنگ مورد نظر

Page 25: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

25

RGB Color Model

A full color image is used to denote a 24-bit RGB color image.

The total number of colors in 24 bits RGB image is(256)3 = 16,772,216 colors.

Page 26: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

26

RGB Color Model

Page 27: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

27

RGB, 24 bit color cube, (256)3 = 16,777,216 colors

Page 28: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

28

All 216 safe RGB colors. The de facto standard for safe colors, especially in Internet applications.

They are used whenever it is desired that the colors viewed by most people appear the same.

Each safe color is formed by RGB values, but each RGB value can only takeOne of the values of 0, 51, 102, 153, 194 or 255.

Therefore we will have (6)3 = 216 different colors + 16 gray values.

Page 29: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

29

The RGB safe-color cubeUnlike the full-colors cube, this cube has valid colors

only on its 6 surface panes.

So the entire surface of the safe-color cube is covered by 3x6x6=216 different colors.

Page 30: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

30

CMY and CMYK color models

از این مدل رنگ برای چاپ عکس های رنگی از طریق استفاده yellow , Magenta, Cyanترکیب رنگ های

میشود.

همانطور که میدانید رنگCyan از طریق اضافه کردن رنگ سبز به آبی بدست می آید.

وقتیکه نور سفید به جوهر رنگcyan ، میتابد ، نور باز تاب شده نباید هیچ جزء مربوط به رنگ قرمز را در خود داشته باشد.

جذب میشود و یا بعبارت Cyan یعنی نور قرمز توسط جوهر دیگر جزء قرمز از رنگ سفید کم میشود.

Page 31: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

31

CMY and CMYK color models

Page 32: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

32

CMY and CMYK color models

Page 33: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

33

YIQ color model,The NTSC television standard for encoding,

luminance (Y) and two Chromaticity values, I and Q

Page 34: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

34

YIQ color model

Page 35: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

35

YIQ color model

یک راه ساده تبدیل یک تصویر رنگی به تصویر و نمایش آن میباشد.Yمنوکرم ، محاسبه پارامتر

Page 36: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

36

YIQ color model

.تبدیل معکوس نیز از رابطه زیر بدست می آید

Page 37: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

37

YUV encoding

اين مدل در برخی از محصوالت ويدوئی ديجيتال و بکار JPEG, MPEGالگوريتم های فشرده سازی مانند

ميرود.

ميتوانند با Chrominance و Luminanceدر اين روش تعداد بيت متفاوت کد شوند.

فايل ها را به Digital CCDامروزه بسياری از دوربينهای در خروجی در اختيار کاربر قرار ميدهند , YUVفورمت

و يا با اين فورمت ذخيره ميکنند.

)(877.0

)(493.0

11.059.030.0

YRV

YBU

BGRY

Page 38: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

38

HSI color Model

هر نور درک شده توسط انسان دارای یک نور و یا Hueفرکانس غالب است که به آن

رنگ نور گفته میشود.

Page 39: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

39

HIS color model

Page 40: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

40

Converting RGB to HSI color model

Page 41: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

41

The intensity of all colors in any of these planes is given by the position of the plane on the vertical intensity axis.

Page 42: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

42

Hue and Saturation in HIS color model.The “dot” is an arbitrary color point. Hue is shown by an angle,

Saturation is measured by a metric distance (the length of vector).

Page 43: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

43

The HSI color model based on (left) triangular, (right) circular color planes.

The triangles and circles are perpendicular to the vertical intensity

Page 44: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

44

Converting RGB to HSI

GBif

GBifH

360

2/12

1

))(()(

)()(2/1cos

BGBRGR

BRGR

),,min()(

31 BGR

BGRS

)(3

1BGRI

It is assumed that R,G,B values have been normalized to the range [0,1]And the angle θ is measured with respect to the red axis of HSI space.

Page 45: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

45

Converting HSI to RGB

Given the value of HSI in the interval [0,1]

We find the corresponding RGB values in the same range.

1. RG sector ( 0 ≤ H ≤ 120)

)60cos(

cos1

H

HSIR

RG

)(1 BRG

)1( SIB

Page 46: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

46

Converting HSI to RGB

2. GB sector (120 ≤ H ≤ 240)

H = H -120

R = I (1-S)

B = 1 – (R + G)

)60(

cos1

Hcps

HSIG

G

B

Page 47: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

47

Converting HSI to RGB

3. BR sector ( 240 ≤ H ≤ 360 )

H = H -240 G = I ( 1- S)

R = 1 – (G + B)

)60cos(

cos1

H

HSIBR

B

Page 48: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

48

HSI components of RGB values of color cube.

Hue Saturation Intensity

The Hue angle for Red is zero, and the angle forAll colors in the circle increases from zero to360 degrees. These values of 0~360 are mapped in the range of0~255 gray scale to make them visible.

Page 49: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

49

A new approach, Converting the gray level image to a color image

A different transform is applied for each color band of R,B and BThe outputs fR ,fG ,fB are fed respectively to RGB channels of a color TV monitor.

Page 50: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

50

An application in AirportsExplosive detection in luggage

An X-ray imageFrom ordinaryarticles

The same luggage witha block of simulated plastic Explosive.

Applying theTransformFunction of Fig.6.25-a

The Explosiveis clearlydetected.

Applying theTransform functionof Fig.6.25-b

You can see through The Explosive.

Page 51: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

51

The transform functions for convertingthe gray-scale image to a color image.

Fig. 6.25

(a)

(b)

Page 52: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

52

The transform functions for convertingthe gray-scale image to a color image.

Page 53: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

53

The transform functions for convertingthe gray-scale image to a color image.

با تغییر دادن فاز تابع سینوسی هنگام نمایش آن در شکل فوق ، رنگ های متفاوتی برای اشیا مختلف مانند لباس ، زمینه ؛ ماده منفجره

و ... موجود در چمدان بدست خواهد آمد.

Page 54: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

54

Constructing one color image using severalmonochrome (Spectral band) images.

Application in Remote sensing.

Page 55: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

55

Averaging in color images

In color image, the average of an RGB pixel, is obtained by obtaining the average at the neighborhood of a pixel (x,y) at each image plane, and then,

Construct the output image using the 3 new RGB image planes.

Page 56: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

56

Visualization of color components as a gray-scale image in different color models

(Where, dark and bright gray scales represent low and high intensity values, respectively).

Original

CMYK

RGB

HSI

Page 57: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

57

Reducing the brightness by 30% Using RGB and HIS models. Note that both models produce the same result.

In RGB, each component is multiplied by a constant k = 0.7, In HIS, only the I component is multiplied by k = 0.7 and the rest are

remained unchanged.

Page 58: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

58

Color Complements.The hues directly opposite one another on the color circle, are

called Complements.

رنگهای مکمل برای واضح کردن جزئیات موجود در نواحی تیره یک تصویر رنگی مورد استفاده قرار

.میگیرند

Page 59: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

End of Chapter 12

Page 60: 1 Color Chapter 12. 2 3 Color models and their applications مدل های رنگ متعدی برای نمایش یک سطح رنگی روی صفحه مانیتور ، چاپ تصویر

60