gogoWebsite

matlab exercise program (image Fourier transform, amplitude spectrum, phase spectrum)

Updated to 2 days ago
cl;
img=imread('');
%img=double(img);
f=fft2(img); %Fourier transform
f=fftshift(f); % makes the image symmetric
r=real(f); %image frequency domain real part
i=imag(f); %image frequency domain imaginary part
margin=log(abs(f)); %image amplitude spectrum, adding log for easy display
phase=log(angle(f)*180/pi); %image phase spectrum
l=log(f);
subplot(2,2,1),imshow(img),title('Source image');
%subplot(2,2,2),imshow(l,[]),title('Image spectrum');
subplot(2,2,3),imshow(margin,[]),title('Image amplitude spectrum');
subplot(2,2,4),imshow(phase,[]),title('Image phase spectrum');