Anda di halaman 1dari 77

Chapter 6

Color Image Processing


Preview
Why use color in image processing?
Color is a powerful descriptor
Object identification and extraction
e.g., Face detection using skin colors
Humans can discern thousands of color shades and
intensities
c.f. Human discern only two dozen shades of grays
Chapter 6
Color Image Processing
Two category of color image processing
Full color processing
Images are acquired from full-color sensor or
equipments
Pseudo-color processing
In the past decade, color sensors and processing
hardware are not available
Colors are assigned to a range of monochrome
intensities
Preview
Chapter 6
Color Image Processing
Outline
Color fundamentals
Color models
Pseudo-color image processing
Basics of full-color image processing
Color transformations
Smoothing and sharpening
Chapter 6
Color Image Processing
Color fundamentals
Physical phenomenon
Physical nature of color is known

Physiopsychological phenomenon
How human brain perceive and interpret color?
Chapter 6
Color Image Processing
Color fundamentals
1666, Isaac Newton
Chapter 6
Color Image Processing
Visible light
Chromatic light span the electromagnetic
spectrum (EM) from 400 to 700 nm
Chapter 6
Color Image Processing
Color fundamentals
The color that human perceive in an object =
the light reflected from the object
Illumination source
scene
reflection
eye
Chapter 6
Color Image Processing
Physical quantities to describe a
chromatic light source
Radiance: total amount of energy that flow from the
light source, measured in watts (W)
Luminance: amount of energy an observer perceives
from a light source, measured in lumens (lm)
Far infrared light: high radiance, but 0 luminance
Brightness: subjective descriptor that is hard to
measure, similar to the achromatic notion of intensity
Chapter 6
Color Image Processing
How human eyes sense light?
6~7M Cones are the sensors in the eye
3 principal sensing categories in eyes
Red light 65%, green light 33%, and blue light 2%
Digital Image Processing, 3rd ed.
www.ImageProcessingPlace.com
19922008 R. C. Gonzalez & R. E. Woods
Gonzalez & Woods
Chapter 6
Color Image Processing
Chapter 6
Color Image Processing
Primary and secondary colors
In 1931, CIE(International Commission on
Illumination) defines specific wavelength values
to the primary colors
B = 435.8 nm, G = 546.1 nm, R = 700 nm
However, we know that no single color may be called
red, green, or blue
Secondary colors: G+B=Cyan, R+G=Yellow,
R+B=Magenta
Chapter 6
Color Image Processing
Chapter 6
Color Image Processing
Application of additive nature of light colors
Color TV
Chapter 6
Color Image Processing
Application of additive nature of light colors
Color TV
Chapter 6
Color Image Processing
CIE XYZ model
RGB -> CIE XYZ model



