digital image processing chapter 6: color image processing 6 july 2005
DESCRIPTION
Digital Image Processing Chapter 6: Color Image Processing 6 July 2005. Spectrum of White Light. 1666 Sir Isaac Newton, 24 year old, discovered white light spectrum. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Electromagnetic Spectrum. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/1.jpg)
Digital Image ProcessingChapter 6:
Color Image Processing6 July 2005
![Page 2: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/2.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Spectrum of White Light Spectrum of White Light
1666 Sir Isaac Newton, 24 year old, discovered white light spectrum.
![Page 3: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/3.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Electromagnetic Spectrum Electromagnetic Spectrum
Visible light wavelength: from around 400 to 700 nm
1. For an achromatic (monochrome) light source, there is only 1 attribute to describe the quality: intensity
2. For a chromatic light source, there are 3 attributes to describe the quality: Radiance = total amount of energy flow from a light source (Watts) Luminance = amount of energy received by an observer (lumens) Brightness = intensity
![Page 4: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/4.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Sensitivity of Cones in the Human Eye Sensitivity of Cones in the Human Eye
6-7 millions conesin a human eye - 65% sensitive to Red light - 33% sensitive to Green light - 2 % sensitive to Blue light
Primary colors:Defined CIE in 1931 Red = 700 nm Green = 546.1nm Blue = 435.8 nm
CIE = Commission Internationale de l’Eclairage(The International Commission on Illumination)
![Page 5: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/5.jpg)
Primary and Secondary Colors Primary and Secondary Colors
Primarycolor
Primarycolor
Primarycolor
Secondarycolors
![Page 6: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/6.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Primary and Secondary Colors (cont.) Primary and Secondary Colors (cont.)
Additive primary colors: RGBuse in the case of light sourcessuch as color monitors
Subtractive primary colors: CMYuse in the case of pigments inprinting devices
RGB add together to get white
White subtracted by CMY to getBlack
![Page 7: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/7.jpg)
Hue: dominant color corresponding to a dominant wavelength of mixture light wave
Saturation: Relative purity or amount of white light mixedwith a hue (inversely proportional to amount of whitelight added)
Brightness: Intensity
Color Characterization Color Characterization
Hue
SaturationChromaticity
amount of red (X), green (Y) and blue (Z) to form any particularcolor is called tristimulus.
![Page 8: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/8.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
CIE Chromaticity Diagram CIE Chromaticity Diagram
Trichromatic coefficients:
ZYXXx
ZYXYy
ZYXZz
1 zyx
x
y
Points on the boundary arefully saturated colors
![Page 9: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/9.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Color Gamut of Color Monitors and Printing Devices Color Gamut of Color Monitors and Printing Devices
Color Monitors
Printing devices
![Page 10: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/10.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
RGB Color Model RGB Color Model Purpose of color models: to facilitate the specification of colors in some standard
RGB color models:- based on cartesian coordinate system
![Page 11: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/11.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
RGB Color Cube RGB Color Cube
R = 8 bitsG = 8 bitsB = 8 bits
Color depth 24 bits= 16777216 colors
Hidden faces of the cube
![Page 12: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/12.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
RGB Color Model (cont.) RGB Color Model (cont.)
Red fixed at 127
![Page 13: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/13.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Safe RGB Colors Safe RGB Colors
Safe RGB colors: a subset of RGB colors.There are 216 colors common in most operating systems.
![Page 14: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/14.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
RGB Safe-color Cube RGB Safe-color Cube
The RGB Cube is divided into6 intervals on each axis to achievethe total 63 = 216 common colors. However, for 8 bit color representation, there are the total256 colors. Therefore, the remaining40 colors are left to OS.
![Page 15: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/15.jpg)
CMY and CMYK Color Models CMY and CMYK Color Models
BGR
YMC
111
C = CyanM = MagentaY = YellowK = Black
![Page 16: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/16.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
HSI Color Model HSI Color Model RGB, CMY models are not good for human interpreting
HSI Color model:Hue: Dominant color
Saturation: Relative purity (inversely proportional to amount of white light added)
Intensity: Brightness
Color carryinginformation
![Page 17: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/17.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Relationship Between RGB and HSI Color Models Relationship Between RGB and HSI Color Models
RGB HSI
![Page 18: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/18.jpg)
Hue and Saturation on Color Planes Hue and Saturation on Color Planes
1. A dot is the plane is an arbitrary color2. Hue is an angle from a red axis.3. Saturation is a distance to the point.
![Page 19: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/19.jpg)
HSI Color Model (cont.) HSI Color Model (cont.)
Intensity is given by a position on the vertical axis.
![Page 20: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/20.jpg)
HSI Color Model HSI Color Model
Intensity is given by a position on the vertical axis.
![Page 21: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/21.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Example: HSI Components of RGB CubeExample: HSI Components of RGB Cube
Hue Saturation Intensity
RGB Cube
![Page 22: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/22.jpg)
Converting Colors from RGB to HSI Converting Colors from RGB to HSI
GBGB
H if 360 if
2/12
1
))(()(
)()(21
cosBGBRGR
BRGR
BGRS
31
)(31 BGRI
![Page 23: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/23.jpg)
Converting Colors from HSI to RGB Converting Colors from HSI to RGB
)1( SIB
)60cos(
cos1H
HSIR
)(1 BRG
RG sector: 1200 H GB sector: 240120 H
)1( SIR
)60cos(
cos1H
HSIG
)(1 GRB
)1( SIG
)60cos(
cos1H
HSIB
)(1 BGR
BR sector: 360240 H
120HH
240HH
![Page 24: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/24.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Example: HSI Components of RGB ColorsExample: HSI Components of RGB Colors
Hue
Saturation Intensity
RGBImage
![Page 25: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/25.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Example: Manipulating HSI Components Example: Manipulating HSI Components
Hue
Saturation Intensity
RGBImage Hue Saturation
Intensity RGBImage
![Page 26: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/26.jpg)
Color Image Processing Color Image Processing
There are 2 types of color image processes
1. Pseudocolor image process: Assigning colors to gray values based on a specific criterion. Gray scale images to be processedmay be a single image or multiple images such as multispectral images
2. Full color image process: The process to manipulate realcolor images such as color photographs.
![Page 27: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/27.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Pseudocolor Image Processing Pseudocolor Image Processing
Why we need to assign colors to gray scale image?
Answer: Human can distinguish different colors better than differentshades of gray.
Pseudo color = false color : In some case there is no “color” conceptfor a gray scale image but we can assign “false” colors to an image.
![Page 28: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/28.jpg)
Intensity Slicing or Density Slicing Intensity Slicing or Density Slicing
TyxfCTyxfC
yxg),( if ),( if
),(2
1
Formula:C1 = Color No. 1C2 = Color No. 2
T
Intensity
Col
or
C1
C2
T0 L-1
A gray scale image viewed as a 3D surface.
![Page 29: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/29.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Intensity Slicing Example Intensity Slicing Example
An X-ray image of a weld with cracks
After assigning a yellow color to pixels withvalue 255 and a blue color to all other pixels.
![Page 30: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/30.jpg)
Multi Level Intensity Slicing Multi Level Intensity Slicing
kkk lyxflCyxg ),(for ),( 1
Ck = Color No. klk = Threshold level k
Intensity
Col
or
C1
C2
0 L-1l1 l2 l3 lklk-1
C3
Ck-1
Ck
![Page 31: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/31.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Multi Level Intensity Slicing Example Multi Level Intensity Slicing Example
kkk lyxflCyxg ),(for ),( 1Ck = Color No. klk = Threshold level k
An X-ray image of the PickerThyroid Phantom.
After density slicing into 8 colors
![Page 32: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/32.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Color Coding Example Color Coding Example A unique color is assigned toeach intensity value.
Gray-scale image of average monthly rainfall.
Color coded image
Color map
South America region
![Page 33: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/33.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Gray Level to Color Transformation Gray Level to Color Transformation
Assigning colors to gray levels based on specific mapping functions
Red component
Green component
Blue component
Gray scale image
![Page 34: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/34.jpg)
(Images from Rafael C.Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Gray Level to Color Transformation Example Gray Level to Color Transformation Example An X-ray image of a garment bag with a simulated explosivedevice
An X-ray image of a garment bag
Color codedimages
Transformations
![Page 35: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/35.jpg)
(Images from Rafael C.Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Gray Level to Color Transformation Example Gray Level to Color Transformation Example An X-ray image of a garment bag with a simulated explosivedevice
An X-ray image of a garment bag
Color codedimages
Transformations
![Page 36: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/36.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Pseudocolor Coding Pseudocolor Coding
Used in the case where there are many monochrome images such as multispectralsatellite images.
![Page 37: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/37.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Pseudocolor Coding Example Pseudocolor Coding Example
Washington D.C. area
Visible blue= 0.45-0.52 m
Max water penetration
Visible green= 0.52-0.60 m
Measuring plant
Visible red= 0.63-0.69 m
Plant discrimination
Near infrared= 0.76-0.90 m
Biomass and shoreline mapping
1 2
3 4 Red = Green = Blue =
Color composite images
123
Red = Green = Blue =
124
![Page 38: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/38.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Pseudocolor Coding Example Pseudocolor Coding Example
Psuedocolor rendition of Jupiter moon Io
A close-up
Yellow areas = older sulfur deposits.Red areas = material ejected from
active volcanoes.
![Page 39: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/39.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Basics of Full-Color Image Processing Basics of Full-Color Image Processing 2 Methods:1. Per-color-component processing: process each component separately.2. Vector processing: treat each pixel as a vector to be processed.
Example of per-color-component processing: smoothing an imageBy smoothing each RGB component separately.
![Page 40: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/40.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Example: Example: Full-Color Image and Variouis Color Space ComponentsFull-Color Image and Variouis Color Space Components
Color image
CMYK components
RGB components
HSI components
![Page 41: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/41.jpg)
Color Transformation Color Transformation
Formulation: ),(),( yxfTyxg
f(x,y) = input color image, g(x,y) = output color imageT = operation on f over a spatial neighborhood of (x,y)
When only data at one pixel is used in the transformation, we can express the transformation as:
),,,( 21 nii rrrTs i= 1, 2, …, n
Where ri = color component of f(x,y)si = color component of g(x,y)
Use to transform colors to colors.
For RGB images, n = 3
![Page 42: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/42.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Example: Color Transformation Example: Color Transformation
),(),(),(),(),(),(
yxkryxsyxkryxsyxkryxs
BB
GG
RR
Formula for RGB:
),(),( yxkryxs II
Formula for CMY:
)1(),(),()1(),(),(
)1(),(),(
kyxkryxskyxkryxs
kyxkryxs
YY
MM
CC
Formula for HSI:
These 3 transformations givethe same results.
k = 0.7
I H,S
![Page 43: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/43.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Color Complements Color Complements
Color complement replaces each color with its opposite color in thecolor circle of the Hue component. This operation is analogous toimage negative in a gray scale image.
Color circle
![Page 44: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/44.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Color Complement Transformation Example Color Complement Transformation Example
![Page 45: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/45.jpg)
Color Slicing Transformation Color Slicing Transformation
otherwise2
if 5.01
i
njanyjj
i
r
War s
We can perform “slicing” in color space: if the color of each pixel is far from a desired color more than threshold distance, we set that color to some specific color such as gray, otherwise we keep the original color unchanged.
i= 1, 2, …, n
or
otherwise
if 5.01
20
2
i
n
jjj
i
r
Rar s
Set to gray
Keep the originalcolor
Set to gray
Keep the originalcolor
i= 1, 2, …, n
![Page 46: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/46.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Color Slicing Transformation Example Color Slicing Transformation Example
Original image
After color slicing
![Page 47: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/47.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Tonal Correction Examples Tonal Correction Examples
In these examples, only brightness and contrast are adjusted while keeping color unchanged.
This can be done byusing the same transformationfor all RGB components.
Power law transformations
Contrast enhancement
![Page 48: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/48.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Color Balancing Correction Examples Color Balancing Correction Examples
Color imbalance: primary color components in white areaare not balance. We can measure these components by using a color spectrometer.
Color balancing can beperformed by adjustingcolor components separatelyas seen in this slide.
![Page 49: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/49.jpg)
Histogram Equalization of a Full-Color Image Histogram Equalization of a Full-Color Image
Histogram equalization of a color image can be performed by adjusting color intensity uniformly while leaving color unchanged.
The HSI model is suitable for histogram equalization where only Intensity (I) component is equalized.
k
j
j
k
jjrkk
Nn
rprTs
0
0
)()(
where r and s are intensity components of input and output color image.
![Page 50: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/50.jpg)
(Images from Rafael C.Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Histogram Equalization of a Full-Color Image Histogram Equalization of a Full-Color Image
Original image
After histogram equalization
After increasing saturation component
![Page 51: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/51.jpg)
Color Image SmoothingColor Image Smoothing
2 Methods:1. Per-color-plane method: for RGB, CMY color models
Smooth each color plane using moving averaging and the combine back to RGB
2. Smooth only Intensity component of a HSI image while leavingH and S unmodified.
xy
xy
xy
xy
Syx
Syx
Syx
Syx
yxBK
yxGK
yxRK
yxK
yx
),(
),(
),(
),(
),(1
),(1
),(1
),(1),( cc
Note: 2 methods are not equivalent.
![Page 52: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/52.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Color Image Smoothing Example (cont.)Color Image Smoothing Example (cont.)
Color image Red
Green Blue
![Page 53: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/53.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Color Image Smoothing Example (cont.)Color Image Smoothing Example (cont.)
Hue Saturation Intensity
Color image
HSI Components
![Page 54: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/54.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Color Image Smoothing Example (cont.)Color Image Smoothing Example (cont.)
Smooth all RGB components Smooth only I component of HSI
(faster)
![Page 55: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/55.jpg)
Color Image Smoothing Example (cont.)Color Image Smoothing Example (cont.)
Difference between smoothed results from 2methods in the previousslide.
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
![Page 56: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/56.jpg)
Color Image SharpeningColor Image SharpeningWe can do in the same manner as color image smoothing:
1. Per-color-plane method for RGB,CMY images2. Sharpening only I component of a HSI image
Sharpening all RGB components Sharpening only I component of HSI
![Page 57: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/57.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Color Image Sharpening Example (cont.)Color Image Sharpening Example (cont.)
Difference between sharpened results from 2methods in the previousslide.
![Page 58: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/58.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Color Segmentation Color Segmentation
2 Methods:1. Segmented in HSI color space:
A thresholding function based on color information in H and S Components. We rarely use I component for color image segmentation.
2. Segmentation in RGB vector space:A thresholding function based on distance in a color vector space.
![Page 59: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/59.jpg)
Color Segmentation in HSI Color Space Color Segmentation in HSI Color Space
Hue
Saturation Intensity
Color image
1 2
3 4(Images from Rafael C.Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
![Page 60: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/60.jpg)
Color Segmentation in HSI Color Space (cont.) Color Segmentation in HSI Color Space (cont.) Product of and
5 6
7 8
52Binary thresholding of S componentwith T = 10%
Histogram of 6 Segmentation of red color pixels
Red pixels
(Images from Rafael C.Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
![Page 61: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/61.jpg)
Color Segmentation in HSI Color Space (cont.) Color Segmentation in HSI Color Space (cont.)
Color image Segmented results of red pixels
(Images from Rafael C.Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
![Page 62: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/62.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Color Segmentation in RGB Vector Space Color Segmentation in RGB Vector Space
1. Each point with (R,G,B) coordinate in the vector space represents one color.2. Segmentation is based on distance thresholding in a vector space
TyxDTyxD
yxgT
T
)),,(( if 0)),,(( if 1
),(cccc
cT = color to be segmented.c(x,y) = RGB vector at pixel (x,y).D(u,v) = distance function
![Page 63: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/63.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Example: Segmentation in RGB Vector Space Example: Segmentation in RGB Vector Space
Color image
Results of segmentation inRGB vector space with Thresholdvalue
Reference color cT to be segmentedbox thein pixel ofcolor average Tc
T = 1.25 times the SD of R,G,B valuesIn the box
![Page 64: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/64.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Gradient of a Color Image Gradient of a Color Image Since gradient is define only for a scalar image, there is no concept of gradient for a color image. We can’t compute gradient of eachcolor component and combine the results to get the gradient of a color image.
Red Green Blue
Edges
We see4 objects.
We see2 objects.
![Page 65: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/65.jpg)
Gradient of a Color Image (cont.) Gradient of a Color Image (cont.) One way to compute the maximum rate of change of a color imagewhich is close to the meaning of gradient is to use the following formula: Gradient computed in RGB color space:
21
2sin22cos)()(21)(
xyyyxxyyxx gggggF
yyxx
xy
ggg2
tan21 1
222
xB
xG
xRgxx
222
yB
yG
yRg yy
yB
xB
yG
xG
yR
xRgxy
![Page 66: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/66.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Obtained usingthe formulain the previousslide
Sum ofgradients of each color component
Originalimage
Differencebetween 2 and 3
2
3
2 3
Gradient of a Color Image Example Gradient of a Color Image Example
![Page 67: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/67.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Gradients of each color component
Red Green Blue
Gradient of a Color Image Example Gradient of a Color Image Example
![Page 68: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/68.jpg)
Noise in Color Images Noise in Color Images Noise can corrupt each color component independently.
(Images from Rafael C.Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Noise is less noticeable in a color image
AWGN2=800 AWGN
2=800
AWGN2=800
![Page 69: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/69.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Noise in Color Images Noise in Color Images
Hue Saturation Intensity
![Page 70: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/70.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Noise in Color Images Noise in Color Images
Hue
Saturation Intensity
Salt & pepper noisein Green component
![Page 71: Digital Image Processing Chapter 6: Color Image Processing 6 July 2005](https://reader036.vdocuments.us/reader036/viewer/2022062400/5681580f550346895dc57ca9/html5/thumbnails/71.jpg)
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Color Image Compression Color Image Compression
JPEG2000 File
Original image
After lossy compression with ratio 230:1