2D Fourier Transform

Image frequency analysis, edge detection, and compression

Fourier Analysis for Images

The Fourier transform extends naturally to 2D signals like images. Every image can be decomposed into 2D sinusoidal patterns at different frequencies and orientations.

This is the foundation of JPEG compression, MRI imaging, edge detection, and countless other image processing techniques.

How 2D FFT Works

The 2D FFT is computed by applying 1D FFTs first to all rows, then to all columns (or vice versa):

FFT_2D(image) = FFT_cols(FFT_rows(image))

Low Frequencies (Center)

Represent smooth regions, gradual color changes, and the overall brightness of the image.

High Frequencies (Edges)

Represent sharp edges, fine details, and rapid changes in pixel values.

Reading the Frequency Spectrum

The 2D magnitude spectrum shows:

  • Center: DC component (average brightness)
  • Distance from center: Frequency (higher = finer details)
  • Angle: Orientation of that frequency pattern
  • Brightness: Strength of that frequency component

Example: An image with strong horizontal lines will show bright spots along the vertical axis in its spectrum, because horizontal lines create vertical spatial frequencies.

Applications

JPEG Compression

Uses DCT (a variant of Fourier) to represent images efficiently by discarding high frequencies humans don't notice.

Edge Detection

High-pass filtering in frequency domain enhances edges by keeping only high-frequency components.

MRI Imaging

MRI machines directly measure the Fourier transform of tissue. The inverse FFT reconstructs the image.

Watermarking

Hidden watermarks can be embedded in the frequency domain, invisible but detectable.

Fast Image Convolution

Image filters (blur, sharpen, emboss) work by convolving with a kernel. Using the FFT, we can apply any filter size efficiently:

  1. FFT the image
  2. FFT the filter kernel (padded to same size)
  3. Multiply pointwise
  4. Inverse FFT

This is how Photoshop applies large-radius Gaussian blur instantly!