Weiner deconvolution using opencv
<p>I have developed a way to estimate the point spread function of a motion blur, however I'd like to use the PSF to perform deconvolution. I decided to use the wiener method.</p>

<pre><code>  cv::Mat deconvolution(cv::Mat input, cv::Mat kernel){
     cv::Mat Fin, Fkern, padded_kern, Fdeblur,out;
     cv::normalize(kernel,kernel);
     cv::dft(input,Fin,cv::DFT_COMPLEX_OUTPUT);
     cv::copyMakeBorder(kernel,padded_kern,0,Fin.rows-kernel.rows,0,Fin.cols-kernel.cols,cv::BORDER_CONSTANT,cv::Scalar::all(0));
     cv::dft(padded_kern,Fkern,cv::DFT_COMPLEX_OUTPUT);
     cv::mulSpectrums(Fin,Fkern,Fdeblur,0,true);
     cv::dft(Fdeblur,out,cv::DFT_INVERSE|cv::DFT_REAL_OUTPUT);
     cv::normalize(out,out,0, 1, CV_MINMAX);
     return out;
   }
</code></pre>

<p>However even after setting        <code>cv::mulSpectrums(Fin,Fkern,Fdeblur,0,true);</code> last option to true, I still seem to be performing a normal convolution. Should'nt the last true option mean that I am multiplying by the conjugate and therefore dividing the kernel?</p>