Applying Hann windowing function to an image in Octave/Matlab
-
08-06-2021 - |
Pergunta
If i understand the concept correctly, we apply a windowing function to the FFT of a signal to eliminate unwanted frequencies/noise.
How does one apply it to images since they are 2D matrices?
img = imread('file.png');
w = hann(512);
y = fft2(img);
where does one go from here? how do i take the FFT of an image with the hann function, for instance?
i was thinking maybe the pwelch method, but it won't work since y is not a vector
[spectra, freq] = pwelch(y, w, 0.5, 512, 512);
Solução
Usually a Hanning window is not applied to the results of the FFT, but to the data prior to the FFT. For the two dimensional case, you'll need to create a two dimensional Hanning window first. Please see this thread at matlab central for further details.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow