CS867: Computer Vision: Instructor: Muhammad Moazam Fraz
CS867: Computer Vision: Instructor: Muhammad Moazam Fraz
November 9, 2020
Assignment 1
Basic Image Analysis Operations
Department of Computing
1
1 Introduction
The assignments in with course will cover a wide range of topics in computer vision and aimed at
giving the students hand-on exposure to a abroad range of concepts and applications.
There is rich set of image processing libraries available in Python. During this course, the students
will be trained to use them with the help of assignments.
A comprehensive list of Python libraries and packages used for computer vision can be seen at
GitHub helper repository created for this course https://github.com/visionatseecs.
Several electronic books are provided in a google drive, the link is shared on LMS. These books
can be an excellent resource for the beginners as well as for the experts.
Assignment 1 starts off with an introduction on how to use images in python and numpy. It focuses
on understanding and implementing the basic concepts such as image manipulation operation using
matrices, convolutions, different kernels and how to design them and edge detection e.t.c. A couple of
extra credit questions are also there.
Submission on LMS
After you have completed the assignment, you need to submit the following deliverable on LMS:
1: Assignment-1.pdf. - Export the Assignment.ipynb as a PDF and submit it to LMS. (execute
the notebook and print as PDF)
2: Assignment-1.ipynb.
3: *.py - All the python files we ask you to code up must be submitted to LMS.
Place all files in a folder. Rename the folder as ”Your FirstName-Your LastName”, zip it (like
Asad-Ali.zip) and submit it on the link given on LMS.
Submission on Github
Create a Github repository (say CS867 Assignment 1) and upload your jupyter notebook and asso-
ciated files over there. A Google form will be shared by the TA, where you will submit the URL of
your Github repository.
If you are not familiar with using GitHub, some use full links on creating GitHub repositories are
given below.
2
Please make sure that the code must run without errors, because it may be marked by automated
scripts. NO credit will be given if code fails to run properly.
2 Tasks
A set of images is given with this assignment to perform the following tasks. However, feel free to use
your own set of images.
2.1
Load the set of images and display them as Grayscale and rgb images. You are required to show these
images ”inline” rather than creating a new window for every other image. (2 points)
2.2
Implement the function rgbExclusion() in the helper script, in which the input image is decomposed
into the three channels: R, G and B and return the image excluding the specified channel. Display
the results in notebook. (3 points)
2.3
Take at-least 3 images from given set and plot histograms before and after applying histogram equal-
ization. Show these image inline format i.e. grayscale image –> display histogram –> apply histogram
equalization–> display the equalized image and its histogram. (5 points)
2.4
You are required to implement the convolution operation from scratch. This function which takes an
image and a kernel and returns the convolution of them.
Compare the results of your implemented function with the ones available (built-in) in python
packages. You are required to convolve images for sharpening and blurring effects. (5 points)
2.5
Load a couple of images from the given set.
1. Apply box filter using convolution, and display the resultant image
2. Apply Gaussian filter to the image, with varying sigma values.
3. Add Gausian Noise and Salt and Pepper Noise to them.
4. Apply Gaussian Filter and Median Filters.
5: Display mesh plots for different i) Gaussian filters, ii) First Order Derivative of Gaussian, iii)
Laplacian of Gaussian; using different sigma values
3
You are encouraged to play with the different parameter values.The results should be displayed in
three columns i.e Original Image, Corrupted Image and the Filtered Image.
(20 points)
2.6
Load a few images from the given set.
1. Apply Sobel operator, computer gradient magnitude and display the results (original image, gradi-
ent images and gradient magnitude image).
2. Apply Laplacian of Gaussian, computer laplacian magnitude and display the results (original im-
age, filtered images and laplacian magnitude image). Try different filter kernel coefficients.
3. Apply Canny Edge Detector and display the results.
You are encouraged to play with the different parameter values (20 points)
Hint: You can use ipywebrtc library (in jupyter notebook or you can also open new window for
showing output.