summaryrefslogtreecommitdiff
path: root/stripeeraser.m
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2012-09-14 20:01:20 -0400
committerEugeniy Mikhailov <evgmik@gmail.com>2012-09-14 20:01:20 -0400
commit36c632d28d09f2fc9a5e855cb0e499bcf0632030 (patch)
treec67b51ce54fe330fdf2e427cf07abff6bd6b318a /stripeeraser.m
parent0aaf56be64902fb12e53a3e1ee9c4f6855e87eb2 (diff)
downloadbeam_profiler-36c632d28d09f2fc9a5e855cb0e499bcf0632030.tar.gz
beam_profiler-36c632d28d09f2fc9a5e855cb0e499bcf0632030.zip
Use received image size instead of hard coded
Diffstat (limited to 'stripeeraser.m')
-rw-r--r--stripeeraser.m7
1 files changed, 4 insertions, 3 deletions
diff --git a/stripeeraser.m b/stripeeraser.m
index c7290ed..a8ecf22 100644
--- a/stripeeraser.m
+++ b/stripeeraser.m
@@ -9,9 +9,10 @@ function [img_cleaned,imfourier]=stripeeraser(img,radius,threshold_power)
immask=fftshift(fft2(img)); % move to Fourier space
max1=max(abs(immask(:)));
-for x=1:640
- for y=1:480
- d=sqrt((x-320)^2+(y-240)^2);
+[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
% for high enough frequency components
%The filter works like a neutral density filter.