Quiz: images in frequency space

Short questions to test your understanding. Try each on paper first, then open the answer.


Q1. Why does the discrete Fourier transform lose no information about an image?

It is a change of basis. An image of N pixels becomes N wave amounts: the same vector written in another coordinate system, as when you describe a point by different axes. Nothing is thrown away, and you can always go back exactly. (In formulas: X = Fx with an invertible matrix F, F^{-1} = \tfrac1N F^* because the waves are orthogonal, and x = F^{-1}X recovers the image.)


Q2. In the centred spectrum of a micrograph, where do you find the information about (a) the overall brightness, (b) the broad shape of the cell, (c) the fine texture and the noise?

  1. The single centre coefficient, frequency (0, 0): it is N^2 times the mean grey level. (b) Close to the centre: low frequencies. (c) Far from the centre: high frequencies. Note that sharp real edges are high-frequency as well, so a low-pass filter that removes noise also blurs edges.

Q3. An image has a regular pattern of horizontal stripes (lines running left–right), 8 pixels apart, in a 256 × 256 image. Where are the bright dots in its spectrum?

The brightness changes when you move up and down, not left–right. How many cycles fit in the image?

On the vertical axis through the centre, at 256/8 = 32 cycles: the pair (u, v) = (0, \pm 32). The dots are perpendicular to the stripes, and come in a mirror pair because the image is real.


Q4. You blur an image by convolving with a 31 \times 31 Gaussian kernel. How else could you compute the same result, and why might it be faster?

By the convolution theorem: FFT the image and the (zero-padded) kernel, multiply the spectra, inverse FFT. Direct convolution costs about 31^2 \approx 960 multiplications per pixel; the FFT route costs \mathcal{O}(\log N) per pixel. (The Gaussian is also separable: a 31-tap pass along rows then along columns, 62 multiplications per pixel.) Beware: the FFT treats the image as periodic, so pad the image to avoid wrap-around at the border.


Q5. You reduce a photo of a brick wall to a quarter of its size by keeping every 4th pixel in each direction. A strange wavy pattern appears that is not on the wall. What happened, and how do you prevent it?

Aliasing. The new grid can only hold frequencies up to a quarter of the original Nyquist frequency; the fine brick pattern is above that and folds back as a false, coarser pattern (moiré). Low-pass filter (blur) the image first, so that what the coarse grid cannot represent is removed before sampling.


Q6. A detector adds a faint regular stripe to every image. Should you remove it with a low-pass filter or a notch filter? Why?

A notch. The stripe is a single wave, so in the spectrum it is one isolated pair of dots; zeroing just those (and their immediate neighbours) removes the stripe and leaves everything else. A low-pass filter would also remove every real structure finer than the stripe.


Q7. A cell sits in the left half of an image. In a second image, the same cell has moved 30 pixels to the right (on the same flat background). How do the two magnitude spectra |X_{u,v}| compare? What has changed in the full spectrum?

Shifting a wave slides its peaks along. Does it make the wave stronger or weaker?

The magnitude spectra are the same. Moving the image shifts every wave in it, which changes where its peaks are (its phase), not how strong it is. The magnitude spectrum describes what structures are present, not where; the position is stored in the phases. (Strictly this holds exactly for a shift that wraps around the image, which on a flat background is the same thing.)