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
- Task 1 - Conversion to Grayscale
- Task 2 - Flipping an Image
- Task 3 - Blurring an Image
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

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.

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.

Experiments
N/A
Results
Task | Source Image | Result Image |
Grayscale Conversion | ![]() |
![]() |
Flipping Image | ![]() |
![]() |
Blurring | ![]() |
![]() |
Discussion
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.
Conclusions
OpenCV is a powerful and very useful tool for image analysis and manipulation.
Credits and Bibliography