Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I see a few problems going on here. </p> <p>First, you need to use the <a href="http://opencv.itseez.com/modules/core/doc/operations_on_arrays.html?highlight=mulspectrums#void%20mulSpectrums%28InputArray%20src1,%20InputArray%20src2,%20OutputArray%20dst,%20int%20flags,%20bool%20conj%29" rel="nofollow noreferrer">mulSpectrums</a> function to convolve two FFTs, and <strong>not</strong> <a href="http://opencv.itseez.com/modules/core/doc/operations_on_arrays.html?highlight=multiply#multiply" rel="nofollow noreferrer">multiply</a>.</p> <p>Second, the <code>createGaussianHighPassFilter</code> is only outputting a single channel non-complex filter. You'll probably need to just set the complex channel to <code>Mat::zeros</code> like you did for your input image.</p> <p>Third, don't convert the output of the FFT to log-magnitude spectrum. It will not combine correctly with the filter, and you won't get the same thing when performing the inverse. So, just return <code>complexImg</code> right after the DFT is executed. Log-magnitude spectrum is useful for a human to look at the data, but not for what you are trying to do.</p> <p>Finally, make sure you pay attention to the difference to between the full-complex output of <code>dft</code> and the Complex Conjugate Symmetric (CCS) packed output. Intel has a good page on how this data is formatted <a href="https://software.intel.com/en-us/node/504243" rel="nofollow noreferrer">here</a>. In your case, for simplicity I would keep everything in full-complex mode to make your life easier.</p> <p>Hope that helps!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload