hilum

Blog · Theory

A seed is a sum of circles

Every closed outline becomes spinning circles. Three terms give an ellipse; 25 give the seed. It is the basis of elliptic Fourier descriptors.

November 13, 2026 · 5 min read · by Enrico S. Ambrosio

Take the outline of a seed and walk along it until you're back where you started. On every lap, x and y repeat the same path. Anything that repeats like that can be written as a sum of circular motions. That is the idea behind the Fourier series.

The animation above is a simulation with a model seed. Each term of the series is a circle that spins at a whole-number speed: one, two or more turns for each trip around the outline. The circles are chained, one at the tip of the other, and the tip of the last one draws the curve.

From epicycles to Fourier

Drawing with circles spinning on circles is an old idea. Around AD 150, Ptolemy described the motion of the planets with epicycles, a circle that spins with its center attached to another circle. With enough circles, the model tracked the sky with good accuracy, even though it started from the wrong idea about what goes around what.

The modern version came from heat. In 1807, Joseph Fourier presented a study to the Paris Academy of Sciences on how heat spreads through a solid and claimed that any periodic curve can be written as a sum of sines and cosines. The book, Théorie analytique de la chaleur, came out in 1822. Each sine and cosine pair in the series is a spinning circle, as in the animation.

Diagram of circles: the Earth near the center of a large dashed circle, the deferent, and a planet spinning on a small circle, the epicycle, whose center runs along the large one.Black-and-white engraving of Joseph Fourier, with curly hair, an embroidered coat and a white cravat.
Left, Ptolemy's epicycle: the planet spins on a small circle whose center runs along a large circle (diagram in the public domain). Right, Joseph Fourier in an engraving from around 1823, by Geille after Boilly (public domain).

From 3 to 25 terms

  • With 3 terms, all that's left is the center and two circles spinning in opposite directions. The sum of the two draws an ellipse.
  • With 5 terms, the ellipse gets a wider side and becomes an egg.
  • With 7 and 11 terms, the fine ripples of the edge appear.
  • With 25 terms, the drawing lands right on the outline of the seed.

The animation panel measures the mean error between the curve and the reference outline, which has 64 points. With 5 terms, the error is 26 µm. With 11, it is 21 µm. With 25, it is under 1 µm.

We have to say why the error disappears. The model seed was drawn with few ripples, so few terms are enough for it. On a photographed seed, the edge has pixel noise. Too many terms start copying that noise, and the number of terms that makes sense depends on the resolution of the image.

On a real seed

On the model seed, the error vanishes. On a photographed seed, it doesn't. We took a real soybean seed, scanned at 800 dpi in a public dataset (Syahraza et al., 2025, CC BY 4.0), outlined it by color and computed the elliptic harmonics up to the 40th.

With 1 harmonic, the ellipse sits an average of 77 µm from the edge, or 2.4 pixels. With 3 harmonics, or 7 circles, the error drops to 23 µm, under one pixel. From there to the 40th harmonic, the error comes down slowly to 10 µm, and the drawing starts to wobble, because the high harmonics copy the jagged pixel edge. On two other seeds from the same dataset (the thin lines in the chart), the curve is the same: under one pixel from the 3rd harmonic on.

In practice, the number of harmonics worth keeping depends on the resolution. At 800 dpi, a pixel is 31.8 µm. Anything below that is no longer the shape of the seed.

Elliptic Fourier descriptors

In 1982, Kuhl and Giardina wrote the same idea with x and y separately. Each harmonic of the series becomes an ellipse, described by four coefficients. The first harmonic is the ellipse that sums up the shape. The following ones add the details.

They also showed how to normalize the coefficients by the first ellipse. That drops size, rotation and the outline's starting point from the calculation. Only the shape is left. These descriptors became a common tool in the morphometry of seeds, leaves and fruits, because they turn an outline into a short list of numbers that can be compared and fed into a principal component analysis.

On the Learn page, the shape space does a similar calculation directly on the outline points. The seeds of each crop separate without anyone saying which is which.

It all starts with a good outline

Fourier doesn't fix a bad outline. If a shadow got into the edge or two seeds became one, the series faithfully describes the wrong shape. The post Light decides the outline shows where many of these errors come from.

That is why the part we take care of in SeedCounter comes before the math. The machine proposes the edge, you check, and only then does the shape become a number. Open SeedCounter and see the outline of one of your seeds.

Sources

  • Deferent and epicycle, Ptolemy's model. Wikipedia
  • Joseph Fourier and the Théorie analytique de la chaleur (1822). Wikipedia
  • Kuhl, F. P., Giardina, C. R. (1982). Elliptic Fourier features of a closed contour. Computer Graphics and Image Processing, 18(3), 236–258. doi:10.1016/0146-664X(82)90034-X
  • Syahraza et al. (2025), Indonesian soybean seeds, Mendeley Data, doi:10.17632/c733bjz4m3.3, CC BY 4.0. The harmonics calculation is in _src/real/soja/efd.py.

For the full math: Elliptic Fourier, with the derivation of the coefficients and a harmonics control on real seeds.

Fouriermorphometryshapemath

Now with your image.

Count, classify and measure your seeds in SeedCounter, right in the browser.

Open SeedCounter