You are on page 1of 1

DR. M.

AHMAD 1

Assignment No. 1 – 4 Points


Fundamentals of Computer Vision – Deadline Before or on April 30, 2023

I. T HUMBNAILS /RULE / DON ’ T


1) Cheat/copy/plagiarized material
2) Uncited use of any material from anywhere
3) Share/steal any material with/from former or current students
4) Penalties:
• Zero marks for first sharing infringement (both parties)
• Exclusion from the course for second sharing infringement (both parties).

II. Q UESTION N O . 1
1) Download and install Python/Anaconda.
2) Configure OpenCV with jupyter notebook. No other IDE is allowed.
3) Install the required libraries and run a simple program for loading and displaying a color image to
test your installation.
III. Q UESTION N O . 2
Use color.2.Convert the color image into a binary image. Print the pixel values of the grayscale image
and finally convert the grayscale image into the binary image and print both the original color and grayscale
image.
IV. Q UESTION N O . 3
Test the following OpenCV built-in functions for edge detection on your loaded image. Make individual
blocks for each of the following functions and print the actual image along with the detected images.
1) filter2D: The OpenCV function filter2D to create your own linear filters. filter2D(src, dst, ddepth ,
kernel, anchor, delta, BORDER DEFAULT)
2) Gaussian filter: Probably the most useful filter (although not the fastest). Gaussian filtering is done
by convolving each point in the input array with a Gaussian kernel and then summing them all to
produce the output array. GaussianBlur( src, dst, Size( i, i ), 0, 0)
3) Gradient X and gradient Y: Gradient is the partial derivative (a derivative of multiple variables).
We can derivate the image row-wise (in x) Ix and column-wise (in y) Iy .
4) Gradient magnitude: Magnitude shows the intensity of the change that ranges from low to high.
Later we can decide on the magnitude value to keep the pixel as edge or non-edge.
5) Sobel: The Soble and Prewitt are the sample edge detector. We can use the straight-away function
provided by OpenCV to get Sobel edges.
6) Canny: The most popular edge detector. The OpenCV also provides a built-in function for the
Canny edge detector.
V. Q UESTION N O . 4
Finally, implement the Edge detector in Jupyter notebook by yourself using the following steps.
• Get the image and convert it into gray-scale.
• Build the Gaussian filter from the filter2D function and apply it to the image.
• Apply the x-derivative (gradient) and y-derivative (gradient)
• Compute the gradient magnitude
• Threshold the final image.
• Finally, implement Laplacian of Gaussian (LoG) for comparison.

You might also like