Computer Vision
Assignment 2
1. Write a Python program to modify an image by changing the color of the first
100x100 pixels to black (RGB value: 0, 0, 0). Display both the original and the
modified image.
2. Write a program to combine two images side by side and display them using
OpenCV.
Combined image:
3. Write an OpenCV code to load an image, extract a specific (H=150, W=150)
image region, and display both the original and extracted regions using Python.
Original image:
4. Implement a Python script that reads an image and calculates and plots the
histogram of its grayscale version. Save the histogram plot as an image file.
5. Create a program that reads an image and applies a Gaussian blur to it using the
filter shown in the image below. Display both the original image and the blurred
image. (To apply a filter, you have to convolve the filter with the image)
NOTE: Please do all the assignments without inbuilt libraries except for basic
reading and writing commands.
Convolution operation: