Note that there are some explanatory texts on larger screens.

plurals
  1. POQuestions about Low-pass filter in frequency domain
    primarykey
    data
    text
    <p>I'm dealing with a small project with OpenCV &amp; C++, maybe the following questions are naive, but I'll be very grateful if anyone could offer help.</p> <p>Being new here, I don't have enough reputation to post images, so I'll try to make it clear.</p> <p>I'm trying to denoise an image (MxN = 200x200 Mat) in frequency domain,</p> <p>and say I have a UxV=3x3 Gaussian kernel {{0, -1, 0},{-1, 4, -1},{0, -1, 0}}, and the <a href="https://stackoverflow.com/a/7080028/2918210">expected steps</a> are:</p> <blockquote> <ol> <li>zero-pad the kernel up to (M+U-1) x (N+V-1)</li> <li>take the 2-D fft of the kernel</li> <li>zero-pad the image up to (M+U-1) x (N+V-1)</li> <li>take the 2-D FFT of the image</li> <li>multiply FFT of kernel by FFT of</li> <li>image take inverse 2-D FFT of result</li> </ol> </blockquote> <p>Both The result of step 2 (fft of the kernel) and the final result (filted image) seems right, but then I found <a href="https://stackoverflow.com/a/3558570/2918210">this answer</a>:</p> <blockquote> <p>you do need to make K as big as I by padding it with zeros. <strong>Also, after padding, but before you take the FFT of the kernel, you need to translate it with wraparound, such that the center of the kernel (the peak of the Gaussian) is at (0,0). Otherwise, your filtered image will be translated.</strong></p> </blockquote> <p>That's what I didn't do. But how could the result seems acceptable? So I'm now wondering what's the difference between whether moving the kernel to make its center is at (0, 0) before fft?</p> <p>Here comes my 2nd question. If we got an shifted fft of an image (with the 0 frequency in the middle), can I just do this to obtain a 'low-pass' effet:</p> <p>For the pixels whose distance from the center is bigger than a threshold, set their value 0.</p> <p>(I think it's straight forward, but haven't found some similar methods widely used.)</p> <p>Thank you VERY much for offering any help :-)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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