Write your own m-functionmy imfilter that implements the discrete 2D correlation operator. You may assume that the kernel h is a square matrix with odd size (2a + 1) x (2a + 1). Since the kernel falls off the border of the image for the pixels close to the image border, you need to pad Os outside
the image. For this purpose, you can use padarray function of MATLAB.
function im out = my (im in, h)
im out = my imfilter(im in, h)
correlation Of the input image im in with the kernel h
im in and h are of double precision
To be done: implementation of correlation
You can check whether your solution is correct or not by comparing the result returned from your function my imfiiter (double (im_in) , double (h) ) With the result obtained by calling MATLAB function imfilter (double (im in) ,double (h) ) . Notice that you need to convert the arguments
to double precision during calling these functions.