Question: Image Filtering In this task you will write your own convolution operator for linear spatial filtering of digital images in Python and investigate the effects

Image Filtering In this task you will write your own convolution operator for linear spatial filtering of digital images in Python and investigate the effects of different filter masks or kernels. 1.1 Convolution Operator Write your own function that implements the discrete 2D convolution operator (please note that here convolution means general correlation operator, and "convolving a mask with an image" denote the sliding, sum-of-products process). Given an intensity image and a filter mask (a matrix with coefficients) your function should convolve the source image with the filter mask and return the resulting output image. You may assume that the filter mask is a square matrix with odd size (e.g. 33,55,77 ). You will need to decide on a sensible strategy for dealing with the image borders. An example skeleton for you function code is given as follows. function [im out ]= my conv2 (im in, kernel) \% IM_OUT = MY_CONV2(IM_IN, KERNEL) convolves the input image IM_IN % with the filter KERNEL and returns the result in IM_OUT \% IM_IN, IM_OUT, and KERNEL are of DOUBLE precision %... here goes your code ... end 1.2 Smoothing Filters Using your implementation of the convolution operator, try out and compare the following smoothing filters on the image clown.tif. The filters are described in the lecture slides and the course book. (1) Mean filter: sizes 33,55, and 99. What effect has the size of the filter kernel
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
