Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.48 KB | None | 0 0
  1. %% filtr butterwortha, dolnoprzepustowy.
  2. a = imread('cameraman.tif');
  3. a = double(a)/255; %konwersja do doubli
  4. A = fftshift(fft2(a)); % transformata
  5. WA = abs(A);
  6. maska = zeros(size(a));
  7. maska(128,128) = 1;
  8. maska = bwdist(maska,'euclidean');
  9. N = 8;
  10. r = [5 10 20 50 100];
  11. for k=1:5
  12. %1/(1+(f/f0)^(2n))
  13. LP = 1.0./(1+(maska/r(k)).^(2*N));
  14. B=A.*LP;
  15. a_new=ifft2(ifftshift(B));
  16. subplot(2,3,k); imshow(a_new);
  17. title(['r = ', int2str(r(k)), 'px']);
  18. end
  19. subplot(236), imshow(a_new);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement