Vous êtes sur la page 1sur 81

Color Image Processing

1
 Motive
- Color is a powerful descriptor that often
simplifies object identification and extraction
from a scene.
- Human can discern thousands of color
shades and intensities, compared to about
only two dozen shades of gray.

2
Preview

3
Preview

4
Preview

 Color image processing is divide into two


major area:
 Full-Color Processing
 Pseudo-Color Processing

5
Color Fundamentals

The experiment of Sir Isaac Newton, in 1666.

6
Color Fundamentals (con’t)c

7
Color Fundamentals (con’t)c

 Basic quantities to describe the quality of light


source:
 Radiance: Total amount of energy that flows from
the light source (in W).
 Luminance: A measure of the amount of energy
an observer perceives from the light source (in lm)
 Brightness: A subjective descriptor that embodies
the achromatic notion of intensity and is practical
impossible to measure.

8
Color Fundamentals (con’t)

Standard wavelength values for the


primary colors

9
Color Fundamentals (con’t)

10
Color Fundamentals (con’t)

 The characteristics generally used to distinguish


one color from another are Brightness, Hue, and
Saturation.
 Hue: Represents dominant color as perceive by an
observer.
 Saturation: Relative purity or the amount of white light
mixed with a hue

 Hue and saturation taken together are called


Chromaticity, and therefore, a color may be
characterized by its Brightness and Chromaticity.
11
Color Fundamentals (con’t)

 Tri-stimulus values: The amount of Red, Green and


Blue needed to form any particular color
Denoted by: X, Y and Z

 Tri-chromatic coefficient:

X Y Z
x y z
X Y  Z X Y  Z X Y  Z

x  y  z 1

12
Color Fundamentals (con’t)

Chromaticity Diagram

Green Point =
62% green,
25% red,
13% blue.

13
Color Fundamentals (con’t)

Color Gamut
produced by RGB
monitors

Color Gamut
produced by high
quality color printing
device

14
Color Models

 The purpose of a color model (also called color


space or color system) is to facilitate the
specification of colors in some standard,
generally accept way.
 RGB (red,green,blue) : monitor, video camera.
 CMY(cyan,magenta,yellow),CMYK (CMY, black) model
for color printing.
 and HSI model,which corresponds closely with the way
humans describe and interpret color.

15
The RGB Color Models

16
The RGB Color Models (con’t)

2 
8 3
 16,777,216 Colors
17
The RGB Color Models (con’t)

18
The RGB Color Models (con’t)

Safe RGB Colors (Safe Web colors)

19
The RGB Color Models (con’t)

20
The CMY and CMYK Color Models

 Cyan, Magenta and Yellow are the secondary colors


of light
 Most devices that deposit colored pigments on
paper, such as color printers and copiers, require CMY
data input.
 C  1  R 
M   1  G 
    
 Y  1  B 

21
The HSI Color Models

22
The HSI Color Models

23
The HSI Color Models

24
The HSI Color Models
 Converting colors from RGB to HSI

 if B  G
H 
360   if B  G
 1 
[( R  G )  ( R  B )]
1  
  cos  2
1/ 2 
 [( R  G ) 2
 ( R  B )( G  B )] 
 
3
S  1 [min( R, G, B)]
( R  G  B)
1
I  ( R  G  B)
3 25
The HSI Color Models
 Converting colors from HIS
to RGB
 RG sector :
0   H  120 

B  I (1  S )

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

G  3I  ( R  B )

26
The HSI Color Models
 Converting colors from HIS
to RGB
 GB sector : 120   H  240 

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

27
The HSI Color Models
 Converting colors from HIS
to RGB
 BR sector : 240   H  360 

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

28
The HSI Color Models

29
The HSI Color Models
RGB H H S

S I I RGB

30
Pseudocolor Image Processing

 Pseudocolor (also called false color) image


processing consists of assigning colors to gray
values based on a specified criterion.

 The principal use of pseudocolor is for human


visualization and interpretation of gray-scale events
in an image or sequence of images.

31
Intensity Slicing

32
Intensity Slicing (con’t)

33
Intensity Slicing (con’t)

34
Intensity Slicing (con’t)

35
Gray Level to Color Transformations

36
Gray Level to Color Transformations

37
Gray Level to Color Transformations

38
Gray Level to Color Transformations

39
Gray Level to Color Transformations

40
Gray Level to Color Transformations

41
Basic of Full Color Image Processing

Let c represent an arbitrary vector in RGB color space

 cR   R 
c  cG   G 
cB   B 
For an image of size M*N,

cR ( x, y)   R( x, y) 
c( x, y)  cG ( x, y )  G( x, y)
cB ( x, y)   B( x, y) 
42
Basic of Full Color Image Processing

43
Basic of Full-Color Image Processing

 Major categories of full-color Image


processing:
 Per-color-component processing
 Vector-based processing

44
Basic of Full-Color Image Processing
Color Transformation

Processing the components of a color image


within the context of a single color model.

g ( x, y)  T  f ( x, y)
si  Ti r1 , r2 ,, rn , i  1,2,..., n

Color components of g Color components of f

