0% found this document useful (0 votes)
9 views

Assignment 1

This Python coding assignment involves practicing various image processing techniques including image filtering, smoothing, sharpening, histogram equalization, and image transformation. Students are instructed to load an image, implement functions for each technique using NumPy and OpenCV, test the functions on the loaded image, and explain the concepts and results. Sample questions provide examples of functions to implement for convolution, smoothing/sharpening, histogram equalization, and image transformation, and discuss exploring bonuses like handling color images and more advanced techniques.

Uploaded by

uiuxdesigner141
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Assignment 1

This Python coding assignment involves practicing various image processing techniques including image filtering, smoothing, sharpening, histogram equalization, and image transformation. Students are instructed to load an image, implement functions for each technique using NumPy and OpenCV, test the functions on the loaded image, and explain the concepts and results. Sample questions provide examples of functions to implement for convolution, smoothing/sharpening, histogram equalization, and image transformation, and discuss exploring bonuses like handling color images and more advanced techniques.

Uploaded by

uiuxdesigner141
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Python Coding Assignment - Math for AI (Image

Processing)
This assignment focuses on practicing image processing concepts covered in the past
lectures, including:

• Image filtering and convolution operation


• Image smoothing and sharpening
• Histogram equalization
• Image transformation

Instructions:

1. Import necessary libraries (e.g., OpenCV, NumPy)


2. Load an image (grayscale or color) using appropriate functions.
3. Implement the following functions for each task:
o Convolution: Define a function that takes an image and a filter as input
and performs convolution using NumPy operations.
o Smoothing: Implement a function that applies a smoothing filter (e.g.,
Gaussian) to the image using the convolution function.
o Sharpening: Implement a function that applies a sharpening filter (e.g.,
Laplacian) to the image using the convolution function.
o Histogram Equalization: Implement a function that performs histogram
equalization on the image.
o Image Transformation: Implement a function that performs a simple
geometric transformation (e.g., translation, rotation) on the image.
4. Test each function with the loaded image and visualize the results using
appropriate plotting libraries (e.g., Matplotlib).
5. Briefly explain the theoretical concepts behind each implemented function and
the observed results.

Sample Questions:
1. Convolution: Write a function convolve(image, filter) that performs
convolution of an image with a given filter kernel. Explain the steps involved in the
convolution operation and how it is implemented using NumPy. Apply the function
with different filters (e.g., averaging, sharpening) and visualize the results.
2. Smoothing and Sharpening: Implement functions smooth(image,
kernel_size) and sharpen(image, kernel_size) that apply Gaussian and
Laplacian filters of specific kernel sizes, respectively. Discuss the impact of kernel
size on the smoothing/sharpening effect.
3. Histogram Equalization: Implement a function equalize_histogram(image) that
performs histogram equalization on the image. Explain the purpose of histogram
equalization and visualize the original and equalized image histograms.
4. Image Transformation: Implement a function translate(image, x_shift,
y_shift) or rotate(image, angle) that performs a simple translation or rotation
on the image. Briefly explain the concept of image transformation and its
applications.

Bonus:

• Implement functions to handle color images by working with individual color


channels (e.g., RGB) or converting to grayscale before processing.
• Explore more advanced filters or transformations and compare their effects on the
image

You might also like