Digital Image Processing Color Models &Processing Dr. Hatem Elaydi Electrical Engineering Department Islamic University of Gaza Fall 2015 Nov 16, 2015
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? 2
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 3
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/ 4
A typical spectral reflectance pattern of green vegetation 5
Primary colors of human vision Detailed experimental curve Curve available in in 1965 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 6
RGB model Color models Color monitor, color video cameras CMY model Color printers HIS, HSV model Color image manipulation YIQ : Color TV, Y(luminance), I(Inphase), Q(quadrature) 7
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
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)
Color Image Processing RGB Model Pixel depth nr of bits used to represent each pixel Full color image (24 bits)
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 11
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. 12
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 G 120 o S H R 0 o 240 o B 13
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 0.311 0.523 0.212 0.321 0.275 0.596 0.114 0.587 0.299 Q I Y B G R 1.705 1.108 1 0.647 0.272 1 0.620 0.956 1
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
Color Image Processing
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
HSV Hexcone Intuitive interface to color
RGB -> HSI -> RGB RGB Image Hue Saturation Intensity
RGB -> HSI -> RGB Hue Saturation Intensity RGB Image
Color Image Processing RGB to HSI Conversion 1,,, where 0 ), ( 3 1 B G R I B G R I 0 0 2 1 if }, ) )( ( ) ( )] ( ) [( 2 1 { cos b g B G B R G R B R G R H 0 0 if, 360 b g H H }),, (min{ 3 1 B G R B G R S I B b I G g /, / where 0 0
Color Image Processing HSI to RGB Conversion 1 B 3 1 R (1 S) [1 3 G 1 R B S cos H ] cos(60 H ) assume 0 H 120
HSI-to-RGB conversion For 120 o <= H < 240 o For 240 o <= H < 360 o ( H -120 ) ( - H) é S cos ù G = I ê1 + ú, R = I, ë cos 180 û ( 1- S) B = I - R - G B ( H - 240 ) ( 300 - H) é S cos ù = I ê1 + ú, G = I, ë cos û ( 1- S) R = I - G - B 23
Chromatic images Colour Represented by vector not scalar Red, Green, Blue (RGB) Hue, Saturation, Value (HSV) luminance, chrominance (Yuv, Luv) S=0 Green Red Green V=0 Hue degrees: Red, 0 deg Green 120 deg Blue 240 deg
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
Luv and UVW A color model for which, a unit change in luminance and chrominance are uniformly perceptible U = 13 W* (u - u o ); V = 13 W* (v - v o ); 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
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
Examples (RGB, HSV, Luv)
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
No gamma correction
Gamma corrected to 1.7
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
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
Color Image Processing
Color Image Processing
Color Image Processing
Color Image Processing
Color Image Processing
Color Image Processing