I try to remove periodic noise from image by using frequency domain techniques. Therefore, i want to use Butterworth filter.
Codes are following:
function main()
img = imread('A1.jpg');
Size = size(img);
red = img(:,:,1);
green = img(:,:,2);
blue = img(:,:,3);
redx = done(red,100);
greenx = done(green,100);
bluex = done(blue,100);
LAST = cat(3,redx,greenx,bluex);
showIm(LAST);
figure, imshow(LAST), title('new LAST channel');
end
function Resultx = done(Img,R)
Img = im2double(Img);
Size = size(Img);
Img = fft2(Img);
Img = fftshift(Img);
Result = createHandImg(R,Size, Img);
Result = ifft2(Result);
Result = real(Result);
Resultx = (abs(Result));
end
function Result=createHandImg(r,Size,FourrierImg)
[x,y]=meshgrid(-1*Size(2)/2:Size(2)/2 -1 ,-1 * Size(1)/2:Size(1)/2 - 1);
SqrtArray=1./(1+((x.^2+y.^2)/double(r)).^1);
Tresholded=(SqrtArray<r);
Result = FourrierImg.* Tresholded ;
end
My problem is that this codes can not change the noisy image. In other words, noisy image and "cleaned" image are almost the same. Even if I change the threshold, for our example it is 100 , image is only black or the same with noisy image. Does this code have problem? Also I try to Gaussian filter and other filter, but result is always the same. You can also propose other solution (in freq. domain) to remove periodic noise.
Thanks in advance.