I have a simple Python 3 TKinter Image Editor using OpenCV3 and numpy. I wanted to implement a Fourier Transform and used the first example from here with numpy:
f = np.fft.fft2(img)
fshift = np.fft.fftshift(f)
magnitude_spectrum = 20*np.log(np.abs(fshift))
I can't just use fshift
as result and display it. Unfortunately the line with 20*np.log...
isn't explained on the site and reading other explanations for the fourier transform didn't explain it to me either.
Until now i have no parameter for this manipulation, but I tested that the output differs if I change 20 to something else. Should this be user configurable or why does this code example do this?