plz help with problem 5 only
4. Implement convolving a kernel with an image in code (you can implement this as a function, or just as a script, whatever works for you). Specifically your code should takes two inputs: an array representing an image of size M N and an array representing a kernel of size k k where k is odd. Your code should pad your input image with the appropriate amount of zeros, perform the convolution, and output the resulting image.
(a) Use your code to verify your answer to 2(a).
b) Use your code on the image hw2img4.t if using a box kernel,defined as
of size k k for k = 3,11, and 21. Show each resulting image. Discuss the impact of the choice of k on the output image. Discuss the impact of using zero padding
(c) Repeat (b) using a Gaussian kernel, defined as
2+12 Wgs,t)=Ke-22
(1)
of size 43 x43 where o=2,and 7.Use K= Show each resulting image. Discuss 2T0 the impact of the choice of o on the output image. Discuss the impact of using zero padding.
5. Propose another method for padding an image (other than zero padding) to combat the impact seen in parts 4(b and 4(c). You do not need to implement it in your code,just describe your proposed method and explain why you think it would prevent the issue seen in 4(b) and 4(c).