# CS 447/547: Computer Graphics Homework 2 solved

\$35.00

Category:

## Description

Question 1: This question concerns human’s intensity perception. Humans are tuned to the ratio
of intensities, not their absolute difference. If we want to make a perceptually uniform intensity
system with intensities 𝑙1 = 1, 𝑙2, 𝑙3,𝑙4, 𝑙5,
𝑙6 = 32. What are the values of 𝑙2, 𝑙3, 𝑙4, and 𝑙5 ?
Question 2: CIE L*a*b* color space is often considered approximately perceptually uniform. We
can convert RGB into L*a*b* in two steps:
Step 1: Convert RGB to XYZ using the formula in our lecture 2.
Step 2: Convert XYZ to L*a*b*.
L*a*b* is not a linear color space, so converting XYZ to L*a*b* is more complicated than RGB
to XYZ. We will use the following formulas to the conversion.
𝐿
∗ =
{

116 ∗ (
𝑌
𝑌𝑛
)
1
3
− 16
𝑌
𝑌𝑛
> 0.008856
903.3 ∗ (
𝑌
𝑌𝑛
) 𝑒𝑙𝑠𝑒
𝑎
∗ = 500 ∗ (𝑓 (
𝑋
𝑋𝑛
) − 𝑓 (
𝑌
𝑌𝑛
))
𝑏
∗ = 200 ∗ (𝑓 (
𝑌
𝑌𝑛
) − 𝑓 (
𝑍
𝑍𝑛
))
where
𝑓(𝑡) = {
𝑡
1
3 𝑡 > 0.008856
7.787 ∗ t +
16
116 𝑒𝑙𝑠𝑒
Here Yn = 1.0 is the luminance, and Xn = 0.950455, Zn = 1.088753.
Suppose we have two colors in RGB color space: (0.5, 0, 0) and (1, 1, 1).
a. What are the coordinates for these two colors in L*a*b* color space?
In computer graphics, we often need to perform linear interpolation between two colors. The
linear interpolation from (r1, g1, b1) and (r2, g2, b2) can be implemented as follows.
𝑟(𝑢) = (1 − 𝑢)𝑟1 + 𝑢𝑟2
𝑔(𝑢) = (1 − 𝑢)𝑔1 + 𝑢𝑔2
𝑏(𝑢) = (1 − 𝑢)𝑏1 + 𝑢𝑏2
b. We want to interpolate from (0.5, 0, 0) to (1, 1, 1) in 5 steps, which can be achieved by using
u=0, u=0.25, u=0.5, u=0.75, u=1, respectively. Compute the 5 RGB colors.
c. Compute the corresponding coordinates in L*a*b* color space of the above 5 RGB colors.
d. Plot two graphs: one showing L* as a function of u and the other showing a* as a function of
u.
Here we can see that L* and a* are not a linear function of u.
Question 3: Consider the three sensors, A, B and C, shown below. Sensor A has a response of 1
between 400nm and 500nm, Sensor B responds between 450nm and 600nm, and Sensor C
responds between 550nm and 700nm.
What is the response of each of these three sensors to the following spectrum? You need to give
actual points.

Question 4: The Sobel operator is used in image processing for edge detection. The following
shows a 3 × 3 Sobel filter mask for a vertical edge detector.
[
1 0 −1
2 0 −2
1 0 −1
]
a. What is the response of this filter to the following 6 × 6 image? Ignore the boundary pixels
that do not have all the pixel values for the filter, so we will get a 4 × 4 image.
[

0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1]

b. What is the response of this filter to the following 6 × 6 image? Again, ignore the boundary
pixels that do not have all the pixel values for the filter, so we will get a 4 × 4 image.
[

0 0 0
0 0 0
0 0 0
1 1 1
1 1 1
1 1 1
0 0 0
0 0 0
0 0 0
1 1 1
1 1 1
1 1 1]

c. Can you design a 3 × 3 filter that can detect the horizontal edge in the image shown in (a)?
Question 5: Gaussian is one of the most popular filters in computer graphics. What is the 9× 9
2D guassian filter mask? (Use the method described in Lecture 4: first construct a 1d filter mask,
and then construct the corresponding 2D filter mask. You are not required to fill in the actual
number for the 2D filter mask, and a correct formula is good enough.).