Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment: 1. Write a python function to perform convolution on an image using a kernel. The inputs to the function will be an image, a

Assignment:

1. Write a python function to perform convolution on an image using a kernel. The inputs to the function will be an image, a kernel, the stride and whether padding will be performed or not (binary variable True/False). The image will be greyscale, so it will be 2D. The kernel will also be 2D. The function should be able to add the required padding (zero padding) based on the kernel size if padding input is True. The function will return the result of the convolution operation.

2. Write a python function to perform 2x2 pooling. The inputs to the function will be a 2D image, poling kernel size (2,3 etc) and the stride. The function return the result of the pooling.

3. Write a python function that will take your 8 digit ID=20 30 13 72 , your section number= 09 and construct a 3x3 kernel using these 9 digits.

Now using your developed functions, read an input image and convert it to greyscale. Then using your ID and section, construct a 3x3 kernel and perform convolution on the image followed by pooling. Your code will then print out the input image, the kernel and the resulting image after pooling. Now experiment with the input parameters of the functions (padding, kernel size, pooling kernel size etc.). You are required to submit your python code (notebook or python file) and a small report. The report does not need to be detailed, it should only contain your input image, the kernel and the resultant images that you obtained by playing around with the parameters.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Decisions Based On Data Analytics For Business Excellence

Authors: Bastian Weber

1st Edition

9358681683, 978-9358681680

More Books

Students also viewed these Databases questions