digital image processing

70
Sheng-Fang Huang Chapter 6

Upload: noel-noble

Post on 03-Jan-2016

19 views

Category:

Documents


0 download

DESCRIPTION

Digital Image Processing. Sheng-Fang Huang Chapter 6. 6.1 Color Fundamentals. White light consists of a continuous spectrum of colors ranging from violet to red. Color Spectrum. Visible light is composed of a relatively narrow band of frequencies in the electromagnetic spectrum. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Digital Image Processing

Sheng-Fang HuangChapter 6

Page 2: Digital Image Processing

6.1 Color Fundamentals6.1 Color Fundamentals

White light consists of a continuous spectrum of colors ranging from violet to red.

Page 3: Digital Image Processing

Color SpectrumColor Spectrum

Visible light is composed of a relatively narrow band of frequencies in the electromagnetic spectrum.

Page 4: Digital Image Processing

The colors that humans perceive of an object are determined by the nature of the light reflected from the object.◦ Green objects reflect light with wavelengths in

the 500 to 570 nm, and absorb those at other wavelengths.

The light is visible to human eyes if its wavelength is between 380-780 (nm).

If the light is achromatic, its only attribute is intensity.◦ The term gray level refers to a scalar ranging

from black to white.

Page 5: Digital Image Processing

The cone cells in human eye can be divided into three categories, corresponding roughly to red, green and blue (Figure 6.3).

Due to these characteristics of the human eye, colors are seen as variable combinations of the primary colors red (700 nm), green (546.1 nm), and blue (435.8 nm).◦ Standardized in 1931.◦ This standardization does not mean these three

primary colors can generate all spectrum colors.

Page 6: Digital Image Processing
Page 7: Digital Image Processing

Secondary ColorsSecondary Colors

•The primary colors can be added to produce the secondary colors of light: Cyan (青綠 ), Magenta (洋紅 ) , Yellow (黃 ).

•The primary colors of pigments are cyan, magenta, and yellow, while the secondary colors are red, green, and blue.

Page 8: Digital Image Processing

The characteristics generally used to distinguish one color from another are hue, saturation, and brightness.  ◦ Hue: associated with color as perceived by an

observer.◦ Saturation: relative purity or the amount of white

light mixed with a hue.◦ Brightness: intensity of light.

Hue and saturation are taken together are called chromaticity; therefore, a color can be charaterized by its chromaticity and brightness.

Page 9: Digital Image Processing

The Color DiagramThe Color Diagram

Page 10: Digital Image Processing

The color model (color space or color system) is to facilitate the specification of colors in some standards.

color model is a specification of a coordinate system and a subspace within the system where a color is represented.◦ RGB: color monitor◦ CMY (cyan, magenta, yellow): color printing◦ HSI (hue intensity and saturation): decouple

the color and gray-scale information.

Page 11: Digital Image Processing

The RGB Color ModelThe RGB Color Model

Images represented in the RGB color model consist of three component images, one for each primary image.

Page 12: Digital Image Processing
Page 13: Digital Image Processing

The RGB Color ModelThe RGB Color Model

The number of bits used to represent each pixel in RGB space is called the pixel depth.

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

Page 14: Digital Image Processing

Suppose colors in RGB are normalized in [0, 1]. The RGB to CMY conversion is given by

Instead of adding C,M, and Y to produce black, a fourth color black is added, giving rise to the CMYK color model.

B

G

R

Y

M

C

1

1

1

Page 15: Digital Image Processing

Human describes color in terms of hue, saturation and brightness.◦ Hue: describe the pure color, pure yellow,

orange, green or red.◦ Saturation measures the degree to which a

pure color is diluted by white light.◦ Brightness is a subjective descriptor difficult

to be measured. Comparison:

◦ The RGB model is ideal for image color generation.

◦ The HSI model is an ideal tool for developing image processing algorithms based on color descriptions.

Page 16: Digital Image Processing

Consider a color point in the RGB color cube.◦ Intensity: find the intersection on the intensity

axis with a perpendicular plane containing the color point.

◦ Saturation: The distance of the color point to the intensity axis. The saturation on the intensity axis is zero.

◦ Hue: consider the triangle enclosed by white, black, cyan. The color on this triangle is a mixture of these three colors.

Page 17: Digital Image Processing

The HSI Color ModelThe HSI Color Model

All pointes contained in the plane segment are defined by the intensity and boundary of the cube have the same hue

Page 18: Digital Image Processing

Hue Measurement

Page 19: Digital Image Processing

The HSI Color ModelThe HSI Color Model

Page 20: Digital Image Processing

From RGB to HSI

S=1-[3/(R+G+B)][min(R, G, B)] I=(R+G+B)/3

