digital image processing colour image processing

73

Click here to load reader

Upload: dale-ford

Post on 25-Dec-2015

395 views

Category:

Documents


19 download

TRANSCRIPT

Page 1: Digital Image Processing Colour Image Processing

Digital Image Processing

Colour Image Processing

Page 2: Digital Image Processing Colour Image Processing

2

Introduction

Today we’ll look at color image processing, covering:• Color fundamentals• Color models

Page 3: Digital Image Processing Colour Image Processing

3

Color Fundamentals

In 1666 Sir Isaac Newton discovered that when a beam of sunlight passes through a glass prism, the emerging beam is split into a spectrum of colors

Ima

ge

s ta

ken

fro

m G

on

zale

z &

Wo

od

s, D

igita

l Im

ag

e P

roce

ssin

g (

20

02

)

Page 4: Digital Image Processing Colour Image Processing

4

Color Fundamentals (cont…)The colors that humans and most animals perceive in an object are determined by the nature of the light reflected from the objectFor example, green objects reflect light with wave lengths primarily in the range of 500 – 570 nm whileabsorbing most of the energy at other wavelengths

White Light

Colors Absorbed

Green Light

Page 5: Digital Image Processing Colour Image Processing

5

Color Fundamentals (cont…)Chromatic light spans the electromagnetic spectrum from approximately 400 to 700 nmAs we mentioned before human color vision is achieved through 6 to 7 million cones in each eye

Ima

ge

s ta

ken

fro

m G

on

zale

z &

Wo

od

s, D

igita

l Im

ag

e P

roce

ssin

g (

20

02

)

Page 6: Digital Image Processing Colour Image Processing

6

Color Fundamentals (cont…)Approximately 66% of these cones are sensitive to red light, 33% to green light and 6% to blue lightAbsorption curves for the different cones have been determined experimentallyStrangely these do not match the CIE standards for red (700nm), green (546.1nm) and blue (435.8nm) light as the standards were developed before the experiments!

Page 7: Digital Image Processing Colour Image Processing

7

Color Fundamentals (cont…)

Ima

ge

s ta

ken

fro

m G

on

zale

z &

Wo

od

s, D

igita

l Im

ag

e P

roce

ssin

g (

20

02

)

Page 8: Digital Image Processing Colour Image Processing

8

Color Fundamentals (cont…)3 basic qualities are used to describe the quality of a chromatic light source:

• Radiance: the total amount of energy that flows from the light source (measured in watts)

• Luminance: the amount of energy an observer perceives from the light source (measured in lumens)

• Note we can have high radiance, but low luminance• Brightness: a subjective (practically unmeasurable)

notion that embodies the intensity of light

We’ll return to these later on

Page 9: Digital Image Processing Colour Image Processing

9

CIE Chromacity Diagram

Specifying colors systematically can be achieved using the CIE chromacity diagramOn this diagram the x-axis represents the proportion of red and the y-axis represents the proportion of green used The proportion of blue used in a color is calculated as:

z = 1 – (x + y)

Page 10: Digital Image Processing Colour Image Processing

10

CIE Chromacity Diagram (cont…) Green: 62% green, 25%

red and 13% blueRed: 32% green, 67% red and 1% blue

Ima

ge

s ta

ken

fro

m G

on

zale

z &

Wo

od

s, D

igita

l Im

ag

e P

roce

ssin

g (

20

02

)

Page 11: Digital Image Processing Colour Image Processing

11

CIE Chromacity Diagram (cont…)Any color located on the boundary of the chromacity chart is fully saturatedThe point of equal energy has equal amounts of each color and is the CIE standard for pure whiteAny straight line joining two points in the diagram defines all of the different colors that can be obtained by combining these two colors additivelyThis can be easily extended to three points

Page 12: Digital Image Processing Colour Image Processing

12

CIE Chromacity Diagram (cont…) This means the entire

color range cannot be displayed based on any three colorsThe triangle shows the typical color gamut produced by RGB monitorsThe strange shape is the gamut achieved by high quality color printers

Ima

ge

s ta

ken

fro

m G

on

zale

z &

Wo

od

s, D

igita

l Im

ag

e P

roce

ssin

g (

20

02

)

