CS788 Assignment 1: Written problems

	Billy Biggs
	97049311
	wbiggs@uwaterloo.ca

Problem 2: sRGB Conversion Matrix

The colour primaries used are defined in xyY space.

Red $x = 0.640$ $y = 0.330$
Green $x = 0.300$ $y = 0.600$
Blue $x = 0.150$ $y = 0.060$
White (D65) $x = 0.3127$ $y = 0.3290$


These are the primaries specified by both ITU-R BT.709 and sRGB. Given these chromanicities, we are given a relationship between the $XYZ$ coordinates and the values of $R$, $G$, and $B$. For example, the $X$ value of any $RGB$ colour can be expressed as a linear combination of the $X$ values for $R$, $G$, and $B$ individually. Since we can derive those from the chromanicities, we define constants $C_r$, $C_g$ and $C_g$ to represent the factors of which the chromanicities contribute to the resulting $XYZ$ value. To solve these values, I'm using the notation and ideas from the method described in Foley/van Dam.

\begin{eqnarray*}
\left[\begin{array}{c} X \\ Y \\ Z \\ \end{array}\right]
& = &...
...ft[\begin{array}{c} R \\ G \\ B \\ \end{array}\right]
\end{array}\end{eqnarray*}



In order to compute the values of $C_r$, $C_g$ and $C_b$, we need a known reference point. For this we will use the D65 white point (black body at 6500K) and use unity luminance ($Y$) and map this to $R = G = B
= 1$.

\begin{eqnarray*}
Y_{D65} &=& 1 \\
X_{D65} &=& x_{D65} \frac{Y_{D65}}{y_{D65}} ...
...}}{y_{D65}} \\
&=& 0.3583 \frac{1}{0.3290} \\
&=& 1.0891 \\
\end{eqnarray*}



We can now use these to solve for $C_r$, $C_g$ and $C_b$ by taking the inverse of the following:

\begin{eqnarray*}
\left[\begin{array}{c} X_{D65} \\ Y_{D65} \\ Z_{D65} \\ \end{a...
...gin{array}{c} C_r \\ C_g \\ C_b \\ \end{array}\right]
\end{array}\end{eqnarray*}



We get:

\begin{eqnarray*}
\left[\begin{array}{c} C_r \\ C_g \\ C_b \\ \end{array}\right]...
...n{array}{c} 0.6444 \\ 1.1919 \\ 1.2033 \\ \end{array}\right] \\
\end{eqnarray*}



Submitting back, we get the final matrix:

\begin{eqnarray*}
\left[\begin{array}{c} X \\ Y \\ Z \\ \end{array}\right]
& = &...
...ft[\begin{array}{c} R \\ G \\ B \\ \end{array}\right]
\end{array}\end{eqnarray*}



Inverting this we get the desired matrix:

\begin{eqnarray*}
\left[\begin{array}{c} R_{sRGB} \\ G_{sRGB} \\ Z_{sRGB} \\ \en...
...egin{array}{c} X \\ Y \\ Z \\ \end{array}\right]
\end{array} \\
\end{eqnarray*}



Problem 3: sRGB Matching Functions

The matching functions are created by converting the xbar, ybar and zbar quantities to sRGB-space.
Raw version, relative sensitivity on the y axis, wavelength in nanometers along the x axis.

Normalized version such that each integral sums to unity. Again, relative sensitivity on the y axis, wavelength in nanometers along the x axis.