We can implement a LPF on an image with the following steps:
- Perform a 2D FFT with scipy.fftpack fft2 and obtain the frequency domain representation of the image
- Keep only the low frequency components (get rid of the high frequency components)
- Perform an inverse FFT to reconstruct the image
The Python code to implement an LPF is shown in the following code. As can be seen from the next screenshots, the high frequency components correspond more to the average (flat) image information and the detailed information (for example, the edges) of an image is lost as we get rid of more and more high-frequency components.
For example, if we keep only the first-frequency component and discard all others, in the resulting image ...