summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2012-09-14 20:14:17 -0400
committerEugeniy Mikhailov <evgmik@gmail.com>2012-09-14 20:14:17 -0400
commit80ee320af3b1e6470881f1f7b80eeab43413350c (patch)
tree730d199212ecfb9a004a0aa4aa449e8860ee91f5
parentfe56b83a7ab9ca84dc6c1c6a8babb6e78bae9b3a (diff)
downloadbeam_profiler-80ee320af3b1e6470881f1f7b80eeab43413350c.tar.gz
beam_profiler-80ee320af3b1e6470881f1f7b80eeab43413350c.zip
small speed up and improved readability
-rw-r--r--stripeeraser.m3
1 files changed, 2 insertions, 1 deletions
diff --git a/stripeeraser.m b/stripeeraser.m
index cd34d50..3198b1f 100644
--- a/stripeeraser.m
+++ b/stripeeraser.m
@@ -9,11 +9,12 @@ function [img_cleaned,img_fourier]=stripeeraser(img,radius,threshold_power)
img_fourier=fftshift(fft2(img)); % move to Fourier space
max1=max(abs(img_fourier(:)));
+threshold=max1*(10^(-threshold_power));
[Ny, Nx] = size (img); % image size
for x=1:Nx
for y=1:Ny
d=sqrt((x-Nx/2)^2+(y-Ny/2)^2);
- if d>radius && abs(img_fourier(y,x))>max1*(10^(-threshold_power))
+ if d>radius && abs(img_fourier(y,x))>threshold
% For high enough frequency components
% suppress this frequency components which are mostly stripes.
% But leave untouched small sharp features of the beam