Image Processing

Input and output data:

input
grayscale
beard
  1. -In order to convert the original image into the grayscale image, I looped through the pixels, took the average of the R,G, and B values, assigned this to the pixel

  2. -The other image was an attempt to change my beard to look more like my. In order to accomplish this, I looped through pixels on my forehead, and stored them in an array. After this, I looped through pixels around where my beard was and looked for colors that were blackish/grayish. I specifically searched for colors with RGB values under 65 and pixels where the difference between the 3 is less than 5. (for example, 100,102,98 is a shade of gray and RGB values are close to each other). If the pixel was found to be in this range of black or gray, we choose a random pixel from the array of skin pixels from my forehead and reset it here.