Advertisement
Guest User

Noise

a guest
Dec 6th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.46 KB | None | 0 0
  1. i = imread("spillway.tif");
  2. figure(1), imshow(i)
  3.  
  4. %add noise
  5. in = imnoise(i,'gaussian');
  6. figure(2), imshow(in)
  7.  
  8. %remove noise
  9. irn = imfilter(in, fspecial('average'));
  10. figure(3), imshow(irn)
  11.  
  12. %add noise in transform domain remove it,
  13. %and then compare the original image and the final
  14. % one (the one that is filtered)
  15. i_fft = fft(i);
  16. in_fft = imnoise(i_fft, 'gaussian');
  17. denoise = imfilter(in_fft, fspecial('average'));
  18.  
  19. figure(5), imshow(ifft(denoise), [])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement