Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. %% Question 1
  2. figure;
  3. IM = fft2(double_image);
  4. imshow(log(fftshift(abs(IM))+1e+2),[]);
  5. title('Log-amplitude spectrum');
  6. xlabel('u');
  7. ylabel('v');
  8. print('Imlogmag_Ex1_Q1', '-dpng', '-r150'); %%Save image.
  9.  
  10. %% Question 3
  11. psf = fspecial('average', [7,1]); %% create filter for this image
  12. filtered_image = imfilter(double_image, psf, 'replicate'); %% filter image with the PSF
  13. figure, imshow(filtered_image); %% create dialog showing the filtered image
  14. imwrite(filtered_image,'IMfil.jpg'); %% Save filtedred image
  15.  
  16. figure;
  17. IM2 = fft2(filtered_image); %% Create fourier transform out of the filtered image
  18. imshow(log(fftshift(abs(IM2))+1e+2),[]); %% Create log-aplitude spectrum with filtered image and show
  19.  
  20. %% Question 4
  21. figure
  22. otf = psf2otf(psf, size(filtered_image));
  23. imshow(fftshift(abs(otf)),[]);
  24. print('OTF_logmag_Ex4_Q1', '-dpng', '-r150'); %%Save image.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement