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

Ch6 Color Image Processing

The document discusses color image processing. It describes why color is useful for image processing, different color models like RGB, CMYK and HSI. It also discusses concepts like color fundamentals, color spaces, color transformations and pseudo-color image processing.

Uploaded by

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

Ch6 Color Image Processing

The document discusses color image processing. It describes why color is useful for image processing, different color models like RGB, CMYK and HSI. It also discusses concepts like color fundamentals, color spaces, color transformations and pseudo-color image processing.

Uploaded by

abdoag1691998
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Color Image Processing

Why use color in image processing?


◼ When color is available, it gives much more information
about an image than intensity alone.
◼ Color is very useful for recognition of objects in an image
both for humans and computers.
◼ Color is a powerful descriptor
◼ Object identification and extraction. e.g., Face
detection using skin colors
•Humans can discern
thousands of color shades
and only two dozen shades
of grays
Category of 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
Color fundamentals
◼ The actual color perceived by a human of an object
depends on both the color of the illumination and the
reflectivity of the object, as well as the sensitivity of human
perception.
◼ Objects appear to be different colors because they absorb
and reflect different colors of light. A blue object, for
example, reflects blue light while absorbing other colors.
◼ Grey objects or grey images reflect and absorb all
frequencies of light about equally, so they do not appear
colored.
Color fundamentals
◼ Color is sensed by the eye using three kinds of cones, each
sensitive primarily to red, green or blue, though there is
significant overlap.
◼ We refer to red, green and blue as the primary colors, and
denote to set as RGB.
Color fundamentals
◼ Physical phenomenon
◼ Physical nature of color is known

◼ socio-psychological phenomenon
◼ How human brain perceive and interpret color?
Visible light
◼ Chromatic light span the electromagnetic
spectrum (EM) from 400 to 700 nm
Color fundamentals (cont.)
◼ The color that human perceive in an object
= the light reflected from the object

scene
Illumination source

reflection
eye
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
How human eyes sense light?
◼ Color is sensed by the eye using three kinds of cones,
each sensitive primarily to red, green or blue, though
there is significant overlap.
◼ 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%
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
◼ Secondary colors: G+B=Cyan, R+G=Yellow,
R+B=Magenta
Primary colors of light v.s.
primary colors of pigments

◼ Primary color of pigments


◼ Color that subtracts or absorbs a primary color
of light and reflects or transmits the other two

Color of light: R G B

Color of pigments: absorb R absorb G absorb B


Cyan Magenta Yellow
Application of additive nature of light
colors
◼ Color TV
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
Suitable for hardware or
◼ CYM model applications
◼ CYMK model
◼ HSI model - match the human description
RGB color model
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)
CMY model (+Black = CMYK)
◼ CMY: secondary colors of light, or primary
colors of pigments

 C  1  R 
 M  = 1 − G 
    
 Y  1  B 
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: associated with the dominant wavelength in a
mixture of light waves. When we call an object red,
orange, or yellow, we are specify its Hue.
◼ Saturation: refers to the relative purity or the amount
of white light mixed with Hue
◼ Brightness: achromatic notion of intensity
HSI color model (cont.)
◼ RGB -> HSI model Colors on this triangle
Have the same hue
Intensity
line
saturation
HSI model: hue and saturation
HSI model
HSI component images

R,G,B Hue

intensity
saturation
Converting colors from RGB to HSI

 if B  G 
2 ( R − G ) + ( R − B ) 
1 
H =  = cos −1
1 

360 −  if B  G  
 ( R − G ) 2 + ( R − B)(G − B) 2 

S = 1−
3
min( R, G, B)
( R + G + B)
1
I = ( R + G + B)
3
Converting colors from HSI to RGB

◼ RG sector ( 0o  H  120 o )

B = I (1 − S )
 S cos H 
R = I 1 + 
 cos( 60 o
− H ) 
G = 3I − ( R + B )
Converting colors from HSI to RGB

◼ GB sector ( 120 o  H  240 o )

◼ BR sector ( 240 o  H  360 o )


Image format

◼ RGB image: it is an MxNx3 array of color pixels. It


can be viewed as a stack of three gray-level
scale.
◼ Indexed image: It has two components: data
matrix of integers (x), and a color map matrix
(map) . Matrix map is an mx3 array of double in
the range [0,1], m is the number of colors. Each
row of map specifies the R, G, and B components
of a single color. Elements of x are pointers to
map matrix.
27
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
Intensity slicing
◼ The image is interpreted as a 3-D fn. (intensity versus
spatial coordinates), The method can be viewed as one of
placing planes parallel to the coordinate plane of the image.
◼ Suppose that P planes are defined at level L1,L2,…,Lp. Then,
assume that 0<p<L-1, the p planes partition the gray scale
into p+1 intervals (v1,v1,…,vp+1). Gray-level to color
assignments are made according to the relation f(x,y)=ck if
f(x,y) belongs to Vk
Where Ck is the color associated with the kth intensity Vk
defined by the partitioning planes at l=k-1 and l=k.
Intensity slicing
◼ 3-D view of intensity image

Color 1

Color 2

Image plane
Intensity slicing (cont.)
◼ Alternative representation of intensity slicing
Intensity slicing (cont.)
◼ More slicing plane, more colors
Application 1

Radiation test pattern 8 color regions

* See the gradual gray-level changes


Application 2

X-ray image of a weld


Application 3

Rainfall statistics
Gray level to color transformation
◼ The idea is to perform three independent
transformations on the gray level of any
input pixel as shown. The three results are
then fed separately into the red, green, and
blue channels of a color television monitor.
Gray level to color transformation
Full Color Image Processing
◼ Two processing methods:
◼ process each channel (or color component)
separately, as if the color image were three gray
scale images;
◼ process all channels with each pixel represented
as a vector.
Color pixel
◼ A pixel at (x,y) is a vector in the color space
◼ RGB color space

 R ( x, y ) 

c( x, y ) = G ( x, y ) 
 B( x, y ) 

c.f. gray-scale image


f(x,y) = I(x,y)
Two spatial processing categories
◼ Similar to gray scale processing studied
before
◼ Pixel-wise processing
◼ Neighborhood processing
Color transformation
◼ Similar to gray scale transformation
◼ g(x,y)=T[f(x,y)]
◼ Color transformation
si = Ti (r1 , r2 ,..., rn ) , i = 1,2,..., n
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
Example: modify intensity of a color
image

◼ Example: g(x,y)=k f(x,y), 0<k<1


◼ HSI color space
◼ Intensity: s3 = k r3

◼ Note: transform to HSI requires complex


operations
◼ RGB color space
◼ For each R,G,B component: si = k ri

◼ CMY color space


◼ For each C,M,Y component:

◼ si = k ri +(1-k)
I H,S
Color image smoothing
◼ Neighborhood processing
Color image smoothing: averaging
mask

1
c( x, y ) =
K
 c ( x, y )
( x , y )S xy
vector processing

Neighborhood
Centered at (x,y)
1 
  R ( x, y ) 
 K ( x , y )S xy 
1 
c( x, y ) =   G ( x, y ) 
per-component processing
 K ( x , y )S xy 
1 
 K  B ( x, y ) 
 ( x , y )S xy 
Matlab commands
Matlab commands
Spatial filtering of color images in Matlab

You might also like