%% MATH3360 Hw5 Image deblurring in frequency domain
% In your script, you should have at least four functions, namely dft.m,
% idft.m, LPBufilter.m, which you have written in hw4, and Wefilter.m for 
% the discrete Fourier transform, the inverse discrete Fourier transform,
% the low-pass Butterworth filter and Weiner filter respectively.
clear all
I=imread('blur.png');
I=double(I);
% Multiply $I(x,y)$ by $(-1)^{x+y}$
% Apply DFT
%-----------------
%Direct inverse Butterworth low-pass filter with n=2






imwrite(G,'lena_direct_inverse.png')
%--------------------
%Wiener filter







imwrite(G,'lena_wiener_0.01.png')
%---------------------------







imwrite(G,'lena_wiener_1.png')
%---------------------------







imwrite(G,'lena_wiener_100.png')