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.

tank

Grayscale image

tankfft

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.

tankfft2

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.

tankfft1

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

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

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s