Hamming filter to reduce ringing artifact in image
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.
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?
% 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; % this image has negative intensity values?% 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
ANSWER
Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and
research.
Windows are designed to smooth out the transition between the content and the zero-padded region, so apply them just to the data itself before zero-padding. I’ve tweaked your code to use that instead and a Kaiser window (experiment with beta values between zero and, say, four).
Maybe something like:
load penny;
sHR = -del2(P);
subplot(1,2,1);
imagesc(sHR);
colormap copper
shading flat
axis equal% 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),:);
SEE COMPLETE ANSWER CLICK THE LINK
https://www.matlabsolutions.com/resources/hamming-filter-to-reduce-ringing-artifact-in-image.php