digital image processing chapter 6: color image processing 6 july 2005 digital image processing...
Embed Size (px)
TRANSCRIPT
-
Digital Image ProcessingChapter 6: Color Image Processing6 July 2005
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.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, 2nd Edition.Electromagnetic Spectrum Visible light wavelength: from around 400 to 700 nm1. 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
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.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 lightPrimary colors:Defined CIE in 1931 Red = 700 nm Green = 546.1nm Blue = 435.8 nmCIE = Commission Internationale de lEclairage(The International Commission on Illumination)
-
Primary and Secondary Colors PrimarycolorPrimarycolorPrimarycolorSecondarycolors
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Primary and Secondary Colors (cont.) Additive primary colors: RGBuse in the case of light sourcessuch as color monitorsSubtractive primary colors: CMYuse in the case of pigments inprinting devices RGB add together to get whiteWhite subtracted by CMY to getBlack
-
Hue:dominant color corresponding to a dominant wavelength of mixture light waveSaturation:Relative purity or amount of white light mixedwith a hue (inversely proportional to amount of whitelight added)Brightness: IntensityColor Characterization Hue
SaturationChromaticityamount of red (X), green (Y) and blue (Z) to form any particularcolor is called tristimulus.
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.CIE Chromaticity Diagram Trichromatic coefficients:xyPoints on the boundary arefully saturated colors
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Color Gamut of Color Monitors and Printing Devices Color MonitorsPrinting devices
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.RGB Color Model Purpose of color models: to facilitate the specification of colors in some standardRGB color models: based on cartesian coordinate system
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.RGB Color Cube R = 8 bitsG = 8 bitsB = 8 bitsColor depth 24 bits= 16777216 colorsHidden faces of the cube
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.RGB Color Model (cont.) Red fixed at 127
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Safe RGB Colors Safe RGB colors: a subset of RGB colors.There are 216 colors common in most operating systems.
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.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.
-
CMY and CMYK Color Models C = CyanM = MagentaY = YellowK = Black
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.HSI Color Model RGB, CMY models are not good for human interpretingHSI Color model:Hue: Dominant color
Saturation: Relative purity (inversely proportional to amount of white light added)
Intensity: BrightnessColor carryinginformation
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Relationship Between RGB and HSI Color Models RGBHSI
-
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.
-
HSI Color Model (cont.) Intensity is given by a position on the vertical axis.
-
HSI Color Model Intensity is given by a position on the vertical axis.
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Example: HSI Components of RGB CubeHueSaturationIntensityRGB Cube
-
Converting Colors from RGB to HSI
-
Converting Colors from HSI to RGB RG sector:GB sector:BR sector:
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Example: HSI Components of RGB ColorsHueSaturationIntensityRGBImage
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Example: Manipulating HSI Components HueSaturationIntensityRGBImageHueSaturationIntensityRGBImage
-
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.
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.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.
-
Intensity Slicing or Density Slicing Formula:C1 = Color No. 1C2 = Color No. 2TIntensityColorC1C2T0L-1A gray scale image viewed as a 3D surface.
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.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.
-
Multi Level Intensity Slicing Ck = Color No. klk = Threshold level kIntensityColorC1C20L-1l1l2l3lklk-1C3Ck-1Ck
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Multi Level Intensity Slicing Example Ck = Color No. klk = Threshold level kAn X-ray image of the PickerThyroid Phantom.After density slicing into 8 colors
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Color Coding Example A unique color is assigned toeach intensity value.Gray-scale image of average monthly rainfall.Color coded imageColor mapSouth America region
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Gray Level to Color Transformation Assigning colors to gray levels based on specific mapping functionsRed componentGreen componentBlue componentGray scale image
-
(Images from Rafael C.Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Gray Level to Color Transformation Example An X-ray image of a garment bag with a simulated explosivedeviceAn X-ray image of a garment bagColor codedimagesTransformations
-
(Images from Rafael C.Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Gray Level to Color Transformation Example An X-ray image of a garment bag with a simulated explosivedeviceAn X-ray image of a garment bagColor codedimagesTransformations
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Pseudocolor Coding Used in the case where there are many monochrome images such as multispectralsatellite images.
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Pseudocolor Coding Example Washington D.C. areaVisible blue= 0.45-0.52 mmMax water penetrationVisible green= 0.52-0.60 mmMeasuring plantVisible red= 0.63-0.69 mmPlant discriminationNear infrared= 0.76-0.90 mmBiomass and shoreline mapping1234Red = Green = Blue = Color composite images123Red = Green = Blue = 124
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Pseudocolor Coding Example Psuedocolor rendition of Jupiter moon IoA close-upYellow areas = older sulfur deposits.Red areas = material ejected from active volcanoes.
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.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.
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Example: Full-Color Image and Variouis Color Space Components Color imageCMYK componentsRGB componentsHSI components
-
Color Transformation Formulation: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:i= 1, 2, , nWhere 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
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Example: Color Transformation Formula for RGB:Formula for CMY:Formula for HSI:These 3 transformations givethe same results.k = 0.7IH,S
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.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
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Color Complement Transformation Example
-
Color Slicing Transformation 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, , norSet to grayKeep the originalcolorSet to grayKeep the originalcolori= 1, 2, , n
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Color Slicing Transformation Example Original imageAfter color slicing
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.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 transformationsContrast enhancement
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.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.
-
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. where r and s are intensity components of input and output color image.
-
(Images from Rafael C.Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Histogram Equalization of a Full-Color Image Original imageAfter histogram equalizationAfter increasing saturation component
-
Color Image Smoothing2 Methods:Per-color-plane method: for RGB, CMY color modelsSmooth each color plane using moving averaging and the combine back to RGB
Smooth only Intensity component of a HSI image while leavingH and S unmodified.Note: 2 methods are not equivalent.
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Color Image Smoothing Example (cont.)Color imageRedGreenBlue
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Color Image Smoothing Example (cont.)HueSaturationIntensityColor imageHSI Components
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Color Image Smoothing Example (cont.)Smooth all RGB componentsSmooth only I component of HSI(faster)
-
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.
-
Color 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 imageSharpening all RGB componentsSharpening only I component of HSI
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Color Image Sharpening Example (cont.)Difference between sharpened results from 2methods in the previousslide.
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Color Segmentation 2 Methods: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. Segmentation in RGB vector space:A thresholding function based on distance in a color vector space.
-
Color Segmentation in HSI Color Space HueSaturationIntensityColor image1234(Images from Rafael C.Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
-
Color Segmentation in HSI Color Space (cont.) Product of and 567852Binary thresholding of S componentwith T = 10%Histogram of6Segmentation of red color pixelsRed pixels(Images from Rafael C.Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
-
Color Segmentation in HSI Color Space (cont.) Color imageSegmented results of red pixels(Images from Rafael C.Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.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 spacecT = color to be segmented.c(x,y) = RGB vector at pixel (x,y).D(u,v) = distance function
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Example: Segmentation in RGB Vector Space Color imageResults of segmentation inRGB vector space with ThresholdvalueReference color cT to be segmentedT = 1.25 times the SD of R,G,B valuesIn the box
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.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 cant compute gradient of eachcolor component and combine the results to get the gradient of a color image.RedGreenBlueEdgesWe see4 objects.We see2 objects.
-
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:
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Obtained usingthe formulain the previousslideSum ofgradients of each color componentOriginalimageDifferencebetween 2 and 32323Gradient of a Color Image Example
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Gradients of each color componentRedGreenBlueGradient of a Color Image Example
-
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 imageAWGN sh2=800AWGN sh2=800AWGN sh2=800
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Noise in Color Images HueSaturationIntensity
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Noise in Color Images HueSaturationIntensitySalt & pepper noisein Green component
-
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.Color Image Compression JPEG2000 FileOriginal imageAfter lossy compression with ratio 230:1