In Image Processing, we will using FFT operation many times. Ufortunately, OpenCV only came with DFT function. So we need to use a third party FFT library in order to perform FFT operation. FFTW is a good choice. It's very fast and freely available at http://www.fftw.org. This is an example on how to perform FFT operation using FFTW in OpenCV. It simply loads an image, compute FFT & IFFT, then display the final result. The resulted image has no difference with the original, as it should.