Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

The (2D) Fourier transform is a very classical tool in image processing. It is the extension of the Fourier transform for signals which decomposes a signal into a sum of complex oscillations (actually, complex exponentials). In image processing, the Fourier transform decomposes an image into a sum of oscillations with different frequencies, phase and orientation.

So, the Fourier transform gives information about the frequency content of the image, i.e. how the intensities in the image are distributed through different frequencies. Figure 1 shows the decomposition of a synthetic image into oscillations. In this toy-example, the image is simple enough to be decomposed by using only three oscillations. We will see further that usual images need much more oscillations.

A synthetic image and the three oscillations (frequencies)
that compose the image.
The third oscillation (on the right) is of lower frequency than the first two oscillations,
because the alternation of black and white pixel is smoother than on the first oscillations.

Figure 1:A synthetic image and the three oscillations (frequencies) that compose the image. The third oscillation (on the right) is of lower frequency than the first two oscillations, because the alternation of black and white pixel is smoother than on the first oscillations.

Direct Fourier transform

The discrete Fourier transform (DFT) of an image ff of size M×NM \times N is an image FF of same size defined as:

F(u,v)=∑m=0M−1∑n=0N−1f(m,n)e−j 2π(um/M+vn/N)F(u,v) = \sum_{m=0}^{M-1} \sum_{n=0}^{N-1} f(m,n) e^{-j\,2\pi \big(um/M + vn/N\big)}

In the sequel, we note F\mathcal{F} the DFT so that F[f]=F\mathcal{F}[f] = F.

Note that the definition of the Fourier transform uses a complex exponential. In consequence, the DFT of an image is possibly complex, so it cannot be displayed with a single image. That is why we will show the amplitude (modulus) and phase (argument) of the DFT separately, as in Figure 2.

DFT of the squirrel. The amplitude is shown with a logarithmic scale to distinguish clearly the details
(an histogram transformation has been applied).

Figure 2:DFT of the squirrel. The amplitude is shown with a logarithmic scale to distinguish clearly the details (an histogram transformation has been applied).

The amplitude and phase represent the distribution of energy in the frequency plane. The intensities of the low frequencies are located in the center of the image, and the intensities of the high frequencies near the boundaries.

In the figure above, the gray background behind the squirrel “contains” mainly low frequencies because the intensities of the pixels slowly evolve from one pixel to another. On the contrary, high frequencies are needed in the tail to show the rapid alternation between the hair and the background.

Inverse Fourier transform

The inverse discrete Fourier transform computes the original image from its Fourier transform:

f(m,n)=1MN∑u=0M−1∑v=0N−1F(u,v)e+j 2π(um/M+vn/N)f(m,n) = \frac{1}{MN} \sum_{u=0}^{M-1} \sum_{v=0}^{N-1} F(u,v) e^{+j\,2\pi \big(um/M + vn/N\big)}

It is denoted F−1\mathcal{F}^{-1} below.

Example of simple Fourier transforms

In the examples below, the image (and their FFT) are 16×16 grayscale images.

On this example, only the pixel at frequency (0,0) in the Fourier domain is non zero. Because an oscillation with frequency 0 does not oscillate, the image is constant.

Two pixels in the Fourier domain are non zero. Because they are at frequency 1 along the x-axis, the image is a sinusoid along the x-axis.

Same example as above along the y-axis: the image is then a sinusoid along the y-axis.

Same example as above with a change in the phase. Therefore, the sinusoid is translated in the spatial domain.

Here, there is a oscillations both in x and y, with high frequency in x and low frequency in y.

Two waves with are superimposed, both with the same frequency and phase but different orientations and amplitudes.

By combining oscillations at appropriate frequencies, phase and amplitudes, it is possible to generate a specific image (here, the mean of the image is set to 0).

Properties