From d1d7a486cc70665dafe64aaddd44c58e228815b0 Mon Sep 17 00:00:00 2001 From: Mi Zhang Date: Tue, 11 Sep 2012 16:03:41 -0400 Subject: initial commit --- stripeeraser.m | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 stripeeraser.m (limited to 'stripeeraser.m') diff --git a/stripeeraser.m b/stripeeraser.m new file mode 100644 index 0000000..2ff6107 --- /dev/null +++ b/stripeeraser.m @@ -0,0 +1,15 @@ +function [immask,imfourier]=stripeeraser(img,radius,filter) +immask=fftshift(fft2(img)); +max1=max(immask(:)); +for x=1:640 + for y=1:480 + d=sqrt((x-320)^2+(y-240)^2); + if d>radius %Outside the central frequency. + if abs(immask(y,x))>max1*(10^(-filter)); %The filter works like a neutral desity filter. + immask(y,x)=immask(y,x)*exp(-(d/radius)^2); %Erase the frequency of the stripes. + end; + end; + end; +end; +imfourier=immask; +immask=ifft2(ifftshift(immask)); \ No newline at end of file -- cgit v1.2.3