DFT and Inverse DFT in Image Processing I have implemented DFT from this link.

1) Tried taking dft for the three Channels(R, G and B) and reconstructed the original image by taking inverse dft for all three channels and merged them together, but the image reconstructed doesnot have the same contrast as the original image.

But while altering the flags used in the link as such

  dft(input, Complex, DFT_SCALE);
  dft(Complex, InverseDFTImage, DFT_INVERSE + DFT_REALOUTPUT);
  InverseDFTImage.converTo(InverseDFTImage, CV_8U);


The output is same as the input, but while applying Gaussian filter, there are few colour differences near the edges.

 1. Original Input Image 
 

 2. Output without any filters(followed the Procedure in the link) 
 

 3. After applying Gaussian Low Pass Filter 
  

 Can someone clarify this doubt.? 
 P.S Thanks in advance
I saw same issue, and I found the answer here.
for short, you can set imaginary part of filtering kernel zeros before you call mulSpectrums.  

Mat planes[] = {Mat::zeros(dftImage1.size(), CV_32F), Mat::zeros(dftImage1.size(), CV_32F)};   
Mat kernel_spec;   
planes[0] = your_filter; // real     
// planes[1] = your_filter; 
// imaginar should be zero! Don't touch it.   
merge(planes, 2, kernel_spec);     
mulSpectrums(...  


Hope this helps.