Assignment #1: Linear Filters

Due date: 17/03/2016

Implement the code to apply a linear filter both in the spatial and frequency domain domain (you can use the built-in fft function). Filter this image using this motion blur filter. Note that the filter center is at pixel location (16,16).

Implement the Weiner filter inversion algorithm to invert the previous motion blur from this noisy e blurred image.

Note: the filter sould be extended and re-centered before computing the Fourier transform. The center should be on pixel (0,0) and wrap around due to the periodicity.

Note 2: when you load the filter image, it will give you a matrix of values from 0 to 255. If you convolve the picture with the filter as is youw will increase the total luminance of the resulting image. To avoid this rescale the filter matrix in such a way as that the sum of its entries is equal to 1.

Note 3:In the notes the Weiner filter was defined as

,
but this formulation is numerically unstable when H(u,v)=0. To make it stable, note that for a complex number z, we have z*conj(z)=||z||2, from which we get
.

Deliver a report where you discuss the implementations and show the performance of the Weiner as you vary the parameter K.