s3 - #10 ECE 253a Digital Image Processing Pamela Cosman...

This preview shows pages 1–4. Sign up to view the full content.

#10 ECE 253a Digital Image Processing Pamela Cosman 10/27/11 Solutions for Homework 3 1. Chromaticity diagrams: Here is the matlab code to plot the tristimulus values: >> load cie -ascii >> l = cie(:,1); >> X = cie(:,2); >> Y = cie(:,3); >> Z = cie(:,4); >> plot(l,X,’r-’,l,Y,’g--’,l,Z,’b-.’); Here is the code to plot the chromaticity diagram. The connected line of purples is obtained by simply tacking the Frst point of each vector on to its end: >> x = X ./ (X+Y+Z); >> y = Y ./ (X+Y+Z); >> x = [x;x(1)]; >> y = [y;y(1)]; >> plot(x,y) You were given the conversions from XYZ to RGB. What we need, however, is to convert from RGB to XYZ in order to plot in the xy chromaticity diagram. SpeciFcally, we need to convert each of the pure phosphor colors to XYZ, then to xy. ±or example, the vector [1 0 0]’ represents the pure NTSC red phosphor. That is, it is the NTSC red primary expressed in the NTSC coordinates. By using the inverse of the given matrix, we can convert this (1 0 0) point from the NTSC space to the XYZ space. Likewise, we have to convert (0 1 0) and (0 0 1) to the XYZ space. These three XYZ tristimulus values then get converted to xy and plotted in the xy plane. Here is the code to plot the NTSC triangle inside the xy-chromaticity horse-shoe: >> Nmat = [1.910 -0.532 -0.288; -0.985 2.0 -0.028; 0.058 -0.118 0.898]; >> invNmat = inv(Nmat); >> xyzR = invNmat * [1 0 0]’; >> xR = xyzR(1) / sum(xyzR); >> yR = xyzR(2) / sum(xyzR); xyzG = invNmat * [0 1 0]’; >> xG = xyzG(1) / sum(xyzG); >> yG = xyzG(2) / sum(xyzG); >> xyzB = invNmat * [0 0 1]’; >> xB = xyzB(1) / sum(xyzB); 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
>> yB = xyzB(2) / sum(xyzB); >> a = [xR xG xB xR]; >> b = [yR yG yB yR]; >> plot(x,y,a,b) >> grid We do the same thing to get the SMPTE phosphors. The NTSC set is bigger, although we have to remember that the space is not perceptually uniform, and so the amount of advantage can’t be estimated from this diagram. 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 SMPTE NTSC 2. Adding Colors (a) Tristumulus values are additive. The tristimulus values for W are (1,1,1). So if we use R,G,B to denote the tristimulus values for color A, we have R = 1 2 ( T 1 + 1) and G = 1 2 ( T 2 + 1) and B = 1 2 ( T 3 + 1) The chromaticity coordinates are r = R R + G + B = T 1 + 1 T 1 + T 2 + T 3 + 3 and g = G R + G + B = T 2 + 1 T 1 + T 2 + T 3 + 3 (b) We are told that t 1 = t 2 = 0 . 1 so we know that T 1 T 1 + T 2 + T 3 = T 2 T 1 + T 2 + T 3 = 0 . 1 2
and in particular we can conclude that T 1 = T 2 . Also T 1 = 0 . 1( T 1 + T 2 + T 3 ) = 0 . 1(2 T 1 + T 3 ) Multiplying by 10, we get 10 T 1 = 2 T 1 + T 3 and so T 3 = 8 T 1 . The tristimulus values for color C are therefore ( T 1 , T 1 , 8 T 1 ). So we know that T 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/15/2012 for the course ECE ece253A taught by Professor Cosman during the Fall '11 term at UCSD.

Page1 / 5

s3 - #10 ECE 253a Digital Image Processing Pamela Cosman...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online