HW6 solution - Department of Electrical & Computer Engineering

advertisement
Polytechnic University, Dept. Electrical and Computer Engineering
EE3414 Multimedia Communication System I
Spring 2006, Yao Wang
__________________________________________________________________________________________________
Homework 6 (Image Color Representation)
Reading assignment:
Gonzalez and Woods, Digital image processing, 2nd edition, Prentice Hall, 2002. Sec. 6.1,6.2,6.3.
1. Describe how the cones in the retina behind the human eye enable us to perceive color. What are the
different types of cones we have? what colors are they each sensitive to?
Solution: Color vision is provided by three types of color receptors (called cones) in the retina
(behind the eye), which have maximum absorptions at wavelengths corresponding to “red”,
“green” and “blue” respectively. By combining the responses from all three cones, a human
being can perceive a large range of color.
2. What color do you see when you project equal amounts of red, green and blue lights on a screen? What
about red and green, and green and blue?
Solution: With equal amounts of red, green and blue, the screen shows white, because the
projected lights follow additive rules. Red and green will generate yellow, green and blue will
generate cyan. (See RGBadd.gif)
3. What color do you see when you mix equal amounts of cyan, magenta, and yellow paints? What about cyan
and magenta, magenta and yellow? What about mixing red, green, and blue in equal proportions?
Solution: Mixing cyan, magenta, and yellow paints will produce black, because the paints
follow subtractive rules. Mixing cyan and magenta will yield blue, mixing magenta and yellow
will yield red (see CMYsub.gif) Mixing red, green, and blue will yield black.
4. Can you validate the following conversion between RGB and CMY by looking at figures on Slide 11 of
lecture note (RGBadd.gif, and CMYsub.gif)
Cyan = White – Red, Magenta = White – Green, Yellow = White - Blue
From “GGBadd.gif”, we see that cyan results from mixing green and blue. Since white =
red+green+blue, cyan=green +blue=white – red.
Other results can be similarly derived.
5. The conversion between RGB and YCbCr coordinate is shown below. a) Determine the YCbCr coordinate
for a color that is specified in (R,G,B) coordinate with R=100,G=200, B=50. b) Determine the (R,G,B)
coordinate for a color specified in the YCbCr coordinate with Y=100,Cb=50,Cr=30.
,
Solution:
(a)
0.504
0.098  100  16 
Y   0.257
C    0.148  0.291 0.439  200  128
 b 

  
Cr   0.439  0.368  0.071 50  128
Y  0.257 * 100  0.504 * 200  0.098 * 50  16  147.4  147
Cb  0.148 * 100  0.291 * 200  0.439 * 50  128  76.95  77
Cr  0.439 * 100  0.368 * 200  0.071 * 50  128  94.75  95
(b)
0
1.596  100  16 
 R  1.164
G   1.164  0.392  0.813 50  128
  


0  30  128
 B  1.164 2.017
R  1.164 * (100  16)  0 * (50  128)  1.596 * (30  128)  58.632  59
G  1.164 * (100  16)  0.392 * (50  128)  0.813 * (30  128)  208.026  208
B  1.164 * (100  16)  2.017 * (50  128)  0 * (30  128)  -59.55  60
6. Suppose you are given a 24 bit color image, with color components red, green, blue each represented by 8
bits per pixel. Now, we would like to reduce it to an 8 bit image by uniformly quantizing the red and green
components to 3 bits each, and the blue component to 2 bits. Illustrate the quantizer that you would use for
different components. Suppose a pixel has a color value of (R,G,B)=(200, 150, 40). What is the color after
quantization?
When a component is represented in 8 bits, it ranges in (0,256) (although the actual maximum value is 255, we
can assume 255 actually represents between 255 and 256 in the continuous range). To quantize it to 3 bits means
we can use 8 levels, to quantize it to 2 bits, we can use only 4 levels. These two quantizers are illustrated below.
For the color value (R,G,B)=(200, 150, 40), for red=200, using the 3 bit quantizer, we get 208, for green=150,
using the 3 bit quantizer, we get 144, for blue=40, using the 2 bit quantizer, we get 32. Therefore, the quantized
color is (R,G,B)=(208,144,32).
3 bit quantizer
Reconstruction
levels
Partition
levels
16
0
32
80
64
112
96
144
128
176
160
208
192
240
224
256
2 bit quantizer
Reconstruction
levels
Partition
levels
48
32
0
96
64
160
128
224
192
256
Download