Understanding 2D Fourier space

Build your 2D Fourier intuitions for real-value imagery

Peter Barrett Bryan
4 min readMar 29, 2023
Using the Fourier transform to extract features at orientations. Image by author.

Feel free to reuse the images from this article in any context without attribution (no rights reserved).

Motivation

Whether you are getting familiar with the “polar raster” of synthetic aperture radar samples or MRI “k-space,” you are dealing with the same fundamental representation: 2D Fourier space. It can be intimidating!

Previously, we’ve explored lots of different ways to get comfortable with the mechanics of the Fourier transform:

This time, we’ll take a look at some example 2D FFTs of real-valued images to build intuitions. As a computer vision practitioner, a good grasp on 2D FFTs will allow you to perform training data augmentation, filter artifacts, and understand common compression techniques.

Instructive examples

In each example, the 2D FFTs have been shifted so that the DC (i.e., 0Hz) term is at the center. Phase values are only interpretable when magnitude isn’t near zero, so I’ve zero-ed out phase components that correspond to small magnitude terms.

Uniform energy

A uniform image is just a point in Fourier space. There are no meaningful frequency contents, just a 0Hz term.

Image by author.

Uniform noise

Uniform noise looks like uniform noise in both magnitude and phase.

Image by author.

Low frequency horizontal sinusoid grating

A simple horizontal grating corresponding to a pure-tone sinusoid is represented by two non-zero terms in Fourier space. The two points are vertically offset from the origin. Why two? This is because the Fourier transform of a real-valued input is Hermitian.

Image by author.

High frequency horizontal sinusoid grating

Higher frequency terms are farther from the origin.

Image by author.

Low frequency vertical sinusoid grating

Vertical sinusoids show us the same, but are offset from the origin horizontally.

Image by author.

High frequency vertical sinusoid grating

Same as above!

Image by author.

Checkerboard (2D sinusoid)

Two-dimensional sinusoids are a combination of horizontal and vertical frequency terms.

Image by author.

Circular support

A circular support in pixel space gives us an Airy disk in Fourier space. This is actually really interesting! This corresponds to how light would be focused by a perfect, diffraction-limited lens.

Image by author.

Rectangular support

A rectangular support gives us a nice two-dimensional sinc function.

Image by author.

Camera man

Natural images are composed of lots of frequency components. In this image, we can see lots of energy at the cardinal orientations and two other angles.

Image by author.

Low frequency camera man

If we remove all the terms beyond a given radius, we can filter out all the high-frequency content (i.e., the edges).

Image by author.

High frequency camera man

Or we can remove all the terms near the center, recovering just the edges.

Image by author.

Orientation filter

If we grab the Fourier components along an angular slice, we can grab just the edges at that orientation.

Image by author.

Thanks for reading! I hope you learned something!

--

--

Peter Barrett Bryan

Software engineer with specializations in remote sensing, machine learning applied to computer vision, and project management.