Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. fid=fopen('lena_rumorosa.raw','rb');
  2. if fid<0
  3. error('Errore apertura');
  4. end
  5. x=(fread(fid,[256 256],'float'))';
  6. figure;
  7. imshow(x,[]);
  8.  
  9. k=15;
  10. cu=1/(sqrt(2)*2);
  11.  
  12. sigmal=colfilt(x,[k k],'sliding',@std);
  13. mul=colfilt(x,[k k],'sliding',@mean);
  14.  
  15. cx=sigmal./mul;
  16. r=cu^2./(cx.^2);
  17. wl=(1-r)./(1+cu^2);
  18.  
  19. if r>1
  20. y=mul;
  21. else
  22. y=(x.*wl)+mul.*(1-wl);
  23. end
  24.  
  25. imshow(y,[]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement