% load and show image X = imread('cameraman.tif'); figure(1) imshow(X,[]) title('original'); % define blurring operator H = zeros(size(X)); H(1,1:16) = (1/32)*ones(1,16); H(1,(size(H,2)-15):size(H,2))=(1/32)*ones(1,16); % blur using FFT and show fH =fft2(H); bX1 = ifft2(fH.*fft2(X)); figure(2) imshow(real(bX1),[]); title('horizontal blur'); % define blurring operator H = zeros(size(X)); H(1:16,1) = (1/32)*ones(16,1); H((size(H,2)-15):size(H,2),1)=(1/32)*ones(16,1); % blur using FFT and show fH =fft2(H); bX1 = ifft2(fH.*fft2(X)); figure(3) imshow(real(bX1),[]); title('vertical blur');