0% found this document useful (0 votes)
9 views

DIP Unit4 2 Color Image Processing

Image processing
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

DIP Unit4 2 Color Image Processing

Image processing
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 68

Color Image Processing

Color Fundamentals

07/21/2024 2
Color Fundamentals

07/21/2024 3
Color Fundamentals

► 6 to 7 million cones in the human eye can be divided into


three principal sensing categories, corresponding roughly
to red, green, and blue.
65%: red 33%: green 2%: blue (blue cones are the
most sensitive)

07/21/2024 4
Color Fundamentals

07/21/2024 5
07/21/2024 6
Color Fundamentals

► The characteristics generally used to distinguish one color


from another are brightness, hue, and saturation

brightness: the achromatic notion of intensity.

hue: dominant wavelength in a mixture of light waves,


represents dominant color as perceived by an observer.

saturation: relative purity or the amount of white light


mixed with its hue.

07/21/2024 7
Color Fundamentals

► Tristimulus
Red, green, and blue are denoted X, Y, and Z, respectively.
A color is defined by its trichromatic coefficients, defined
as
X
x
X Y  Z
Y
y
X Y  Z
Z
z
X Y  Z
07/21/2024 8
CIE Chromaticity Diagram

It shows color
composition
as a function
of x (red) and
y (green)

07/21/2024 9
RGB Color Model

07/21/2024 10
RGB Color Model

Pixel depth

The total number of


colors in a 24-bit RGB
image is (28)3 =
16,777,216

07/21/2024 11
07/21/2024 12
Safe RGB colors (or
safe Web colors) are
reproduced faithfully,
reasonably
independently of
viewer hardware
07/21/2024
capabilities 13
07/21/2024 14
The CMY and CMYK Color Models

 C  1  R 
 M   1  G 
    
 Y  1  B 
Equal amounts of the pigment primaries, cyan, magenta, and
yellow should produce black. In practice, combining these
colors for printing produces a muddy-looking black.

To produce true black, the predominant color in printing, the


fourth color, black, is added, giving rise to the CMYK color
model.
07/21/2024 15
CMY vs. CMYK

07/21/2024 16

http://en.wikipedia.org/wiki/CMYK
HIS Color Model

brightness: the achromatic notion of intensity.

hue: dominant wavelength in a mixture of light waves, represents dominant color


as perceived by an observer.

saturation: relative purity or the amount of white light mixed with its hue.

07/21/2024 17
HIS Color Model

07/21/2024 18
HIS Color Model

07/21/2024 19
HIS Color Model

07/21/2024 20
Converting Colors from RGB to HSI

► Given an image in RGB color format, the H component of


each RGB pixel is obtained using the equation

 if B  G
H 
360   if B>G

 1 
1 
 ( R  G )  ( R  B )  
  cos  2
1/2 
  R  G   ( R  B )(G  B )  
2

  

07/21/2024 21
Converting Colors from RGB to HSI

► Given an image in RGB color format, the saturation


component is given by

3
S  1 min( R, G, B)
( R  G  B)

07/21/2024 22
Converting Colors from RGB to HSI

► Given an image in RGB color format, the intensity


component is given by

1
I  R  G  B
3

07/21/2024 23
Converting Colors from HSI to RGB

► RG sector (0  H  120 )

B  I (1  S )
 S cos H 
R  I 1  
 cos(60  H ) 

and
G  3I  ( R  B )

07/21/2024 24
Converting Colors from HSI to RGB

► RG sector (120  H  240 )

H  H  120
R  I (1  S )
 S cos H 
G  I 1  
 cos(60 
 H ) 
and
B  3I  ( R  G )
07/21/2024 25
Converting Colors from HSI to RGB

► RG sector (240  H  360 )

H  H  240
G  I (1  S )
 S cos H 
B  I 1  
 cos(60 
 H ) 
and
R  3I  (G  B )
07/21/2024 26
07/21/2024 27
07/21/2024 28
07/21/2024 29
Pseudocolor Image Processing

► The process of assigning colors to gray values based on a


specified criterion.

► Intensity Slicing

f ( x, y )  ck if f ( x, y )  Vk

07/21/2024 30
07/21/2024 31
07/21/2024 32
33
07/21/2024 34
07/21/2024 35
Pseudocolor Image Processing

► Intensity to Color Transformation

07/21/2024 36
The images are obtained
from an airport X-ray
scanning system.
The left contains ordinary
articles and the right
contains the same articles
as well as a block of
simulated plastic explosives.

07/21/2024 37
07/21/2024 38
07/21/2024 39
07/21/2024 40
Pseudocolor by combining
several of the sensor
images from the Galileo
spacecraft, some of which
are in spectral regions not
visible to the eye.

Bright red depicts materials


newly ejected from an
active volcano on Io, and
the surrounding yellow
materials are older sulfur
deposits.

07/21/2024 41
Basics of Full-Color Image Processing

Let c represent an arbitrary vector in RGB color space:


 cR   R 
c  cG   G 
 cB   B 
At coordinates (x, y ),
 cR ( x, y )   R ( x, y ) 
c( x, y )  cG ( x, y )   G ( x, y ) 
 cB ( x, y )   B ( x, y ) 

07/21/2024 42
Basics of Full-Color Image Processing

07/21/2024 43
Color Transformations

g ( x, y )  T  f ( x, y ) 

si  Ti (r1 , r2 ,..., rn ), i  1, 2,..., n.

07/21/2024 44
07/21/2024 45
g ( x, y )  kf ( x, y )

si  kri , si  kri  (1  k ), s3  kr3


07/21/2024 i  1, 2,3. i  1, 2,3. 46
07/21/2024 47
07/21/2024 48
Color slicing

► Highlighting a specific range of colors in an image

If the colors of interest are enclosed by a cube of width W


and centered at a protypical color with components
(a1 , a2 ,..., an ), the necessary set of transformations is
0.5 if | rj  a j | W / 2 
si   any 1 j  n

 ri otherwise

07/21/2024 49
Color slicing

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


R 0 is the radius of the enclosing of its center.
The transformations is
 n
if   rj  a j   R02
2
 0.5
si   j 1
r otherwise
i

07/21/2024 50
Color slicing

07/21/2024 51
Tone and
Color
Corrections

07/21/2024 52
07/21/2024 53
07/21/2024 54
Color Image Smoothing

Let S xy denote the set of coordinates defining a neighborhood


centered at (x, y ) in an RGB color image. The average of the
RGB component vectors in this neighborhood is
1 
  R ( s, t ) 
 K ( s ,t )S xy 
1 1 
c ( x, y )  
K ( s ,t )S xy
c ( s, t )   
 K ( s ,t )S xy
G ( s, t ) 

 
1 
 K ( s ,
B ( s , t )

 t )S xy 
07/21/2024 55
07/21/2024 56
07/21/2024 57
07/21/2024 58
Color Image Sharpening

The Laplacian of vector c is

  2 R ( x, y ) 
 2 
  c ( x, y )     G ( x, y ) 
2

  2 B ( x, y ) 
 

07/21/2024 59
07/21/2024 60
Image
Segmentation
Based on Color:

Segmentation
in HIS Color
Space

07/21/2024 61
Segmentation in RGB Vector Space

Let the average color of interest is denoted by the


RGB vector a. Let z denote an arbitrary point in
RGB space.
1/2
D( z , a )  z  a  ( z  a ) ( z  a ) 
T

2 1/2
 ( z R  aR )  ( zG  aG )  ( z B  aB ) 
2 2

07/21/2024 62
07/21/2024 63
Color Edge Detection (1)

Let r, g, and b be unit vectors along the R, G, and B


axis of RGB color space, and define vectors
R G B
u r g b
x x x
and
R G B
v r g b
y y y

07/21/2024 64
Color Edge Detection (2)

2 2 2
R G B
g xx  u u=  
x x x
2 2 2
R G B
g yy  vv=  
y y y
and
R R G G B B
g xy  u v=  
x y x y x y

07/21/2024 65
Color Edge Detection (3)

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


the angle
1  2 g xy 
 ( x, y )  tan 
1

2  g xx  g yy 
The value of the rate of change at (x, y ) in the direction of  ( x, y ),
is given by
1/2
1  
F (x, y )=   g xx  g yy    g xx  g yy  cos 2 ( x, y )  2 g xy sin 2 ( x, y )  
2 

07/21/2024 66
07/21/2024 67
07/21/2024 68

You might also like