# Removing periodic noise from an image using the Fourier Transform

32 Ansichten (letzte 30 Tage)
Blob am 7 Mär. 2023
Bearbeitet: Blob am 7 Mär. 2023
So I have an image that has horizental lines (noise), in other to get ride of them I worked with the Fourier Transform, however this is the result I get. Here is my code:
figure, imshow(im3);
frequencyImage = fftshift(fft2(im3));
% Take log magnitude so we can see it better in the display.
amplitudeImage = log(abs(frequencyImage));
minValue = min(min(amplitudeImage))
maxValue = max(max(amplitudeImage))
imshow(amplitudeImage, []);
amplitudeThreshold = 10.9;
brightSpikes = amplitudeImage > amplitudeThreshold; % Binary image.
imshow(brightSpikes);
frequencyImage(brightSpikes) = 0;
% Take log magnitude so we can see it better in the display.
amplitudeImage2 = log(abs(frequencyImage));
minValue = min(min(amplitudeImage2))
maxValue = max(max(amplitudeImage2))
imshow(amplitudeImage2, [minValue maxValue]);
filteredImage = ifft2(fftshift(frequencyImage));
amplitudeImage3 = abs(filteredImage);
minValue = min(min(amplitudeImage3))
maxValue = max(max(amplitudeImage3))
imshow(amplitudeImage3, [minValue maxValue]);
##### 0 Kommentare-1 ältere Kommentare anzeigen-1 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Antworten (2)

Image Analyst am 7 Mär. 2023
An image is generally composed of a lot of energy in the low spatial frequencies and less in the higher frequencies. In the high frequencies you may see spikes that stick up but it's likely your spikes were not higher than the low frequencies. You can't just threshold the image or else you will take out the main part of the signal, like you did, which is why the image is mostly black. You essentially did a low pass filter in addition to any removal of periodic noise spikes. See my attached demo.
Also, attach 'louvreSin.png'.
If you have any more questions, then attach your image and code with the paperclip icon after you read this:
##### 0 Kommentare-1 ältere Kommentare anzeigen-1 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

Blob am 7 Mär. 2023
Bearbeitet: Blob am 7 Mär. 2023
Here is the image attached, btw where is you demo? @Image Analyst
##### 0 Kommentare-1 ältere Kommentare anzeigen-1 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Kategorien

Find more on Smoothing and Denoising in Help Center and File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!