Page 13: Digital Image Processing Colour Image Processing

13

Color Models

From the previous discussion it should be obvious that there are different ways to model colorWe will consider two very popular models used in color image processing:

• RGB (Red Green Blue)• HIS (Hue Saturation Intensity)

Page 14: Digital Image Processing Colour Image Processing

14

RGB

In the RGB model each color appears in its primary spectral components of red, green and blueThe model is based on a Cartesian coordinate system

• RGB values are at 3 corners• Cyan magenta and yellow are at three other corners• Black is at the origin• White is the corner furthest from the origin• Different colors are points on or inside the cube

represented by RGB vectors

Page 15: Digital Image Processing Colour Image Processing

15

RGB (cont…)

Ima

ge

s ta

ken

fro

m G

on

zale

z &

Wo

od

s, D

igita

l Im

ag

e P

roce

ssin

g (

20

02

)

Page 16: Digital Image Processing Colour Image Processing

16

RGB (cont…)

Images represented in the RGB color model consist of three component images – one for each primary colorWhen fed into a monitor these images are combined to create a composite color imageThe number of bits used to represent each pixel is referred to as the color depthA 24-bit image is often referred to as a full-color image as it allows = 16,777,216 colors

382

Page 17: Digital Image Processing Colour Image Processing

17

RGB (cont…)

Ima

ge

s ta

ken

fro

m G

on

zale

z &

Wo

od

s, D

igita

l Im

ag

e P

roce

ssin

g (

20

02

)

Page 18: Digital Image Processing Colour Image Processing

18

The HSI Color Model

RGB is useful for hardware implementations and is serendipitously related to the way in which the human visual system works However, RGB is not a particularly intuitive way in which to describe colorsRather when people describe colors they tend to use hue, saturation and brightnessRGB is great for color generation, but HSI is great for color description

Page 19: Digital Image Processing Colour Image Processing

19

The HSI Color Model (cont…)The HSI model uses three measures to describe colors:

• Hue: A color attribute that describes a pure color (pure yellow, orange or red)

• Saturation: Gives a measure of how much a pure color is diluted with white light

• Intensity: Brightness is nearly impossible to measure because it is so subjective. Instead we use intensity. Intensity is the same achromatic notion that we have seen in grey level images

Page 20: Digital Image Processing Colour Image Processing

20

HSI, Intensity & RGB

Intensity can be extracted from RGB images – which is not surprising if we stop to think about itRemember the diagonal on the RGB color cube that we saw previously ran from black to whiteNow consider if we stand this cube on the black vertex and position the white vertex directly above it

Page 21: Digital Image Processing Colour Image Processing

21

HSI, Intensity & RGB (cont…)Now the intensity component of any color can be determined by passing a plane perpendicular to the intensity axis and containing the color pointThe intersection of the plane with the intensity axis gives us the intensity component of the color

Ima

ge

s ta

ken

fro

m G

on

zale

z &

Wo

od

s, D

igita

l Im

ag

e P

roce

ssin

g (

20

02

)

Page 22: Digital Image Processing Colour Image Processing

22

HSI, Hue & RGB

In a similar way we can extract the hue from the RGB color cubeConsider a plane defined by the three points cyan, black and whiteAll points contained in this plane must have the same hue (cyan) as black and white cannot contribute hue information to a color

Ima

ge

s ta

ken

fro

m G

on

zale

z &

Wo

od

s, D

igita

l Im

ag

e P

roce

ssin

g (

20

02

)

Page 23: Digital Image Processing Colour Image Processing

23

The HSI Color Model

Consider if we look straight down at the RGB cube as it was arranged previouslyWe would see a hexagonal shape with each primary color separated by 120° and secondary colors at 60° from the primariesSo the HSI model is composed of a vertical intensity axis and the locus of color points that lie on planes perpendicular to that axis

Ima

ge

s ta

ken

fro

m G

on

zale

z &

Wo

od

s, D

igita

l Im

ag

e P

roce

ssin

g (

20

02

)

Page 24: Digital Image Processing Colour Image Processing

24

The HSI Color Model (cont…)To the right we see a hexagonal shape and an arbitrary color point

• The hue is determined by an angle from a reference point, usually red

