SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. clerk=imread('clerk.tif');
  2. lena=imread('lena.tif');
  3.  
  4. clerk = imresize(clerk,0.5,'nearest')
  5.  
  6. %
  7. % fo_clerk=fftshift(fft2(clerk));
  8. % fo_lena=fftshift(fft2(lena));
  9. % figure('Name','clerk')
  10. % surf_clerk = surf(abs(log(fo_clerk)));
  11. % figure('Name','lena')
  12. % surf_lena = surf(abs(log(fo_lena)));
  13. %
  14. % figure('Name','phase clerk')
  15. % imagesc( angle(fo_clerk) )
  16. % figure('Name','phase lena')
  17. % imagesc( angle(fo_lena) )
  18.  
  19. %
  20. %
  21. % fun = @(x) abs(log(fftshift(fft2(x))));
  22. % blk = blkproc(clerk,[5,5],fun)
  23. % figure('Name','FClerk')
  24. % imagesc(blk)
  25. %
  26. % blk = blkproc(lena,[5,5],fun)
  27. % figure('Name','FLena')
  28. % imagesc(blk)
  29.  
  30.  
  31. lenafft=fft2(double(lena));
  32. clerkfft=fft2(double(clerk));
  33.  
  34. amplitude_lena = abs(lenafft);
  35. amplitude_clerk = abs(clerkfft);
  36.  
  37. %pase swap
  38. freq_lena = amplitude_lena .*exp(i*angle(clerkfft));
  39. freq_clerk = amplitude_clerk .*exp(i*angle(lenafft));
  40.  
  41.  
  42. inverselena= ifft2(freq_lena);
  43. inverseclerk= ifft2(freq_clerk);
  44.  
  45.  
  46.  
  47. figure('Name','lena')
  48. imshow(inverselena)
  49. figure('Name','clerk')
  50. imshow(inverseclerk)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top