Assignment 1

CS 585 HW 1
Jeanpiere Solorzano
September 13 2018


Problem Definition

Learn to manipulate an input image by using OpenCV on Visual Studios. Get familiar with C++ code in order to output a grayscale image, a horizontal flip of an image and to demostrate a third way of manipulating an image. The results are useful in order to demostrate that the code works properly.



Method and Implementation

GrayScale Image Implementation: Go through every pixel of the image and find the average of the RBG color channels. This will make the image appear gray.
Flipped Image Implementation: Clone the original image (A) and use the cloned image (B) to change the pixel positions. Go through the pixels of image A backwards and place each pixel in image B in chronological order. This will flip the image.
Combined Image Implementation: Acquire all pixels of image A and image B and combine both images into a new image. This will make a sort of reflective effect on the image.



Experiments

Run the code multiple times and used the functions offered by OpenCV in order to check that the output that came from the algorithm I created were similar to functions already made for that purpose.



Results

Original Image

face

GrayScale Image

grayscale

Horizontal Flip Image

horizontal flip

Third Image Manipulation

combined images

Discussions

The methods used to manipulate the images were simple for anyone to understand, especially those who are new to image manipulation software. One of the biggest downsizes is that the implementation makes the program run throguh every single pixel. This means that the time it would take to analyze bigger images will greatly increase the memory usage. However the time it took for all the pictures to be manipulated were less than 0.5sec. For the future projects the algorithms used this time must be polished in order to boost performance



Conclusions

Image manipulation can be simple but there are repercussion to using simple algorithms in order to change the look of the image. It's good to use functions already made by other users that can manipulate the image in one line of code in order to compare them with your own code.



Credits and Bibliography

Used the following documentation site to write the program: https://docs.opencv.org/3.3.0/ for