summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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