Search code examples
c#image-processingfilteringfrequency-analysis

How to implement smoothing in frequency domain?


I want to do smoothing to an image in the frequency domain. when i use google to see any articles it gave some Matlab codes which i don't need. i could do FFT to an image but i don't know how to implement any smoothing techniques(ILPF, BLPF, IHPF, BHPF) in frequency domain. if you can provide any code samples for any of the above techniques WITHOUT using any image processing libraries it will be really helpful and C# is preferred.

Thanks,


Solution

  • Could you define what you mean by 'smoothing in the frequency domain'? You can generate a spectrum image using FFT and multiply the image by some function to attenuate particular frequencies, then convert the spectrum back to an image using the inverse-FFT. However, for this kind of filtering (multiplication by some scaling function in frequency), you can achieve the same result more quickly by convolving with the dual function in the spatial domain.

    In any case, if you wish to implement this yourself, read up on FFT (the fast Fourier transform) and convolution. You might also check out a signal processing textbook, if you're interested, as the theory behind discrete filtering is fairly deep. The algorithms won't make a whole lot of sense without that theory, though you can certainly apply them without understanding them.


    If you want to implement your own DSP algorithms, check out this book online. In particular, Ch 33 describes the math and algorithm behind Butterworth filter design. Ch 12 describes how to implement FFT.