Normalized tristimulus values
Z Y X
X
x
+ +
=
Z Y X
Y
y
+ +
=
Z Y X
Z
z
+ +
=
(
(
(

(
(
(

=
(
(
(

B
G
R
Z
Y
X
939 . 0 130 . 0 020 . 0
071 . 0 707 . 0 222 . 0
178 . 0 342 . 0 431 . 0
=> x+y+z=1. Thus, x, y (chromaticity coordinate) is
enough to describe all colors
Chapter 6
Color Image Processing
Chapter 6
Color Image Processing
By additivity of colors:
Any color inside the
triangle can be produced
by combinations of the
three initial colors
RGB gamut of
monitors
Color gamut of
printers
Chapter 6
Color Image Processing
Outline
Color fundamentals
Color models
Pseudo-color image processing
Basics of full-color image processing
Color transformations
Smoothing and sharpening
Chapter 6
Color Image Processing
Color models
Color model, color space, color system
Specify colors in a standard way
A coordinate system that each color is
represented by a single point

RGB model
CYM model
CYMK model
HSI model
Suitable for hardware or
applications
- match the human description
Chapter 6
Color Image Processing
RGB color model
Chapter 6
Color Image Processing
Pixel depth
Pixel depth: the number of bits used to
represent each pixel in RGB space
Full-color image: 24-bit RGB color image
(R, G, B) = (8 bits, 8 bits, 8 bits)
Chapter 6
Color Image Processing
Application of additive nature of light colors
Color TV
Chapter 6
Color Image Processing
Safe RGB colors
Subset of colors is enough for some application
Safe RGB colors (safe Web colors, safe browser
colors)
(6)
3
= 216
Chapter 6
Color Image Processing
Safe RGB color
Chapter 6
Color Image Processing
Safe RGB color
Safe color cube Full color cube
Chapter 6
Color Image Processing
RGB color model
Chapter 6
Color Image Processing
CMY model (+Black = CMYK)
CMY: secondary colors of light, or primary
colors of pigments
Used to generate hardcopy output
(
(
(

(
(
(

=
(
(
(

B
G
R
Y
M
C
1
1
1
Chapter 6
Color Image Processing
HSI color model
Will you describe a color using its R, G, B
components?
Human describe a color by its hue, saturation,
and brightness
Hue: color attribute
Saturation: purity of color (white->0, primary
color->1)
Brightness: achromatic notion of intensity

Chapter 6
Color Image Processing
HSI color model
These spaces use a cylindrical (3D-polar) coordinate system to
encode the following three psycho-visual coordinates:
Hue (dominant colour seen)
Wavelength of the pure colour observed in the signal.
Distinguishes red, yellow, green, etc.
More the 400 hues can be seen by the human eye.
Saturation (degree of dilution)
Inverse of the quantity of white present in the signal. A pure colour has
100% saturation, the white and grey have 0% saturation.
Distinguishes red from pink, marine blue from royal blue, etc.
About 20 saturation levels are visible per hue.
Brightness
Amount of light emitted.
Distinguishes the grey levels.
The human eye perceives about 100 levels.
Chapter 6
Color Image Processing
HSI color model
RGB -> HSI model
Intensity
line
saturation
Colors on this triangle
Have the same hue
Chapter 6
Color Image Processing
HSI model: hue and saturation
Chapter 6
Color Image Processing
HSI model
Chapter 6
Color Image Processing
RGB to HSI
1
1/ 2
;
360 ;
1
[( ) ( )]
2
{ }
2
3
1 [ ( , , )]
( )
( )
3
cos
[ ( )( )] ( )
B G
H
B G
R G R B
S MIN R G B
R G B
R G B
I
R B G B R G
u
u
u

s

=

>

+
=
=
+ +
+ +
=
+
Chapter 6
Color Image Processing
HSI to RGB
(1 )
cos
[1 ]
cos(60 )
3 ( )
B I S
S H
R I
H
G I R B
=
= +

= +
RG Sector (0sH<120):
Chapter 6
Color Image Processing
HSI to RGB
120
(1 )
cos
[1 ]
cos(60 )
3 ( )
H H
R I S
S H
G I
H
B I R G
=
=
= +

= +
RG Sector (120sH<240):
Chapter 6
Color Image Processing
HSI to RGB
240
(1 )
cos
[1 ]
cos(60 )
3 ( )
H H
G I S
S H
B I
H
R I B G
=
=
= +

= +
RG Sector (240sH<360):
Chapter 6
Color Image Processing
Chapter 6
Color Image Processing
HSI component images
R,G,B
Hue
saturation
intensity
Chapter 6
Color Image Processing
Chapter 6
Color Image Processing
Example 1
Color Image
Hue Saturation Luminance
Chapter 6
Color Image Processing
Example 2
Color Image
Hue Saturation Luminance
Chapter 6
Color Image Processing
Color spaces
RGB (CIE), RnGnBn (TV - National Television Standard Comittee)
XYZ (CIE)
UVW (UCS de la CIE), U*V*W* (UCS modified by the CIE)
YUV, YIQ, YCbCr
YDbDr
DSH, HSV, HLS, IHS
Munsel colour space (cylindrical representation)
CIELuv
CIELab
SMPTE-C RGB
YES (Xerox)
Kodak Photo CD, YCC, YPbPr, ...
HSV
IHS
HSI
HLS
triangle
Yet there are many such spaces
described in books.
How does one choose which one
to use?
Chapter 6
Color Image Processing
Outline
Color fundamentals
Color models
Pseudo-color image processing
Basics of full-color image processing
Color transformations
Smoothing and sharpening

Chapter 6
Color Image Processing
Pseudo-color image processing
Assign colors to gray values based on a
specified criterion
For human visualization and interpretation of
gray-scale events
Intensity slicing
Gray level to color transformations
Chapter 6
Color Image Processing
Intensity slicing
3-D view of intensity image
Image plane
Color 1
Color 2
Chapter 6
Color Image Processing
Intensity slicing
Alternative representation of intensity slicing
Chapter 6
Color Image Processing
Application 1
X-ray image of a weld
Chapter 6
Color Image Processing
Intensity slicing
More slicing plane, more colors
Chapter 6
Color Image Processing
Application 2
8 color regions Radiation test pattern
* See the gradual gray-level changes
Chapter 6
Color Image Processing
Gray level to color transformation
Chapter 6
Color Image Processing
Application 1
Chapter 6
Color Image Processing
Combine several monochrome images
Example: multi-spectral images
Chapter 6
Color Image Processing
Rainfall statistics
Chapter 6
Color Image Processing
R
G
B
Near
Infrared
(sensitive
to biomass)
R+G+B
near-infrared+G+B
Washington D.C.
Chapter 6
Color Image Processing
Chapter 6
Color Image Processing
Outline
Color fundamentals
Color models
Pseudo-color image processing
Basics of full-color image processing
Color transformations
Smoothing and sharpening
Chapter 6
Color Image Processing
Color pixel
A pixel at (x,y) is a vector in the color space
RGB color space
(
(
(

=
) , (
) , (
) , (
) , (
y x B
y x G
y x R
y x c
c.f. gray-scale image
f(x,y) = I(x,y)
Chapter 6
Color Image Processing
Example: spatial mask
Chapter 6
Color Image Processing
Outline
Color fundamentals
Color models
Pseudo-color image processing
Basics of full-color image processing
Color transformations
Smoothing and sharpening
Chapter 6
Color Image Processing
Color transformation
Similar to gray scale transformation
g(x,y)=T[f(x,y)]
Color transformation
n i r r r T s
n i i
,..., 2 , 1 , ) ,..., , (
2 1
= =
g(x,y) f(x,y)
s
1
s
2

s
n
f
1
f
2

f
n
T
1
T
2

T
n
Chapter 6
Color Image Processing
Use which color model in color transformation?
RGB CMY(K) HSI
Theoretically, any transformation can be
performed in any color model
Practically, some operations are better suited
to specific color model
Chapter 6
Color Image Processing
Chapter 6
Color Image Processing
Example: modify intensity of a color image
Example: g(x,y)=k f(x,y), 0<k<1
HSI color space
Intensity: s
3
= k r
3
Note: transform to HSI requires complex
operations
RGB color space
For each R,G,B component: s
i
= k r
i
CMY color space
For each C,M,Y component:
s
i
= k r
i
+(1-k)
Chapter 6
Color Image Processing
I H,S
Chapter 6
Color Image Processing
Chapter 6
Color Image Processing
Implementation of color slicing
Recall the pseudo-color intensity slicing
1-D intensity
Chapter 6
Color Image Processing
Implementation of color slicing
How to take a region of colors of interest?
prototype color
Sphere region
prototype color
Cube region
Chapter 6
Color Image Processing
Application
cube
sphere
Chapter 6
Color Image Processing
Outline
Color fundamentals
Color models
Pseudo-color image processing
Basics of full-color image processing
Color transformations
Smoothing and sharpening

Chapter 6
Color Image Processing
Color image smoothing
Neighborhood processing
Chapter 6
Color Image Processing
Color image smoothing: averaging mask

e
=
xy
S y x
y x
K
y x
) , (
) , (
1
) , ( c c
Neighborhood
Centered at (x,y)
(
(
(
(
(
(
(

e
e
e
xy
xy
xy
S y x
S y x
S y x
y x B
K
y x G
K
y x R
K
y x
) , (
) , (
) , (
) , (
1
) , (
1
) , (
1
) , ( c
vector processing
per-component processing
Chapter 6
Color Image Processing
original
R
G G
H
S
I
Chapter 6
Color Image Processing
Example: 5x5 smoothing mask
RGB model
Smooth I
in HSI model
difference
Chapter 6
Color Image Processing
Example: Image Sharpening
Chapter 6
Color Image Processing
Lighting conditions
The lighting conditions of the scene have a large
effect on the colours recorded.
Image taken lit by a flash. Image taken lit by a
tungsten lamp.
Chapter 6
Color Image Processing
The following four images of the same scene were acquired under different lighting
conditions.
Lighting conditions
Chapter 6
Color Image Processing
Dealing with Lighting Changes
Knowing just the RGB values is not enough to
know everything about the image.
The R, G and B primaries used by different devices are usually
different.
For scientific work, the camera and lighting should be
calibrated.
For multimedia applications, this is more difficult to
organise:
Algorithms exist for estimating the illumination colour.

Anda mungkin juga menyukai