I22: Digital Image processing Lecture 3: Grey and Color Image Processing Prof. YingLi Tian Sept. 13, 217 Department of Electrical Engineering The City College of New York The City University of New York (CUNY) Some materials from Dr. Lexing Xie, Alan Peters, and Dr. Shahram Ebadollahi 1
Outline: Preliminaries Sampling function Fourier Transform Image Histogram Color Visual Perception Color Representation Color Models and Transformations Color Sampling and Interpolation 2
Preliminaries 3
Preliminaries Fourier Transform The Fourier Transform is an important image processing tool which transfer an image from the spatial domain to the Fourier or frequency domain. Application: image filtering image reconstruction image compression 4
Preliminaries Fourier Transform http://en.wikipedia.org/wiki/fourier_transform 5
Discrete Fourier Transform (DFT) The DFT is the sampled Fourier Transform and therefore does not contain all frequencies forming an image, but only a set of samples which is large enough to fully describe the spatial domain image. The number of frequencies corresponds to the number of pixels in the spatial domain image, i.e. the image in the spatial and Fourier domain are of the same size. 6
Discrete Fourier Transform (DFT) For a square image of size N N, the two-dimensional DFT is given by: f(a,b) is the image in the spatial domain and the exponential term is the basis function corresponding to each point F(k,l) in the Fourier space. Inverse DFT: 7
Fourier Transform Pair - example Image Fourier Transform To learn more: http://homepages.inf.ed.ac.uk/rbf/hipr2/fourier.htm 8
Fourier Transform Pair - example Image Fourier Transform To learn more: http://homepages.inf.ed.ac.uk/rbf/hipr2/fourier.htm 9
Fourier Transform Pair - example 1
Image Histogram 11
Image Histogram: example 16 14 12 1 8 6 4 2 5 1 15 2 25 12
Image Histogram: example 16 14 12 1 8 6 4 2 5 1 15 2 25 13
The retina is complex in itself. This thin membrane at the back of the eye is a vital part of Eye Physiology & Visual Perception The anatomy of the eye Image from http://health.howstuffworks.com/artificial-vision.htm 14
How Human Eye Works? Scattered light from the object enters through the cornea. The light is projected onto the retina. The retina sends messages to the brain through the optic nerve. The brain interprets what the object is. 15
How Your Retina Works? Its main function is to receive and transmit images to the brain. These are three main types of cells: Rods: able to function in low light create blackand-white images without much light Cones: able to see color and detail of objects with enough light. ganglion cells: interpret the messages from the rods and cones and send the information on to the brain by way of the optic nerve. 16
The Retina Light 17
Questions? What is near sighted? What is far sighted? What is the meaning of 2/2 vision? (2/4 vision)? Blind or Visually impaired 18
Artificial Silicon Retina (ASR) for the blind diameter 2 mm and thinner than a human hair Here you can see where the ASR is placed between the outer and inner retinal layers. Image from http://health.howstuffworks.com/artificial-vision.htm 19
Color Image Processing Violet, blue, green, yellow, orange, and red 2
Color Image Processing 21
Visual Perception: Luminance 22
Radiance and Luminance Radiance: total amount of energy that flows from the light source. Unit: watts (W). Luminance: the amount of energy an observer perceives from a light source. Unit: lumens (lm) 23
Visual Perception: Color Humans perceive only a few dozen gray levels but thousands of colors 24
Color Illusions Squares A and B are the same shade of gray. 25
Color Illusions yellowish illumination bluish illumination 26
Color Illusions Same color Image from http://boingboing.net/28/2/8/color-tile-optical-i.html 27
Primary & Secondary Colors Three primary color: red (R 65%), green (G 33%), and blue (B 2%). Secondary color: magenta (R + B), cyan (G+B), and yellow (R+G). 28
Chromaticity Color perceptual attributes: Brightness -- intensity (perceived Luminance) Hue perceived dominant color such as redness, greenness, Saturation relative purity or the amount of white light mixed with a hue. Chromaticity: Hue + Saturation 29
Chromaticity Coordinates The chromaticity specifies the hue and saturation, but not the brightness. r+g +b = 1 - Third component can always be computed from first two. 3
CIE Chromaticity Diagram CIE: the International Commission on Illumination 31
Color Monitor & Printer Color Gamut Monitors Printers 32
Color Images on a CRT or LCD Display Intensity images are projected through dot-array color filters which are slightly offset from one another. 33
Color Images In Print Images are separated into four color bands, each of which is printed as a grid regularly spaced dots. A dot s diameter varies in proportion to the intensity of the color. 34
Color Images In Print The four colors are magenta, cyan, yellow, and black (CMYK color model) 35
1 mins break 36
Color Models RGB CMY CMYK HSI 37
RBG Color Cube (Outer) 38
RBG Color Cube (inner) 39
RBG Color Cube (inner and outer) 4
RBG Color Cube 41
RGB to CMY Color Model C cyan; M magenta; Y yellow CMYK add black color C = 1- R M = 1 G Y = 1 - B 42
RGB YIQ Color Model color primary system adopted by NTSC for color television broadcasting 43
RGB YUV Color Model Similar to YIQ but adopted by PAL for color television broadcasting 44
L*a*b* color model 45
HSI Color Model H hue, S-saturation, I- intensity. 46
HSI Color Model 47
HSI Color Model 48
RGB to HSI Color Model 49
RGB to HSI Color Model For convenience, h, s and i values are converted in the ranges of [,36], [,1], [, 255], respectively, by: 5
HSI to RGB Color Model 51
HSI example 52
HSI example 53
Saturation Adjustment original
Saturation Adjustment saturation + 5%
Saturation Adjustment original
Saturation Adjustment saturation - 5%
Hue Shifting R R Y Y G G C C B B M M original
Hue Shifting R Y hue + 6 Y G G C C B B M M R
Hue Shifting R G hue + 12 Y C G B C M B R M Y
Hue Shifting R C hue + 18 Y B G M C R B Y M G
Hue Shifting R B hue + 24 Y M G R C Y B G M C
Hue Shifting R M hue + 3 Y R G Y C G B C M B
Hue Shifting R R hue + 36 = Y Y G G C C B B M M original
Pseudocolor Image Processing 65
Pseudocolor Image example 66
Intensity to Color 67
Pseudocolor Image example 68
Color Image are represented by three bands (not uniquely) e.g., R, G, & B or L, a*, & b*. Red Green Blue Luminance a*-chroma b*-chroma 69
Color Image Processing 7
Color Correction Global changes in the coloration of an image to alter its tint, its hues or the saturation of its colors with minimal changes to its luminant features
Color Correction Via Transformation is a point process; the transformation is applied to each pixel as a function of its color alone. Each pixel is vector valued, therefore the transformation is a vector space operator.
Color Vector Space Operators Linear operators are matrix multiplications r g b 1 1 1 a a a 11 21 31 a a a 12 22 32 a a a 13 23 33 r g b r g b 1 1 1 255 1/ r r / 255 1/ g g / 255 1/ b b / 255 Example of a nonlinear operator: gamma correction
Linear Transformation of Color 1 1 1 1 / b g r r r b g r 125 75 175 175 75 175
Linear Transformation of Color 1 1 1 / 1 b g r g g b g r 125 75 175 125 15 175
Linear Transformation of Color 1 1 / 1 1 b g r b b b g r 125 75 175 125 75 225
Linear Transformation of Color 1 1 1 1 1 1 / / / b g r b b g g r r b g r 125 75 175 175 15 225
Color Transformation 78
Color Transformation 79
Color Image Example -- RGB 8
Color Image Example -- HSI 81
Color Image Smoothing Average the RGB component vectors in a mask nxn 82
Color Image Sharpening 83
Edge Detection 84
Edge Detection 85
HW 1 -- Due: 9/26/217 Discussions are welcomed Never copy others work (no grades for both students) Adrian will present HW1 on 9/27. Read Chapter 6 Next class: Image enhancement in spatial domain 86