Remove artefact using fourier filter
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a coin image where mid portion became dark after processing of the data, now i am trying fourier filter to remove artefact, but ig i'm not able to correctly remove artefacts.
My attempt:
function img_back=fftSaft(maxarray)
figure(1);
subplot(2,2,1);
%maxarray=medfilt2(maxarray,[2 2]);
maxarray=imgaussfilt(maxarray,0.8);
maxarray=imsharpen(maxarray);
imshow(maxarray,[]);
af=fftshift(fft2(maxarray));
subplot(2,2,2);
mag=20*log(abs(af));
imshow(mag,[]);
rows=size(maxarray,1); cols = size(maxarray,2);
crow=floor(rows/2);ccol = floor(cols/2);
%af(crow-0.5:crow+0.5, 1:ccol-5) = 0;
%af(crow-0.5:crow+0.5, ccol+6:end) = 0;
af(af>60 & af<150)=0;
subplot(2,2,3);
magnitude_spectrum_no_vertical = 20*log(abs(af));
imshow(magnitude_spectrum_no_vertical,[]);
iaf=ifftshift(af);
img_back=ifft2(iaf);
img_back=real(img_back);
img_back=imsharpen(img_back);
subplot(2,2,4);
imshow(img_back,[]);
end
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1044390/image.png)
0 commentaires
Réponses (1)
Image Analyst
le 8 Sep 2022
Where exactly is the artifact in that image?
I don't know that Fourier filtering could get rid of an artifact such as darkening. You should figure out why your processing made the middle darker in the first place.
If you have any more questions, then attach your original image and code to read it in with the paperclip icon after you read this:
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!