Assignment 1

CS 585 HW 1
Shubhangi Jain
29 Jan 2020


Problem Definition

Create a grayscale image of your face by converting your color image.
Flip your face image horizontally, i.e. left to right, right to left.
Come up with a third way of manipulating your face that produces an interesting output. For example, you may create a blurred image of your grayscale face by assigning to each pixel the average grayscale pixel value of itself and its 8 neighbors. Hint: You may have to run your program a few times to make the blurring noticeable.


Method and Implementation

To read,save images I have used openCV.
For grayscale, I have taken mean value of each pixel of images to create gray image.
To flip image horizontally, I have inverted the image and then mathematically substracted the fliped image from original.
For third problem, I have changed the background lights of images. For this I have used convertTo function.


Results

Following images were generated by using the above functions:

Results

Trial Source Image Result Image
Grayscale
Horizontal Flipped
Custom (Removed green channel)


Conclusions

As C++ allows images to be visualized as 3D array, it becomes easy to do mathematical manipulation in images.