Tuesday, May 20, 2008

ASSIGNMENT # 3































First graph (wl vs. y ) shows the levels of green depending on wavelengths. Graph (wl vs. x/y) will represent ratio of red to green depending on the wavelength. The third graph wl vs. z/y - ratio of blue to green.


Problem # 4

a) To obtain the CYM components, we need to subtract the RBG components from 1.
We will get the following table:
For the given image, the maximum intensity and saturation requirements mean that the RGB components are 0 to 1. Since the CYM values are 1-RGB, they are also from 0 to 1.


















Images in OCTAVE





b) If we fed the CYN components to the RGB inputs of a colour monitor we will get the following image ( refer to the "grey" part of the table): WHITE, CYAN, BLUE, MAGENTA,RED,YELLOW,GREEN, and BLACK. The grey border will remain Grey


Problem # 6

a) This transformation changes only hue (Theta) coordinate of the HSI coordinates
While switching Red and Blue we are remaining in the same plane perpendicular to the vertical intensity axis. We are performing the reflection about Green-Magenta line of symmetry. We are sending red-green angle (0-120) to (120-240), and green-blue (120-240) into (0-120). Nothing is moving along intensity axis. ( From the equation itself I = 1/3 ( R+G+B) it is clear that to change the intensity at least one of the values of RGB has to be changed).

Saturation (the distance from the vertical axes) is the length of the vector from the origin to the point. Reflection will preserve the distance, so for the example, the saturation of Blue will be as saturation of Red was before the transformation.
b)Image 6.5 with exchanged red and blue colour channels of the image.





















Problem # 2

Let c be the given colour with its coordinates (x,y), which is known to lie on the straight line joining any two valid colours c1 and c2. The relative percentages of colours c1 and c2 composing of the given colour can be expressed as the ratios between the line segments cc1 to c1c2, and cc2 to c_1c_2.

distance between c and c_1
d_1= [(x- x_1)^2 + (y-y_1)^2]^1/2
distance between c1 and c2
d_2 = [(x_1-x_2)^2+(y_1-y_2)^2]^1/2
So the percentage of c1 in c can be expressed:
p1= [(d_2-d_1)/d_2]*100.

The percentage of c_2 will be equal to 100-p_1

Problem # 5

Transformation which will change white to black will be : 1-[1,1,1], which will result in [0,0,0];
The same transformation 1 - [R G B] will result in changing blue into yellow (no blue), and red into cyan (no red). So it is the same transformation we look at in the question #4 RGB into CYM.
By looking at the formulas for computing HSI components we may derive the conclusion that this transformation will effect the hue component of HSI.Our textbook, however says that " the RGB complement transformation functions do not have a straightforward HSI space equivalent(...) saturation component of the complement cannot be computed from the saturation component of the input image alone."
HSI components of the complements {yellow, cyan, black) may be expressed by the following equations:















Problem # 3

Let's consider any three valid colours c_1, c_2. and c_3 with coordinates (x_1,y_1), (x_2, y_2), and (x_3,y_3) in the chromacity diagram. Denote by c the given colour with coordinates (x,y).
To find the relative percentages of c_1,c_2, and c_3 in c let start by finding the relative percentage p_1+p_2 of c_1 and c_2 in c. The relative percentage of c_3 in c will be given by p_3=1-(p_1+p_2)

To find the distance of point c from the line segment c_1c_2 we may use the following formula
d_1=abs value(y_2*x-y_1*x-x_2*y+x_1*y-y_2*x_1+y_1*x_2)/[(y_2-y_1)^2+(x_2-x_1^2]^1/2
We want to find the distance d_2 of c_3 from the line segment c_1c_2.

d_2=abs.value (y_2*x_3-y_1*x_3-x_2*y-3+x_1*y_3-y_2*x_1+y_1*x_2)/[(y_2-y_1)^2+(x_2-x_1)^2]^1/2

so the relative percentage of c_1and c_2 in c, p_2+p_1=[( d_2-d_1)/d_2]*100

So the relative percentage p_3 of c_3 in c will be 1-(p_1+p_2)

No comments: