Fourier Descriptors

Fourier Descriptors are a way of encoding the shape of a two-dimensional object by taking the Fourier transform of the boundary, where every (x,y) point on the boundary is mapped to a complex number x + Sqrt[-1] y. The original shape can be recovered from the inverse Fourier transform. However, if only a few terms of the inverse are used, the boundary becomes simplified, providing a way to smooth or filter the boundary. In this demonstration, you can select from a variety of different shapes, and then reconstruct the shape from different numbers of the descriptors. When the number is small, the resulting reconstruction is greatly simplified; as the number increases the reconstruction converges to the original.
  • Contributed by: William Sethares


  • [Snapshot]


The Fourier Descriptors of a shape are calculated by:
(1) Find the coordinates of the edge pixels of a shape and put them in a list in order going clockwise around the shape.
(2) Define a complex-valued vector using the coordinates obtained from (1). For example: {3,4} -> 3+4j.
(3) Take the Discrete Fourier Transform of the complex-valued vector in (2).

Fourier descriptors inherit several properties from the Fourier transform:
(a) Translation invariance: no matter where the shape is located in the image the Fourier descriptors remain the same.
(b) Scaling: if the shape is scaled by a factor, the Fourier descriptors are scaled by that same factor.
(c) Rotation and starting point: Rotating the shape or selecting a different starting point only affects the phase of the descriptors.

Because the discrete Fourier transform is invertible, all the information about the shape is contained in the Fourier descriptors. A common thing to do with Fourier descriptors is to set the descriptors corresponding to values above a certain frequency to zero and then reconstruct the shape. The effect of this is a low pass filtering of the shape, smoothing the boundary. Since many shapes can be approximated with a small number of parameters, Fourier descriptors are commonly used to classify shapes.
The slider let's you choose how many terms to use in the reconstruction. With more terms, the shape looks more like the original. With fewer terms, the shape becomes smoother and rounder.



Mathematica »
The #1 tool for creating Demonstrations
and anything technical.
Wolfram|Alpha »
Explore anything with the first
computational knowledge engine.
MathWorld »
The web's most extensive
mathematics resource.
Course Assistant Apps »
An app for every course—
right in the palm of your hand.
Wolfram Blog »
Read our views on math,
science, and technology.
Computable Document Format »
The format that makes Demonstrations
(and any information) easy to share and
interact with.
STEM Initiative »
Programs & resources for
educators, schools & students.
Computerbasedmath.org »
Join the initiative for modernizing
math education.
Step-by-Step Solutions »
Walk through homework problems one step at a time, with hints to help along the way.
Wolfram Problem Generator »
Unlimited random practice problems and answers with built-in step-by-step solutions. Practice online or make a printable study sheet.
Wolfram Language »
Knowledge-based programming for everyone.
Powered by Wolfram Mathematica © 2017 Wolfram Demonstrations Project & Contributors  |  Terms of Use  |  Privacy Policy  |  RSS Give us your feedback
Note: To run this Demonstration you need Mathematica 7+ or the free Mathematica Player 7EX
Download or upgrade to Mathematica Player 7EX
I already have Mathematica Player or Mathematica 7+