# Image processing fun with FFT! (i)

Okay, so I wouldn’t really classify Fast Fourier Transforms (FFT) as fun, but in their day, they were heavily used by people doing image processing. They still are to some extent, and there are some things they really excel at. One of those is removing periodic noise – the type of noise no spatial filter would come close to being able to remove.

The basics? A transform takes one signal and transforms it into another. The Discrete Fourier Transform (DFT) is one such function. Problem is it’s *really slow. In 1969, a 2048 point analysis of a seismic trace took 13 ½ hours. The FFT is a very efficient algorithm for performing a DFT – the same seismic trace took 2.4 seconds with the FFT. In image processing it is most often used for image restoration purposes. The FFT basically converts a signal from space domain to frequency domain.

Consider this image and its power spectrum derived using ImageJ.

Grayscale image

FFT Power spectrum (ImageJ)

Now in ImageJ, if we cut a portion of the power spectrum away, and leave it set to black, then we effectively filtering those frequencies.  If we cut a portion, but invert it to white, we are passing those frequencies. Consider the examples below, which illustrate these two scenarios applied to the power spectrum image above.

Filtering out versus passing frequencies

The results are shown below (after applying the inverse FFT). Using the “filter” option filters out the low frequency components of the image, leaving only the high frequency components. Using the passing filter, passes *only* the low frequency components, effectively removing all the edge structures, and leaving a blurry mess.

High frequency filter (top) versus low frequency passing (bottom)

Next post I’ll show you how to remove periodic noise.

## One thought on “Image processing fun with FFT! (i)”

This site uses Akismet to reduce spam. Learn how your comment data is processed.