• The saturation is the distance from the origin to the point

• The intensity is determined by how far up the vertical intensity axis this hexagonal plane sits (not apparent from this diagram

Ima

ge

s ta

ken

fro

m G

on

zale

z &

Wo

od

s, D

igita

l Im

ag

e P

roce

ssin

g (

20

02

)

Page 25: Digital Image Processing Colour Image Processing

25

The HSI Color Model (cont…)Because the only important things are the angle and

the length of the saturation vector this plane is also often represented as a circle or a triangle

Ima

ge

s ta

ken

fro

m G

on

zale

z &

Wo

od

s, D

igita

l Im

ag

e P

roce

ssin

g (

20

02

)

Page 26: Digital Image Processing Colour Image Processing

26

HSI Model Examples

Ima

ge

s ta

ken

fro

m G

on

zale

z &

Wo

od

s, D

igita

l Im

ag

e P

roce

ssin

g (

20

02

)

Page 27: Digital Image Processing Colour Image Processing

27

HSI Model Examples

Ima

ge

s ta

ken

fro

m G

on

zale

z &

Wo

od

s, D

igita

l Im

ag

e P

roce

ssin

g (

20

02

)

Page 28: Digital Image Processing Colour Image Processing

28

Converting From RGB To HSIGiven a color as R, G, and B its H, S, and I values are calculated as follows:

H if B G

360 if B G

cos 112 R G R B

R G 2 R B G B 12

S 13

R G B min R,G,B

I 13 R G B

Page 29: Digital Image Processing Colour Image Processing

29

Converting From HSI To RGBGiven a color as H, S, and I it’s R, G, and B values are calculated as follows:

• RG sector (0 <= H < 120°)

• GB sector (120° <= H < 240°)

G 3I R B

B I 1 S

R I 1S cosH

cos 60 H

B 3I R G

R I 1 S

G I 1S cos H 120

cos H 60

Page 30: Digital Image Processing Colour Image Processing

30

Converting From HSI To RGB (cont…)

• BR sector (240° <= H <= 360°)

R 3I G B

G I 1 S

180cos

240cos1

H

HSIB

Page 31: Digital Image Processing Colour Image Processing

31

HSI & RGB

Ima

ge

s ta

ken

fro

m G

on

zale

z &

Wo

od

s, D

igita

l Im

ag

e P

roce

ssin

g (

20

02

)

RGB Color Cube

H, S, and I Components of RGB Color Cube

Page 32: Digital Image Processing Colour Image Processing

32

Manipulating Images In The HSI Model

In order to manipulate an image under the HSI model we:

• First convert it from RGB to HSI• Perform our manipulations under HSI• Finally convert the image back from HSI to RGB

RGB Image

HSI ImageRGB

Image

Manipulations

Page 33: Digital Image Processing Colour Image Processing

33

RGB -> HSI -> RGB

Ima

ge

s ta

ken

fro

m G

on

zale

z &

Wo

od

s, D

igita

l Im

ag

e P

roce

ssin

g (

20

02

)

RGB Image

Saturation

Hue

Intensity

Page 34: Digital Image Processing Colour Image Processing

34

Pseudocolor Image ProcessingPseudocolor (also called false color) image

processing consists of assigning colors to grey values based on a specific criterionThe principle use of Pseudocolor image processing is for human visualization

• Humans can discern between thousands of color shades and intensities, compared to only about two dozen or so shades of grey

Page 35: Digital Image Processing Colour Image Processing

35

Pseudo Color Image Processing – Intensity Slicing

Intensity slicing and color coding is one of the simplest kinds of Pseudocolor image processingFirst we consider an image as a 3D function mapping spatial coordinates to intensities (that we can consider heights)Now consider placing planes at certain levels parallel to the coordinate planeIf a value is on one side of such a plane it is rendered in one color, and a different color if on the other side

Page 36: Digital Image Processing Colour Image Processing

36

Pseudocolor Image Processing – Intensity Slicing (cont…)

Ima

ge

s ta

ken

fro

m G

on

zale

z &

Wo

od

s, D

igita

l Im

ag

e P

roce

ssin

g (

20

02

)

Page 37: Digital Image Processing Colour Image Processing

37

RGB -> HSI -> RGB (cont…)

Ima

ge

s ta

ken

fro

m G

on

zale

z &

Wo

od

s, D

igita

l Im

ag

e P

roce

ssin

g (

20

02

)

Page 38: Digital Image Processing Colour Image Processing

38

RGB -> HSI -> RGB (cont…)

Ima

ge

s ta

ken

fro

m G

on

zale

z &

Wo

od

s, D

igita

l Im

ag

e P

roce

ssin

g (

20

02

)

Page 39: Digital Image Processing Colour Image Processing

39

RGB -> HSI -> RGB (cont…)

Ima

ge

s ta

ken

fro

m G

on

zale

z &

Wo

od

s, D

igita

l Im

ag

e P

roce

ssin

g (

20

02

)

Page 40: Digital Image Processing Colour Image Processing

40

RGB -> HSI -> RGB (cont…)

Ima

ge

s ta

ken

fro

m G

on

zale

z &

Wo

od

s, D

igita

l Im

ag

e P

roce

ssin

g (

20

02

)

Page 41: Digital Image Processing Colour Image Processing

41

Chapter 6Color Image Processing

Page 42: Digital Image Processing Colour Image Processing

42

Chapter 6Color Image Processing

Page 43: Digital Image Processing Colour Image Processing

43

Chapter 6Color Image Processing

Page 44: Digital Image Processing Colour Image Processing

44

Chapter 6Color Image Processing

Page 45: Digital Image Processing Colour Image Processing

45

Chapter 6Color Image Processing

Page 46: Digital Image Processing Colour Image Processing

46

Chapter 6Color Image Processing

Page 47: Digital Image Processing Colour Image Processing

47

Chapter 6Color Image Processing

Page 48: Digital Image Processing Colour Image Processing

48

Chapter 6Color Image Processing

Page 49: Digital Image Processing Colour Image Processing

49

Chapter 6Color Image Processing

Page 50: Digital Image Processing Colour Image Processing

50

Chapter 6Color Image Processing

Page 51: Digital Image Processing Colour Image Processing

51

Chapter 6Color Image Processing

Page 52: Digital Image Processing Colour Image Processing

52

Chapter 6Color Image Processing

Page 53: Digital Image Processing Colour Image Processing

53

Chapter 6Color Image Processing

Page 54: Digital Image Processing Colour Image Processing

54

Chapter 6Color Image Processing

Page 55: Digital Image Processing Colour Image Processing

55

Chapter 6Color Image Processing

Page 56: Digital Image Processing Colour Image Processing

56

Chapter 6Color Image Processing

Page 57: Digital Image Processing Colour Image Processing

57

Chapter 6Color Image Processing

Page 58: Digital Image Processing Colour Image Processing

58

Chapter 6Color Image Processing

Page 59: Digital Image Processing Colour Image Processing

59

Chapter 6Color Image Processing

Page 60: Digital Image Processing Colour Image Processing

60

Chapter 6Color Image Processing

Page 61: Digital Image Processing Colour Image Processing

61

Chapter 6Color Image Processing

Page 62: Digital Image Processing Colour Image Processing

62

Chapter 6Color Image Processing

Page 63: Digital Image Processing Colour Image Processing

63

Chapter 6Color Image Processing

Page 64: Digital Image Processing Colour Image Processing

64

Chapter 6Color Image Processing

Page 65: Digital Image Processing Colour Image Processing

65

Chapter 6Color Image Processing

Page 66: Digital Image Processing Colour Image Processing

66

Chapter 6Color Image Processing

Page 67: Digital Image Processing Colour Image Processing

67

Chapter 6Color Image Processing

Page 68: Digital Image Processing Colour Image Processing

68

Chapter 6Color Image Processing

Page 69: Digital Image Processing Colour Image Processing

69

Chapter 6Color Image Processing

Page 70: Digital Image Processing Colour Image Processing

70

Chapter 6Color Image Processing

Page 71: Digital Image Processing Colour Image Processing

71

Chapter 6Color Image Processing

Page 72: Digital Image Processing Colour Image Processing

72

Chapter 6Color Image Processing

Page 73: Digital Image Processing Colour Image Processing

73

Chapter 6Color Image Processing