CS 585 HW 1
Aaron Jacob Varghese - U60942775

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 of converting an image to grayscale, flipping an image from left to right and finally, blurring an image.

Method and Implementation

  1. Task 1 - Conversion to Grayscale

  2. This was done using the weighting method shown in class. Given an image with R,G,B channels, a new image was constructed using the following formula -

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

  3. Task 2 - Flipping an Image

  4. This was done by making a new empty image matrix and filling it in reverse order i.e. 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. This was done as specified in the assignment question. The value of each pixel was replaced with the average of the sum of values of the corresponding pixel and it's neighbors.




Task Source Image Result Image
Grayscale Conversion
Flipping Image


The most clear problem with these methods is that the larger the images get, the more time is taken to perform the operations, since each pixel needs to be visited.

However, the methods do accomplish the task at hand and it is unlikely there are any special case images that can break them. One potential improvement could be to the grayscale conversion formula, which could be tweaked or entirely reworked to give a more accurate grayscale representation.


OpenCV is a powerful and very useful tool for image analysis and manipulation.

Credits and Bibliography

  • Lecture Slides
  • OpenCV Documentation
  • Teammate - Rahul Ramachandran