Professional Documents
Culture Documents
Color Coordinate
Color Coordinate
Rods
Night vision, perceive brightness only
Color sensation
Luminance (brightness) Chrominance
Hue (color tone) Saturation (color purity)
Fall 2004 EL512 Image Processing Lecture 8, Page 3 Fall 2004 EL512 Image Processing
Lecture 8, Page 4
Reflecting sources:
reflect an incoming light (e.g. the color dye, matte surface, cloth) perceived color depends on reflected frequency (=emitted frequency - absorbed frequency
Ci = C ( )ai ( )d , i = r , g , b, y
Fall 2004 EL512 Image Processing Lecture 8, Page 5 Fall 2004 EL512 Image Processing Lecture 8, Page 6
RGB vs CMY
A Color Image
Tristimuls Values
Tristimulus value
Red
The amounts of red, green, and blue needed to form any particular color are called the tristimulus values, denoted by X, Y, and Z. Trichromatic coefficients
x= X , X +Y + Z y= Y Z , z= . X +Y + Z X +Y + Z
Green
Blue
Only two chromaticity coefficients are necessary to specify the chrominance of a light.
x + y + z =1
Fall 2004
Lecture 8, Page 9
Fall 2004
Lecture 8, Page 10
Color Models
Specify three primary or secondary colors
Red, Green, Blue. Cyan, Magenta, Yellow.
Amplitude specification:
8 bits per color component, or 24 bits per pixel Total of 16 million colors A 1kx1k true RGB color requires 3 MB memory
Lecture 8, Page 11 Fall 2004 EL512 Image Processing Lecture 8, Page 12
Fall 2004
Equal amounts of Cyan, Magenta, and Yellow produce black. In practice, this produce muddy-looking black. To produce true black, a fourth color, black is added, which is CMYK color model.
Fall 2004 EL512 Image Processing Lecture 8, Page 14
Fall 2004
Lecture 8, Page 13
Lecture 8, Page 16
3 [min( R, G , B)] ( R + G + B)
1 I = [ R + G + B] 3
GB sector (120H<240)
R = I (1 S ) S cos( H 120) G = I 1 + cos(60 ( H 120)) B = 1 (R + G)
EL512 Image Processing
BR sector (240H<360)
G = I (1 S ) S cos( H 240) B = I 1 + cos(60 ( H 240)) R = 1 (G + B )
Lecture 8, Page 17
Criteria for Choosing the Color Coordinates The type of representation depends on the applications at hand.
For display or printing, choose primary colors so that more colors can be produced. E.g. RGB for displaying and CMY for printing. For analytical analysis of color differences, the difference in the trisitumulus values are linearly related to the chrominance differences. HSI is more suitable. For transmission or storage, choose a less redundant representation, eg. YIQ or YUV
Fall 2004 EL512 Image Processing Lecture 8, Page 19
Fall 2004
Lecture 8, Page 20
Printing:
Need three (or more) color dyes (Cyan, Magenta, Yellow, and Black) Analog printing Digital printing Out of gamut color
Fall 2004 EL512 Image Processing Lecture 8, Page 21 Fall 2004 EL512 Image Processing Lecture 8, Page 22
Color Gamut
Green signal
Blue signal
Each color model has different color range (or gamut). RGB model has a larger gamut than CMY. Therefore, some color that appears on a screen may not be printable and is replaced by the closest color in the CMY gamut. Lecture 8, Page 23 Fall 2004 EL512 Image Processing Lecture 8, Page 24
Fall 2004
Gamma Correction
The intensity to voltage response curve of the computer monitor is not linear.
Sample Input to Monitor Output from Monitor Graph of Input Graph of Output L=V2.5
Gamma correction
Sample Input to Monitor Graph of Input Graph of Correction L=L1/2.5 Graph of Output
EL512 Image Processing Lecture 8, Page 26
Color Quantization
Select a set of colors that are most frequently used in an image, save them in a look-up table (also known as color map or color palette) Any color is quantized to one of the indexed colors Only needs to save the index as the image pixel value and in the display buffer Typically: k=8, m=8 (selecting 256 out of 16 million)
Input index (k bits) Index 1 . Index 2^k
Fall 2004
Uniform Quantization
Fall 2004 EL512 Image Processing
Vector Quantization
Lecture 8, Page 29
Color Dithering
Color quantization may cause contour effect when the number of colors is not sufficient Dithering: randomly perturb the color values slightly to break up the contour effect
fixed pattern dithering diffusion dithering (the perturbed value of the next pixel depends on the previous one) Developed originally for rendering gray scale image using black and white ink only
Original value (R,G, or B) Dithered value
These colors are those that can be rendered consistently by different computer systems. They are obtained by quantizing the R,G,B component independently using uniform quanitization. Each component is quantized to 6 possible values: 0(0x00), 51(0x33), 102(0x66), 153(0x99), 204(0xCC), 255(0xFF).
Fall 2004 EL512 Image Processing Lecture 8, Page 31 Fall 2004
Dithering value
EL512 Image Processing Lecture 8, Page 32
How?
Use different colors (different in hue) to represent different image features in a monochrome image.
Frequency slicing: Decomposing an image into different frequency components and represent them using different colors.
Fall 2004
Lecture 8, Page 35
Fall 2004
Lecture 8, Page 36
Intensity Slicing
Color C4
Example
C3 C2 C1
f0 =0
f1
f2
f3
f4
Gray level
Pixels with gray-scale (intensity) value in the range of (f i-1 , fi) are rendered with color Ci
Fall 2004 EL512 Image Processing Lecture 8, Page 37 Fall 2004 EL512 Image Processing Lecture 8, Page 38
Another Example
Fall 2004
Lecture 8, Page 39
Fall 2004
Lecture 8, Page 40
An Example
Example
Fall 2004
Lecture 8, Page 41
Fall 2004
Lecture 8, Page 42
Convert the tri-stimulus representation into a luminance / chrominance representation, and enhance the contrast of the luminance component only.
Use HSI representation, where I truly reflects the luminance information.
Fall 2004 EL512 Image Processing Lecture 8, Page 43 Fall 2004 EL512 Image Processing Lecture 8, Page 44
Fall 2004
Lecture 8, Page 45
Fall 2004
Lecture 8, Page 46
Homework
1. (Computer Assignment) Write a program which first performs highpass filtering (you can use matlab func conv2 for this part) of an input gray scale image using the following filter: 0 1 0 Scale the filtered image to range between 0 and 255. Then displays the filtered image using 3 pseudo colors, using the following color transformation: Color Red for values 0-80, Color Green for values 81-160, color blue for values 161-255. In matlab, you can use the function colormap to change the colormap and use imshow to display an image using a specified colormap. Comment on the visual effect, e.g. each color represents what attributes of the image? (Computer Assignment) Choose a 24 bit RGB color image, perform the following operations: 1) convert it to YIQ format, save the resulting images in three separate files (for Y, I and Q components respectively), each with 8 bits/pixel; 2) perform histogram equalization to the Y image; 3) convert the enhanced Y image and the original I and Q image back to the RGB image. View the original and enhanced color RGB images and comment on your observations. (Computer Assignment) Choose a 24 bit color RGB image, quantize the R, G, and B components to 3, 3, and 2 bits, respectively, using a uniform quantizer in the range 0-256. Display the original and quantized color image using the original colormap associated with the image. Comment on the difference in color accuracy. Make sure you use a computer that has a 24 bit color display, and the test image has good color contrast.
EL512 Image Processing Lecture 8, Page 47
1 1 4 1 4 0 1 0
Reading
Prof. Yao Wangs Lecture Notes, Chapter 6. R. Gonzalez, Digital Image Processing, Chapter 6. A. K. Jain, Fundamentals of Digital Image Processing, Section 3.7 ~ 3.11, 7.7 ~ 7.8.
2.
3.
Fall 2004
Fall 2004
Lecture 8, Page 48