Assignment Title

CS 585 HW 1
Rahul Ramachandran
29/1/2020


Problem Definition

The purpose of this assignment is to get acquainted with the functionality of the opencv library.
This was done through three sub-tasks, which are discussed below.


Method and Implementation

  1. Task 1 - Grayscale Conversion

  2. Done using weighting method shown in class. Given an image with R,G,B channels, a new image is constructed as follows -

    NEW_PIXEL_VALUE = R * 0.3 + G * 0.59 + B * 0.11

  3. Task 2 - Flipping the Image

  4. Straightforward task done by making a new image matrix filled in reverse order (the last column of pixels in the original image were used to fill the first column in the new image)

  5. Task 3 - Blurring an Image

  6. Done as specified in the assignment question. Value of each pixel is replaced with average of values of the corresponding pixel and it's neighbors.


Results

The following are the resulting images from the program:

Results

Trial Source Image Result Image
GrayScale Trial
Flip Trial
Blur Trial


Discussion

While the program runs fine for the given input image, it takes a long time to run for larger images.
This is especially valid for the blur function, since it has to calculate the average over 9 pixels for every pixel in the image.


Conclusions

Libraries like OpenCV are powerful tools for image computation.


Credits and Bibliography

Collaborator: Aaron Jacob