GBif

GBifH

360

2/12

1

)])((()[(

)]()[(2/1cos

BGBRGR

BRGR

Page 21: Digital Image Processing

RG sector (0<H<120)B = I(1-S)

G = 3I-(R+B)

)60cos(

cos1

H

HSIR

o

Page 22: Digital Image Processing

GB sector (120≤H<240)◦ First, let H = H -120

R=I(1-S)

B=3I-(R+G)

)60cos(

cos1

H

HSIG

o

Page 23: Digital Image Processing

BR sector (240 ≤ H ≤ 360)◦ First, let H = H -240

G = I(1-S)

R = 3I-(G+B)

)60cos(

cos1

H

HSIB

o

Page 24: Digital Image Processing

The HSI Color ModelThe HSI Color Model

Page 25: Digital Image Processing

Assigning colors to gray values based on a specified criterion.

Intensity slicing: using a plane at f(x, y)=li

to slice the image function into two levels.◦ We assume that P planes perpendicular to the

intensity axis defined at level li i=1,2,..P. These

P planes partition the gray level in to P+1 intervals: V

k k=1,2,..P+1

◦ f(x, y)=ci if f(x, y) Vk

where ci is the color associated with the kth

intensity interval Vk defined by the partition lanes at l=k-1 and l=k.

Page 26: Digital Image Processing

Intensity SlicingIntensity Slicing

Page 27: Digital Image Processing

Example 6.3Example 6.3

Page 28: Digital Image Processing

Example 6.4Example 6.4

Page 29: Digital Image Processing

Three independent transformation functions on the gray-level of each pixel.◦ This method produces a composite image

whose color content is modulated by the nature of the transformation functions.

Page 30: Digital Image Processing

6.3 Pseudo Image Processing 6.3 Pseudo Image Processing

• Combine several monochrome images into a single color image

Page 31: Digital Image Processing

6.3 Pseudo Image Processing6.3 Pseudo Image Processing

Page 32: Digital Image Processing

Example 6.6Example 6.6

Page 33: Digital Image Processing

Example 6.6Example 6.6

One way to combine the sensed image data is by how they show either differences in surface chemical composition or changes in thee way the surface reflects sunlight.

Page 34: Digital Image Processing

Two categories:◦ Process each component individually and then

form a composite processed color image from the components.

◦ Work with color pixels directly. In RGB system, each color point can be interpreted as a vector.

◦ c(x, y)=[cR(x, y), cG(x, y), cB(x, y)]

Page 35: Digital Image Processing

6.4 Full-Color Image Processing 6.4 Full-Color Image Processing

Page 36: Digital Image Processing

FormulationGray-level transformation

g(x, y)=T[f(x, y)]Color transformation

si =Ti (r1, r2,….rn) I =1,2,…, nwhere ri and si are variables denoting the color component of f(x, y) and g(x, y) at any point (x, y), n is the number of color components, and {Ti} is a set of transformation or color mapping functions

Page 37: Digital Image Processing

6.5 Color Transformation6.5 Color Transformation

Page 38: Digital Image Processing

To modify the intensity of the image g(x,y)=kf(x,y) 0<k<1

◦ HSI : s3=kr3

◦ RGB: si=kri i=1, 2, 3

◦ CMY: si=kri+(1-k) i=1, 2, 3

Page 39: Digital Image Processing

6.5 Color Transformation6.5 Color Transformation

Page 40: Digital Image Processing

The hues directly opposite one another on the color circle are called complements

Color complements are useful for enhancing detail that is embedded in dark regions of a color image

Page 41: Digital Image Processing

6.5.2 Color Complements6.5.2 Color Complements

Page 42: Digital Image Processing

Example 6.7Example 6.7

Unlike Fig. 6.31, the RGB complement transformation functions used in this example do not have a straightforward HSI space equivalent, because the saturation component of the complement cannot be computed from

the saturation component alone.

Page 43: Digital Image Processing

Highlighting a specific range of colors in an image is useful for separating object from their surrounding.

The simplest way to “slice” a color image is to map the colors outside some range of interest to a nonprominent neutral color (e.g., (R, G, B)=(0.5, 0.5, 0.5)). ◦ If the colors of interest are enclosed by a cube

(or hypercube for n>3) of width W and centered at a average color with component (a1, a2,…an) the necessary set of transformation is

otherwiser

Warifs

i

njanyjji

12/5.0

Page 44: Digital Image Processing

If a sphere is used to specify the colors of interest then

Forcing all other colors to the mid point of the reference color space.

In RGB color space, the neural color is (0.5, 0.5, 0.5)

otherwiser

Rarifs

i

n

ji 1

20

2)(5.0

Page 45: Digital Image Processing

6.5 Color Transformation - Color Slicing6.5 Color Transformation - Color Slicing

Page 46: Digital Image Processing

In the RGB, the transformation is achieved by mapping all three (or four) color components with the same transformation function.

In the HSI color space, only the intensity component is modified.

Page 47: Digital Image Processing

Example 6.9 Color Transformation

Example 6.9 Color Transformation

Tonal transformation for flat, light and dark images

Page 48: Digital Image Processing

Example 6.10 Color CorrectionExample 6.10 Color Correction

Color Balancing: The proportion of any color can be increased by decreasing the amount of opposite (complementary) color in the image.

Page 49: Digital Image Processing

Equalizing the histogram of each component will result in erroneous colors.

Spread the color intensity uniformly, leaving the color themselves (hues) unchanged.

Equalizing the intensity histogram affects the relative appearance of colors in an image.

Page 50: Digital Image Processing

Example 6.11Example 6.11

Page 51: Digital Image Processing

Let Sxy denote the set of coordinates defining a neighborhood centered at (x, y) in an RGB color space.

xy

xy

xy

Syx

Syx

Syx

yxBK

yxGK

yxRK

yx

),(

),(

),(

),(1

),(1

),(1

),(c

Page 52: Digital Image Processing

Example 6.12Example 6.12

Page 53: Digital Image Processing

Example 6.12 – Smoothing in HSI color spaceExample 6.12 – Smoothing in HSI color space

Page 54: Digital Image Processing

Example 6.12-Comparison Example 6.12-Comparison

Page 55: Digital Image Processing

Image sharpening using Laplacian operator

),(

),(

),(

),(2

2

2

2

yxB

yxG

yxR

yxc

Page 56: Digital Image Processing

Example 6.13 Example 6.13

Page 57: Digital Image Processing

Partition an image into regions according to its colors.◦ It is natural to think first of the HSI color space.

Regions with specific hue are first extracted. Saturation is used as a masking image to isolate

further regions of interest in the hue image. The intensity image is used less frequently.

Page 58: Digital Image Processing

Segmentation in RGB color space The measurement of color similarity is the

Euclidean distance between two colors z, and a,

D(z, a)=||z-a||=[(z-a)T(z-a)]1/2

=[(zR-aR)2+ (zG-aG)2 +(zB-aB)

2]1/2

◦ The subscripts R, G, and B denote the RGB components of vectors a and z.

Page 59: Digital Image Processing

6.7 Color Segmentation6.7 Color Segmentation

Page 60: Digital Image Processing

6.7 Color Segmentation6.7 Color Segmentation

The dimension of the box along R-axis extended from (aR-1.25R) to (aR+1.25R)

Page 61: Digital Image Processing

The gradient operators introduced is effective for scalar image.

Compute the gradient on individual images and then using the results to form a color image may lead to erroneous results.

Page 62: Digital Image Processing

Di Zenzo [1986]:◦ Let r, g, b be a unit vector along the R, G, B

axis and define the unit vector as

◦ gxx= uu =|R/x|2+|G/x|2+|B/x|2 ◦ gyy= vv =|R/y|2+|G/y|2+|B/y|2 ◦ gxy= uv =(R/x)(R/y) +(G/x) (G/y)

+(B/x)(B/y)

bgrux

B

x

G

x

R

bgrvy

B

y

G

y

R

Page 63: Digital Image Processing

The direction of maximum rate of change of c(x, y) is given by the angle

The value of the rate of change at (x,y) in the direction isF()={0.5[(gxx+gyy)+(gxx-gyy)cos +2gxysin ]}1/2

There are two solved in orthogonal directions.

One generate maximum F and the other generate minimum F.

)(

2tan

2

1 1

yyxx

xy

gg

g

Page 64: Digital Image Processing

6.7.3 Color Edge Detection6.7.3 Color Edge Detection

Page 65: Digital Image Processing

6.7.3 Color Edge Detection6.7.3 Color Edge Detection

Page 66: Digital Image Processing

The noise content of a color image has the same characteristics in each color channel.

It is possible for color channels to be affected differently by noise.

Page 67: Digital Image Processing

Example 6.17 Example 6.17

Page 68: Digital Image Processing

6.8 Noise in Color Image6.8 Noise in Color Image

The hue and saturation components are strongly degraded due to the nonlinearity of the cos and min operator.

The intensity is slightly smoothed because the intensity image is the average

of the RGB images.

Page 69: Digital Image Processing

6.8 Noise in Color Image6.8 Noise in Color Image

Page 70: Digital Image Processing

Filtering of full-color images can be carried out on a per-image basis or directly in color vector space.

Some filters cannot be formulated in this manner.◦ For example, order statistics filters.