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

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.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!