Digital Image Processing Color Models &Processing
Transcript of Digital Image Processing Color Models &Processing
![Page 1: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/1.jpg)
Digital Image Processing
Color Models &Processing
Dr. Hatem Elaydi Electrical Engineering Department
Islamic University of Gaza
Fall 2015
Nov 16, 2015
![Page 2: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/2.jpg)
2
• Color interpretation
– Color spectrum vs. electromagnetic spectrum
– Why does CIE standard specify R, G, B as the primary colors? Are there actually single special band as R, G, or B?
– What is additive color system? What is subtractive color system?
– What is hue and saturation? or what is chromaticity?
– What is chromaticity diagram? tristimulus? Why can't the three primary colors generate all the visible colors specified in the diagram? Where is brown?
– Comment on the different usages of RGB, CMYK, HSI, and L*a*b* color models. What is the color gamut of color monitors, color printing devices, and L*a*b*?
• Color processing
– What is the difference between tonal and color correction?
– What is the difference between processing using RGB model vs. HSI model?
![Page 3: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/3.jpg)
3
Color spectrum
When passing through a prism, a beam of sunlight
is decomposed into a spectrum of colors: violet,
blue, green, yellow, orange, red
1666, Sir Isaac Newton
![Page 4: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/4.jpg)
4
Electromagnetic energy spectrum
Ultraviolet visible light infrared
The longer the wavelength (meter), the lower the frequency (Hz),
and the lower the energy (electron volts)
The discovery of infrared (1800, Sir Frederick William Herschel)
What is infrared? http://coolcosmos.ipac.caltech.edu/cosmic_classroom/ir_tutorial/
![Page 5: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/5.jpg)
5
A typical spectral reflectance pattern
of green vegetation
![Page 6: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/6.jpg)
6
Primary colors of human vision
Cones are divided into three sensible categories
– 65% of cones are sensitive to red light
– 33% are sensitive to green light
– 2% are sensitive to blue light
For this reason, red, green, and blue are referred to as the primary colors of human vision. CIE standard designated three specific wavelength to these three colors in 1931.
– Red (R) = 700 nm
– Green (G) = 546.1 nm
– Blue (B) = 435.8 nm
Detailed experimental
Curve available in 1965
Detailed experimental
curve available in 1965
![Page 7: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/7.jpg)
7
Color models
• RGB model
– Color monitor, color video cameras
• CMY model
– Color printers
• HIS, HSV model
– Color image manipulation
• YIQ : Color TV, Y(luminance), I(Inphase),
Q(quadrature)
![Page 8: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/8.jpg)
CIE Standard
• CIE: International Commission on
Illumination (Comission Internationale de
l’Eclairage).
• Human perception based standard (1931),
established with color matching experiment
• Standard observer: a composite of a group
of 15 to 20 people
![Page 9: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/9.jpg)
CIE xyY Space • Irregular 3D volume shape is
difficult to understand
• Chromaticity diagram (the same
color of the varying intensity, Y,
should all end up at the same
point)
![Page 10: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/10.jpg)
Color Image Processing
• RGB Model
• Pixel depth – nr of bits used to represent
each pixel
– Full color image (24 bits)
![Page 11: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/11.jpg)
11
Primary colors of pigment
A primary color of pigment refers to one that absorbs the primary color of the light, but reflects the other two.
Primary color of pigments are magenta, cyan, and yellow
Secondary color of pigments are then red, green, and blue
![Page 12: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/12.jpg)
12
Additive vs. Subtractive color
system involves light emitted directly
from a source
mixes various amounts of red,
green and blue light to produce
other colors.
Combining one of these
additive primary colors with
another produces the additive
secondary colors cyan,
magenta, yellow.
Combining all three primary
colors produces white.
Subtractive color starts with an
object that reflects light and
uses colorants to subtract
portions of the white light
illuminating an object to
produce other colors.
If an object reflects all the
white light back to the viewer,
it appears white.
If an object absorbs (subtracts)
all the light illuminating it, it
appears black.
![Page 13: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/13.jpg)
13
Color characterization
Brightness: chromatic notion of intensity
Hue: dominant color perceived by an observer
Saturation: relative purity or the amount of
white mixed with a hue
R
G
B
H S
0o
120o
240o
![Page 14: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/14.jpg)
Color Image Processing
• CMY Model
– Color Printer, Color Copier
– RGB data CMY
B
G
R
Y
M
C
1
1
1
B
G
R
Q
I
Y
311.0523.0212.0
321.0275.0596.0
114.0587.0299.0
Q
I
Y
B
G
R
705.1108.11
647.0272.01
620.0956.01
![Page 15: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/15.jpg)
The HSI Color Model This color model is based on polar coordinates, not
Cartesian coordinates.
The HSI model uses three measures to describe colors:
– Hue: A color attribute that describes a pure color
(pure yellow, orange or red)
– Saturation: Gives a measure of how much a pure
color is diluted with white light
– Intensity: Brightness is nearly impossible to measure
because it is so subjective. Instead we use intensity.
Intensity is the same achromatic notion that we have
seen in grey level images
![Page 16: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/16.jpg)
Color Image Processing
![Page 17: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/17.jpg)
The HSI Color Model Because the only important things are the angle and
the length of the saturation vector this plane is also
often represented as a circle or a triangle
![Page 18: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/18.jpg)
HSV Hexcone
• Intuitive interface to color
![Page 19: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/19.jpg)
RGB -> HSI -> RGB
RGB
Image
Saturation
Hue
Intensity
![Page 20: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/20.jpg)
RGB -> HSI -> RGB
Hue
Intensity
Saturation
RGB
Image
![Page 21: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/21.jpg)
Color Image Processing
• RGB to HSI Conversion
1,,,0 where),(3
1 BGRIBGRI
002
1 if },))(()(
)]()[(2
1
{cos bgBGBRGR
BRGR
H
00 if ,360 bgHH
}),,(min{3
1 BGRBGR
S
IBbIGg / ,/ where 00
![Page 22: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/22.jpg)
Color Image Processing
• HSI to RGB Conversion
BRG
H
HSR
SB
1
])60cos(
cos1[
3
1
)1(3
1
1200 assume H
![Page 23: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/23.jpg)
23
HSI-to-RGB conversion …
For 120o <= H < 240o
For 240o <= H < 360o
( )( )
( ) GRIBSIRH
HSIG --=-=ú
û
ùêë
é
-
-+= ,1,
180cos
120cos1
( )( )
( ) BGIRSIGH
HSIB --=-=ú
û
ùêë
é
-
-+= ,1,
300cos
240cos1
![Page 24: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/24.jpg)
Chromatic images
• Colour
– Represented by vector not scalar
• Red, Green, Blue (RGB)
• Hue, Saturation, Value (HSV)
• luminance, chrominance (Yuv , Luv)
Red
Green
Hue degrees:
Red, 0 deg
Green 120 deg
Blue 240 deg
Green
V=0
S=0
![Page 25: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/25.jpg)
Lab: Photoshop
• Photoshop uses this model to get
more control over color
• It’s named CIE Lab model (refined
from the original CIE model
• Liminance: L
• Chrominance: a – ranges from green
to red and b ranges from blue to
yellow
![Page 26: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/26.jpg)
Luv and UVW • A color model for which, a unit change in luminance and
chrominance are uniformly perceptible U = 13 W* (u - uo ); V = 13 W* (v - vo); W = 25 ( 100 Y ) 1/3 - 17
where Y , u and v can be calculated from :
X = O.607 Rn + 0.174 Gn + 0.200Bn
Y = 0.299 Rn + 0.587 Gn + 0.114Bn
Z = 0.066 Gn + 1.116 Bn
x = X / ( X + Y + Z )
y = Y / ( X + Y + Z )
z = Z / ( X + Y + Z )
u = 4x / ( -2x + 12y + 3 )
v = 6y / ( -2x + 12y + 3 )
• Luv is derived from UVW and Lab, with all components guaranteed to be positive
![Page 27: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/27.jpg)
Yuv and YCrCb: digital video • Initially, for PAL analog video, it is now also used in CCIR
601 standard for digital video
• Y (luminance) is the CIE Y primary. Y = 0.299R + 0.587G + 0.114B
• Chrominance is defined as the difference between a color and a reference white at the same luminance. It can be represented by U and V -- the color differences. U = B – Y; V = R - Y
• YCrCb is a scaled and shifted version of YUV and used in JPEG and MPEG (all components are positive)
Cb = (B - Y) / 1.772 + 0.5; Cr = (R - Y) / 1.402 + 0.5
![Page 28: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/28.jpg)
Examples (RGB, HSV, Luv)
![Page 29: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/29.jpg)
Gamma correction
• Without gamma correction, how will
(0,255,127) look like?
• Normally gamma is within 1.7 and 2.8
• Who is responsible for Gamma correction?
• SGI does it for you
• PC/Mac etc, you should do it yourself
![Page 30: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/30.jpg)
No gamma correction
![Page 31: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/31.jpg)
Gamma corrected to 1.7
![Page 32: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/32.jpg)
Pseudo color Image Processing
Pseudo color (also called false color) image
processing consists of assigning colors to
grey values based on a specific criterion
The principle use of pseudo color image
processing is for human visualization
– Humans can discern between thousands
of color shades and intensities,
compared to only about two dozen or so
shades of grey
![Page 33: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/33.jpg)
Pseudo Color Image Processing –
Intensity Slicing
Intensity slicing and color coding is one of the
simplest kinds of pseudo color image processing
First we consider an image as a 3D function mapping
spatial coordinates to intensities (that we can consider
heights)
Now consider placing planes at certain levels parallel
to the coordinate plane
If a value is one side of such a plane it is rendered in
one color, and a different color if on the other side
![Page 34: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/34.jpg)
Color Image Processing
![Page 35: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/35.jpg)
Color Image Processing
![Page 36: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/36.jpg)
Color Image Processing
![Page 37: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/37.jpg)
Color Image Processing
![Page 38: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/38.jpg)
Color Image Processing
![Page 39: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/39.jpg)
Color Image Processing
![Page 40: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/40.jpg)
![Page 41: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/41.jpg)
![Page 42: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/42.jpg)
![Page 43: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/43.jpg)
![Page 44: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/44.jpg)
![Page 45: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/45.jpg)
![Page 46: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/46.jpg)
![Page 47: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/47.jpg)
![Page 48: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/48.jpg)
![Page 49: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/49.jpg)
![Page 50: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/50.jpg)
![Page 51: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/51.jpg)
![Page 52: Digital Image Processing Color Models &Processing](https://reader030.fdocuments.net/reader030/viewer/2022012803/61bd1e9f61276e740b0f8dc3/html5/thumbnails/52.jpg)