Aman Behera

Writing

Fourier for images, hands on

1 min readSeeing straight · part 1interactive, fourier, computer vision

If you want to know which way a page is tilted, you can skip finding a single letter. The answer is already sitting in its spectrum.

This series follows one idea from first principles to a working tool. Part one builds intuition: what the two-dimensional Fourier transform of an image actually shows, and why rows of text light up as a bright line.

Things to try in the explainer below:

  • Rotate the stripes and watch their spot in the spectrum rotate with them.
  • Switch between low-pass, high-pass and drop-the-phase to see which part of an image lives where.
  • Click points in the spectrum to build a stripe pattern one frequency at a time.
  • Add a hard border and watch a cross appear on the axes. That cross is the villain of part two.
Interactive · runs entirely in your browserOpen full screen ↗

It draws on the OpenCV Fourier tutorial, the HIPR2 notes on the Fourier transform and a DSP StackExchange thread on what “frequency” means for an image. Each tab keeps the six facts worth remembering on one page.

Next, part two goes from a spinning arrow all the way to the line of code that reads a page’s tilt.