Hamming filter to reduce ringing artifact in image

998 Views Asked by At

I have a low-resolution image (sLR) which is generated by selecting the central part of the reference high-resolution image (sHR) in the frequency (k-space) domain in row-direction. When I zero-pad this low-resolution image in frequency-domain, I get ringing artifact in the spatial domain as it is expected. I try to remove this artifact by filtering the image using Hamming window. Please see my code below. I have doubts about applying fft and ifft to the image and also filtering process, and I would be thankful if someone could please review my code and confirm it is correct.

% sHR: HR reference image
n = size(sHR,1);
kspHR = fftshift(fft(sHR,n,1),1)/n; % HR image in k-space

% Generating LR image (LR in row-direction)
kspLR = kspHR((n/2)-(n/4)+1:(n/2)+(n/4),:); 
sLR = real(ifft(ifftshift(kspLR,1),n,1)))*n; 

% Zero-padding
a = floor(size(kspLR,1)/2);
kspZP = padarray(kspLR, a ,'both');
sZP = real(ifft(ifftshift(kspZP,1),n,1)))*n;% image with Ringing artifact

% Apply Hamming filter to Zero-padded kspace image (kspZP)
[r,c]=size(abs(kspZP));
w = hamming(r);
W = repmat(w,[1,c]);
kspHM = W.*kspZP
sHM = real(ifft(ifftshift(kspHM,1),n,1)))*n; % Filtered image in spatial domain

My second question is when I use iffft, the output image usually has negative intensities. For further processing in the Spatial domain, is that okay if I normalize the image intensity in a way that the minimum intensity of the image is 0? or should I use the absolute of the image?

1

There are 1 best solutions below

3
On BEST ANSWER
  1. This is not a standard use of a Hamming window, but being a sort of Gaussian shape it might help. Try applying the window (or some other frequency response) instead of clipping out the central part of the spectrum, or fit it into the central part. Othewrwise, the sharp cutoff will remain, and so will the ringing.

  2. I'd suggest clipping those negative values to zero using max(0,..., since they represent ringing that you don't want. Maybe also clip unexpectedly large values to 1.