The goal of this assignment was simply to learn how to manipulate images using OpenCV. We were required to manipulate an image of our face in 3 ways - by switching the image to grayscale, then by flipping the image horizontally, and finally by blurring the image by taking the average of its grayscale values of its surrounding pixels.
Method and Implementation
My program processes the face image by doing the following. First it converts the image to grayscale by taking the average of the red, green, and blue values and then setting all 3 channels to this average value. It then flips the image horizontally by going through each row and switching the pixel values for each channel with those of the pixel at the other end of the row. Finally it blurs the image by calculating for each pixel the average grayscale value of all of the pixels around it and setting the pixel to that value. In order to create a noticable difference in the image I had to run this operation 10 times so that it would be blurred enough to notice.
These are the resulting images I created as a result of each of the modifications mentioned above
|Initial input image|
|Horizontally flipped image|