Implement an ideal low-pass filter in the frequency domain to remove high-frequency components from an image spectrum. This process involves modifying the frequency representation of an image to only retain frequency components below a specified cutoff frequency.
The concept of filtering in the frequency domain is rooted in the Fourier Transform, which decomposes a signal into its constituent frequencies. In image processing, this allows for the separation of low-frequency components, representing overall brightness and shape, from high-frequency components, representing details and noise. By applying a low-pass filter, we can reduce noise and blur an image.
To achieve this, we follow these steps:
This technique is widely used in image denoising applications.
low_pass_filter([10, 5, 3, 1, 1, 3, 5], 2)
[10, 5, 3, 0, 0, 3, 5]