From 36c632d28d09f2fc9a5e855cb0e499bcf0632030 Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Fri, 14 Sep 2012 20:01:20 -0400 Subject: Use received image size instead of hard coded --- stripeeraser.m | 7 ++++--- 1 file 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. -- cgit v1.2.3