Explainer · Inspection technology

What is a shading surface, and how does it measure dirt on the shell?

A shading surface is a smooth surface fitted to each egg's brightness, so the normal gradient of the dome is not counted as dirt. Vigiovo fits it by least squares after discarding outliers, and whatever falls well below it is measured as a stain. Each stain is compared with its own egg, not with one fixed value for the whole image.

Updated · 4 min read

Why isn't a clean egg evenly bright?

A clean egg is not equally bright over its whole shell. The top of the dome receives more light and the edges are darker, gradually. That gradient is part of the shape of the egg, not dirt. If an inspection used one brightness threshold for the whole image, the edges of a clean egg could look dirty.

The fix is to compare each pixel with the normal brightness at that point of the egg. That reference is the shading surface. For someone who knows eggs, it is like comparing the shell with itself, without the stain, and not with the shell of another egg.

How is the surface fitted to each egg?

Vigiovo fits a quadratic surface, a smooth second-degree dome, to each egg's brightness by least squares. Least squares chooses the surface that stays closest, overall, to the shell pixels. Because the surface is quadratic, it follows the dome without chasing local details such as a stain.

Before the fit, pixels that lie far outside the pattern are discarded. Specular highlights are the typical case: a point of intense brightness would pull the surface upwards if it were kept. Without those points, the surface again represents the clean shell.

The two steps of the fit for each egg (practical description)
StepWhat it doesWhy
Fita quadratic surface fitted by least squares to the egg's brightnessit follows the normal gradient of the dome
Outlier removalpixels far from the surface are discardedglare and marks do not pull the surface

How does dirt show up as a residual?

After the fit, each shell pixel is compared with the surface of its own egg. If its brightness falls well below the surface, the pixel is a candidate stain; if it follows the surface, it is clean shell. The difference between the pixel and the surface is the residual, and that is what Vigiovo measures.

In parallel, Vigiovo measures colour deviation in Lab space, which catches stains that have the same brightness as the shell but a different colour. Specular highlights stay out of that colour measurement. If stains cover 3% or more of the visible shell, the egg is dirty.

Why don't reflections count as dirt?

A reflection is a very bright point, above the surface, and the dirt rule only looks at what falls below it. But a reflection can still pull the surface upwards if it enters the fit, which is why it is discarded first. It is also kept out of the colour measurement.

That care is part of the reason why, on video, an egg is rejected only when the defect shows up in more than one measurement, as explained in how it works. Glare and its false dirty grades are covered in glare and false dirty grades.

What are the limits of the shading surface?

The surface describes the normal shape of the egg, so it works best when the shell is smooth and the egg has a regular shape. A badly deformed egg, large marks or strong shadows can produce a surface that does not follow the real dome.

The method also has a physical limit: a surface camera does not see the inside of the egg. Internal defects do not show in this measurement, and candling remains necessary. For the comparison between the two approaches, see candling or computer vision.

Frequently asked questions

What is a shading surface in one sentence?

It is a smooth second-degree surface fitted by least squares to each egg's brightness. It represents how the brightness of a clean shell should be at that point, and whatever falls well below it is treated as a stain.

Why not use one fixed brightness threshold for every egg?

Because the shell has a natural gradient that changes from point to point, and a fixed threshold would confuse the dark edge of a clean egg with dirt. Comparing each pixel with the surface of its own egg avoids that error without relying on one global value.

Does the shading surface detect cracks?

No. It measures stains, which are areas darker than the shell or of a different colour. Cracks are found by a different path, with black-hat and top-hat filters. Internal defects such as the air cell and the yolk do not show in these measurements, because the camera only sees the surface.

Sources

  1. Como o Vigiovo classifica ovos sem IA / How Vigiovo grades eggs without AI, Vigiovo

How Vigiovo helps

Vigiovo grades eggs on the conveyor as clean, dirty, cracked or unverified, in real time, with deterministic computer vision: every decision comes with the measurements behind it, on an ordinary CPU.

See how it works