diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2012-09-14 20:03:46 -0400 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2012-09-14 20:03:46 -0400 |
commit | 594364e4f94f0b4d57d4e5dc14d69c9d1fb00d4c (patch) | |
tree | 4ad7dfe209feec923a7ac33e16688f9f6727ed9f /stripeeraser.m | |
parent | 36c632d28d09f2fc9a5e855cb0e499bcf0632030 (diff) | |
download | beam_profiler-594364e4f94f0b4d57d4e5dc14d69c9d1fb00d4c.tar.gz beam_profiler-594364e4f94f0b4d57d4e5dc14d69c9d1fb00d4c.zip |
better and meaningful names for variables
Diffstat (limited to 'stripeeraser.m')
-rw-r--r-- | stripeeraser.m | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/stripeeraser.m b/stripeeraser.m index a8ecf22..417f333 100644 --- a/stripeeraser.m +++ b/stripeeraser.m @@ -1,4 +1,4 @@ -function [img_cleaned,imfourier]=stripeeraser(img,radius,threshold_power) +function [img_cleaned,img_fourier]=stripeeraser(img,radius,threshold_power) % Cleans an image from the stripes produced by interference fringes. % Such parallel fringes appears like a strong peak in the Fourier transformed image. % so it easy to clean them, especially if their spatial frequency is high. @@ -7,8 +7,8 @@ function [img_cleaned,imfourier]=stripeeraser(img,radius,threshold_power) % by suppressing them with exponential factor which is increases with distance % from the center i.e. zero spatial frequencies. -immask=fftshift(fft2(img)); % move to Fourier space -max1=max(abs(immask(:))); +img_fourier=fftshift(fft2(img)); % move to Fourier space +max1=max(abs(img_fourier(:))); [Ny, Nx] = size (img); % image size for x=1:Nx for y=1:Ny @@ -16,14 +16,13 @@ for x=1:Nx if d>radius % for high enough frequency components %The filter works like a neutral density filter. - if abs(immask(y,x))>max1*(10^(-threshold_power)); + if abs(img_fourier(y,x))>max1*(10^(-threshold_power)); % Suppress this frequency components which are mostly stripes % but leave untouched small sharp features of the beam % since they are spectrally weak - immask(y,x)=immask(y,x)*exp(-(d/radius)^2); + img_fourier(y,x)=img_fourier(y,x)*exp(-(d/radius)^2); end; end; end; end; -imfourier=immask; -img_cleaned = abs( ifft2(ifftshift(immask)) ); +img_cleaned = abs( ifft2(ifftshift(img_fourier)) ); |