Color mapping functions

45
Full-Color Image Processing
Color Transformation

CMYK

RGB  Some difficulty in interpreting the


HUE:
 Discontinuity where 0 and
360º meet.

HSI  Hue is undefined for a


saturation 0 46
Full-Color Image Processing
Color Transformation: Modify the Intensity

si  kri i  1,2,3 s1  r1
g ( x, y )  kf ( x, y )
si  kri  (1  k ) i  1,2,3 s2  r2
47
s3  kr3
Full-Color Image Processing
Color Transformation: Color Complement

48
Full-Color Image Processing
Color Transformation: Color Complement

49
Full-Color Image Processing
Color Transformation: Color Slicing

Motive: Highlighting a specific range of colors in an


image

Basic Idea:
 Display the color of interest so that they stand out
from background
 Use the region defined by the colors as a mask for
further processing

  W
0.5 if  rj  a j  
si    2  any1 j  n , i  1,2,..., n
r
i otherwise
50
Full-Color Image Processing
Color Transformation: Color Slicing

1. Colors of interest are enclosed by cube (or hypercube


for n>3)
  W
0.5 if  rj  a j  
si    2  any1 j  n , i  1,2,..., n
r
i otherwise

2. Colors of interest are enclosed by Sphere


 n
 0.5 if  (rj  a j )  R0
2 2
si   j 1
, i  1,2,..., n
ri otherwise

51
Full-Color Image Processing
Color Transformation: Color Slicing

Cube Sphere

52
Full-Color Image Processing
Color Transformation: Color Correction
The proportion of any color can be increased by decreasing the
amount of the opposite (or complementary) color in the image or by
raising the proportion of the two immediately adjacent colors or
decreasing the percentage of the two colors adjacent to the
complement.

Magenta 

Removing Red Adding Green


and Blue

53
Full-Color Image Processing
Color Transformation: Color Correction

54
Full-Color Image Processing
Color Transformation: Histogram Processing

Histogram
Equalizing the Saturation
Intensity Adjustment

55
Full-Color Image Processing
Color Image Smoothing

Averaging:
1
c ( x, y ) 
K
 c ( x, y )
( x , y )S xy

1 
  R ( x, y ) 
 K ( x , y )S xy 
1 
c ( x, y )    G ( x, y ) 
 K ( x , y )S xy 
1 
 K  B ( x, y ) 
 ( x , y )S xy 
56
Full-Color Image Processing
Color Image Smoothing

Red

Green Blue

57
Full-Color Image Processing
Color Image Smoothing

Hue Saturation Intensity

58
Full-Color Image Processing
Color Image Smoothing
Averaging R,G and B Averaging Intensity Difference

59
Full-Color Image Processing
Color Image Sharpening

The Laplacian of Vector c :

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

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

60
Full-Color Image Processing
Color Image Sharpening
Sharpening R,G and B Sharpening Intensity Difference

61
Full-Color Image Processing
Color Segmentation

Segmentation is a process that partitions an


image into regions

 Segmentation in HIS Color Space


 Segmentation in RGB Vector Space
 Color Edge Detection

62
Full-Color Image Processing
Color Segmentation: in HIS Color Space

63
Full-Color Image Processing
Color Segmentation: in RGB Vector Space
z is similar to a if the distance between them is less than a
specified threshold.
Euclidian Distance: D(z, a )  z  a

 (z  a )T (z  a ) 
1/ 2

 ( z  a ) 
1/ 2
R R
2
 ( zG  aG ) 2  ( z B  aB ) 2

D(z, a )  (z  a ) C 
1 1/ 2
Generalized form: T
(z  a )

64
Full-Color Image Processing
Color Segmentation: in RGB Vector Space

65
Full-Color Image Processing
Color Segmentation: Color Edge Detection

66
Full-Color Image Processing
Color Segmentation: Color Edge Detection

67
Full-Color Image Processing
Color Segmentation: Color Edge Detection

68
Full-Color Image Processing
Noise in Color Images

69
Full-Color Image Processing
Noise in Color Images

70
Full-Color Image Processing
Noise in Color Images

71
From Images to Objects

• What Defines an Object?


– Subjective problem, but has been well-studied
– Gestalt Laws seek to formalize this
• proximity, similarity, continuation, closure, common fat

72
Finding Modes in a Histogram

• How Many Modes Are There?


– Easy to see, hard to compute 73
Mean Shift

• Iterative Mode Search


1. Initialize random seed, and fixed window
2. Calculate center of gravity of the window (the “mean”)
3. Translate the search window to the mean
74
4. Repeat Step 2 until convergence
75
Mean-Shift

76
77
Correlation comparison
• Average face template • Edge face template
– Poor separation between faces – Better separation between
– Difficult to identify face centroid faces
– Peaks (centroid) more easily
identifiable

78
Segmentation Using Edges

• Edges  Segments
– Spurious edges
– Missing
How edges
could user-interaction help?
79
Snakes

80
Using texture features for
segmentation
• Convolve image with a bank of filters
• Find textons by clustering vectors of filter
bank outputs
Image Texton map

81

Vous aimerez peut-être aussi