Download presentation
Presentation is loading. Please wait.
Published byDominick Ward Modified over 9 years ago
1
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 6 Color Image Processing Chapter 6 Color Image Processing In automated image analysis, color is a powerful descriptor, which simplifies object identification and extraction. The human eye can distinguish between thousands of color shades and intensities but only about 20-30 shades of gray. Hence, use of color in human image processing would be very effective. Color image processing consists of two parts: Pseudo-color processing and Full color processing. In pseudo-color processing, (false) colors are assigned to a monochrome image. For example, objects with different intensity values maybe assigned different colors, which would enable easy identification/recognition by humans. In full-color processing, images are acquired with full color sensors/cameras. This has become common in the last decade or so, due to the easy and cheap availability of color sensors and hardware.
2
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 6 Color Image Processing Chapter 6 Color Image Processing When a beam of sunlight is passed through a glass prism, the emerging beam of light is not white but consists of a continuous spectrum of colors (Sir Isaac Newton, 1666). The color spectrum can be divided into six broad regions: violet, blue, green, yellow, orange, and red.
3
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Color Fundamentals The different colors in the spectrum do not end abruptly but each color blends smoothly into the next. Color perceived by the human eye depends on the nature of light reflected by an object. Light that is relatively balanced in all visible wavelengths is perceived as white.
4
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Color Fundamentals Characterization of light is important for the understanding of color. If the light is achromatic (devoid of color), its only attribute is its intensity (amount of light). This is what we have been dealing with so far. The term graylevel refers to the scalar measure of the intensity of light --- black to grays to white. Chromatic light spans the electromagnetic (EM) spectrum from approximately 400 nm to 700 nm. Three basic quantities are used to describe the quality of a chromatic source of light: –Radiance is the total amount of light that flows from a light source (measured in Watts). –Luminance gives a measure of the amount of energy an observer perceives from a light source (measured in lumens). –Brightness is a subjective descriptor that is impossible to measure.
5
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Color Fundamentals Cones in the retina are responsible for color perception in the human eye. Six to seven million cones in the human eye can be divided into three categories: red light sensitive cones (65%), green light sensitive cones (33%) and blue light sensitive cones (2%). The combination of the responses of these different receptors gives us our color perception This is called the tri-stimulus model of color vision
6
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 6 Color Image Processing Chapter 6 Color Image Processing Due to the absorption characteristics of the human eye, all colors perceived by the human can be considered as a variable combination of the so called three primary colors: Red (R) (700 nm) Green (G) (546.1 nm) Blue (B) (435.8 nm) Note that the specific color wavelengths are used mainly for standardization. Primary colors when added produce secondary colors: Magenta (red + blue) Cyan (green + blue) Yellow (red + green)
7
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods 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. Additive vs. Subtractive Color Systems
8
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Color Space Color space: A 3-dimensional coordinate system for specifying color A color is specified as a single point in the color space Commonly Used Color Space: –RGB (Red, Green, Blue) used for screen displays (e.g. monitor) –CMYK (Cyan, Magenta, Yellow, Black) used for printing –HSI (Hue, Saturation, Intensity) used for manipulation of color components –L*a*b*, L*u*v* (“perceptual” color spaces) distances in color space correspond to distances in human color perception
9
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Color Terms Hue - dominant wavelength e.g. Red roses, green traffic light Saturation - relative purity; amount of white light mixed e.g. Bright orange, pink milk Chromaticity - Hue and Saturation taken together Intensity (brightness) - amount of achromatic light - light apart from color - gray level; B & W Tristimulus values - amount of red, green and blue to form a particular color Color gamut - range of colors
10
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods CIE XYZ CIE: International Commission on Illumination Not the same as RGB and not tied to hardware Describes the entire visible gamut –Two chromaticity (similar to hue or color) values: X and Z –One luminous efficiency (similar to intensity) value: Y Provides a standard for sharing color information between disciplines –Computer graphics and fabric design
11
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods CIE XYZ -The amount of R, G, B needed from any particular color( or tristimulus values) : X, Y, Z -Trichromatic coefficients (or Normalized CIE primaries): x,y,z -On the plane x + y + z = 1, every point can be characterized by unique x and y (z = 1 – x – y). Plotting on this plane the color of each wavelength gives the CIE chromaticity diagram
12
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods CIE Chromaticity Diagram Specifying color in the absence of brightness Y (green) X (red) 0.8 0.9 0 Fully saturated (or pure) colors Mixture of the pure colors Z(blue)= 1-X-Y As you go deeper, become less saturated
13
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Given two colors A and B, the colors along the line AB can be reproduced by mixing different amounts of A and B Specifying color using the CIE Chromaticity Diagram A B -The color along the line can be reproduced by mixing different amount of A and B -A color gamut (or range) can be specified by mixing a, b, c in different amounts a c b
14
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 6 Color Image Processing Chapter 6 Color Image Processing -Triangle shows a typical range of colors(color gamut) produced by RGB monitor - The irregular regions is the representative of the color gamut of today’s high quality color printing devices.
15
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods RGB Space 24bit color cube composed of 256x256x256=16,777,216 colors
16
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods RGB Space When light is mixed, wavelengths combine (add) The Red-Green-Blue (RGB) model is used most often for additive models. Additive to produce other colors Can’t produce all visible colors Perfect for imaging since hardware uses three color phosphors
17
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Paint/ink/dye subtracts color from white light and reflects the rest Mixing paint pigments subtracts multiple colors The Cyan-Magenta-Yellow (CMY) model is the most common subtractive model –Same as RGB except white is at the origin and black is at the extent of the diagonal Very important for printing devices –Already white so we can’t add to it!! CMY Model
18
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods White minus Blue minus Green = Red CMY Model
19
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods The intensity component (I) is decoupled from the color components (H and S) –Ideal for developing image processing algorithms H and S are closely related to the way human visual system perceives colors HSI allows us to separate intensity and chromaticity color is decomposed HSI Model
20
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Hue and Saturation
21
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods HIS Color Space
22
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods RGB-to-HIS Conversion
23
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods For 0 o <= H < 120 o For 120 o <= H < 240 o For 240 o <= H < 360 o HSI-to-RGB Conversion
24
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods HIS Components of Image
25
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Image Saturation Hue Intensity Saturation
26
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Image Intensity Hue Saturation
27
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 6 Color Image Processing Chapter 6 Color Image Processing
28
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Color Image Processing
29
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Pseudo-color image processing –Assign color to monochrome images –Intensity slicing –Gray level to color transformation Spatial domain approach – three different transformation functions Frequency domain approach – three different filters Full-color image processing –Color image enhancement and restoration –Color compensation Color Image Processing
30
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Pseudo-color Processing Intensity Slicing Pseudo-color Processing Intensity Slicing
31
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Pseudo-color Processing Intensity Slicing 0 L c1 c2 Ii
32
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Pseudo-color Processing Intensity Slicing
33
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Pseudo-color Processing Intensity Slicing
34
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Gray Level to Color Transformation – Spatial Domain Perform three independent transformations on the gray level of any input pixel. The three results can then serve as the red, green, and blue components of a color image
35
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Pseudo-color Processing Gray Level to color Transform Pseudo-color Processing Gray Level to color Transform
36
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Pseudo-color coding when several monochrome images are available. Pseudo-color coding when several monochrome images are available. Visible R,G,B: (a)-(c), IR: (d)
37
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Pseudo-color Image Processing By understanding the physical and chemical processes likely affect sensor response, we can create a meaningful pseudo-color image from sensed image data.
38
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Category 1: Process each components image individually and form a composite processed color image from the processed components Category 2: Process a color pixel directly by treating a pixel as a vector with three components. Basics of Full-Color Image Processing Input image (RGB) H S I Output image (RGB) H*S*S* I* Decompose Modify Convert back cR(x,y) R(x,y) c(x,y) = cG(x,y) = G(x,y) cB(x,y) B(x,y)
39
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods HSI modification vs. RGB modification HSI color model allows separation of a color into its components separate modification of each component Requires the overhead of transforming RGB HSI, HSI RGB Intensity modification while maintaining Hue and Saturation can be achieved by simultaneous scaling of R, G, B components (proof) no need to go through HSI
40
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Changing Intensity without Affecting Hue and Saturation Objective: Intensity1 Intensity2 Which can be:Intensity1 a * Intensity1 Equivalent to: R a * R R,G,B: [0..1] G a * G a : scaling factor > 0 B a * B While maintaining Hue and Saturation: Hue( a * R, a * G, a * B) = Hue(R,G,B) Sat( a * R, a * G, a * B ) = Sat(R,G,B)
41
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Color Transformations g(x,y) = T[f(x,y)] S i = T i (r 1, r 2, …, r n ),, where r i, and s i are variables denoting the color components of f(x,y) and g(x,y) Modify the intensity by g(x,y) = kf(x,y) HIS: s 3 =kr 3, s 1 =k 1, s 2 =r 2 RGB: s i =kr i, i=1,2,3 CMY: s i =kr j +(1-k), i=1,2,3
42
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Chapter 6 Color Image Processing Chapter 6 Color Image Processing
43
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Complements on the color circle Hue Plane Analogous to the gray-scale negative
44
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Color complements
45
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Color Slicing Equation 6.5-7 Equation 6.5-8
46
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Tone and color corrections –Calibrate images using the CIELAB model (L*a*b* model) Point-based processing Tone and color correction
47
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Color Gamut of Color Monitor and Color Printing
48
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods CIELAB (L*a*b* Color Model) Maintain a high degree of color consistency between the monitors used and the eventual output devices Device-independent color model that relates the color gamuts of the monitors and output devices The CIELAB gamut encompasses the entire visible spectrum and can represent accurately the colors of any display, print, or input device
49
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Tonal Correction Example Color is not changed (RGB or I)
50
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Histogram Processing
51
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Mask-based Processing Per-image basis vs. direct operation on color vector space
52
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Color Image Smoothing
53
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Color Image Sharpening
54
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Segmentation in HIS Color Space
55
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Example: Simple red-eye removal using HSI segmentation Red eye caused by camera flash reflecting on blood vessels at the back of the eye How do you define Red for this application? - Pi / 4 < Hue < Pi / 4 Saturation > 0.3 Algorithm: Define the area where the face is Convert RGB HSI Test each pixel if - pi / 4 0.3 If pixel is “Red”, make it gray: Saturation 0
56
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Results
57
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Segmentation in RGB vector space - Classify each RGB pixel as having a color in the specified range or not. - If satisfy D(a,z) ≤ D 0, then classify pixel with the color z as a part of an object. - Distance D(a,z) : a)D(a,z) = || z – a || = [ (z-a) T (z-a)] 1/2 b)D(a,z) = || z – a || = [ (z-a) T C -1 (z-a)] 1/2, where C is the covariance matrix of the samples representative of the color we wish to segment. c)Bounding box
58
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Skin Color Modeling Why is it difficult to model skin color? Race Brightness of light source Color of light source Applications of skin color modelling? Content-based filtering of web images Detection of people - recognition of faces, surveillance Human-computer interaction
59
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Example: Detection of skin using RGB segmentation Define a small region on the image which corresponds to skin Using the pixels in the region, compute a volume within RGB color space which describes skin Test each pixel within the image (or in another image). If the RGB of a pixel falls within the computed volume, then it is tagged as “skin”.
60
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Example...
61
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Example
62
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Color Edge Detection Processing the three individual planes to form a composite gradient image can yield erroneous results.
63
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Color Edge Detection
64
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Color Edge Detection
65
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Noise in Color Image
66
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Noise in Color Image
67
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Noise In Color Image
68
Digital Image Processing, 2nd ed. www.imageprocessingbook.com © 2002 R. C. Gonzalez & R. E. Woods Color Image compression
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.