1
$\begingroup$

I am working with images and Fourier transforms. I am trying to understand what might be causing some artifacts in my output image.

I am starting with a 512x512, RGB image of Lenna. I FFT the image, and run a low-pass filter on it. Unchanged for everything inside the circle, 0 for everything outside the circle. Here is what the mask looks like:

Mask

So far so good. When I inverse FFT back to an image, I get bright green artifacts: Lenna

These look out of place to me, what might be causing them? Is it the sharp cutoff in my filter? I would have guessed that would creating ringing artifacts, but nothing like a sharp color blob. Also why green only? It's not like there's a lot of green in the original.

I'm using numpy on python 2.7.6 in 64-bit Linux, if that matters.

$\endgroup$
  • $\begingroup$ could it be that your pixel channel values overflow? $\endgroup$ – Jazzmaniac Aug 2 '14 at 21:34
1
$\begingroup$

Sharp cutoffs can cause ringing. If any ringing artifacts go outside the legal range of color values (e.g. without being clamped), they can overflow or numerically wrap and cause these bright color spot artifacts in dark areas of the image.

$\endgroup$
  • $\begingroup$ That was it! Examining the actual values before converting to an image showed negative values. Apparently numpy wraps these around 255 when converting to uint8. Makes sense now, but I didn't think of it before. $\endgroup$ – Wisco crew Aug 4 '14 at 1:56
0
$\begingroup$

Some things you should keep in mind:

  1. Your image is real, keep your DFT Symmetric.
  2. Numerical issues might cause that after the Inverse DFT imaginary parts are lefts.
    Use either abs or real to get rid of them.
  3. One should understand what it means to "Zero" out by mask DFT values.
    It is not the "Ideal LPF". It causes Ringing / Halos due to Gibbs Phenomenon. One should use better designed LPF.

I hope it helps.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.