Part I - Gray Threshold

Explanation
So, to perform a threshold, I used the gray value obtained by using either:
  1. (R + G + B) / 3
  2. (0.3*R) + (0.59*G) + (0.11*B)
The gray value is then compared with the threshold, where if the gray value is above the threshold, the entire RGB value for that particular pixel is set to white. Otherwise, they are set to black. A slider is also provided to control the threshold value between 0-255. The initial threshold is set to 50%, which is roughly 128. A black & white output is expected and a sample screenshot is provided below.



Question
  1. Would the threshold calculated by one method be equivalent to that calculated by the second method? Why / why not?
No. The first method, (R + G + B) / 3 simply returns the average values among the three colors. The other method, (0.3*R) + (0.59*G) + (0.11*B) returns the weighted average, since each color carries a different weight with regards to perceptions made by the human eye.

Reflection 
I initially thought grayscale thresholding would result in a grayscale image, but it seems that I was wrong. At least according to the requirement's intructions. Doing this was fairly easy, but unknowingly, this became the base for all other requirements. In other words, this is where I learned and understood about pixel and RGB components access.

No comments:

Post a Comment