clear all;close all; clc;
I = imread('FFT_src_lowres.jpg');
figure(1);imshow(I);%original image
I = rgb2gray(I);
[r,c] = size(I);
for i = 1:r
X(i,:) = fft(I(i,:));
end
for j = 1:c
Y(:,j) = fft(X(:,j));
end
figure(2);imshow(I);%Gray scale image
M = Y;
Msh = fftshift(M);%Shift low frequency to the centre
Ab = abs(Msh);%magnitude
% Normalized to display the magnitude
Ab = (Ab - min(min(Ab)))./(max(max(Ab))).*255;
figure(3);imshow(Ab);%Centered fourier transform of an image
M1=log(1+abs(Msh));%Log transform
figure(3);imshow(M1,[]);


