1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

How Far Can Ray Tracing and Simulation Check Inspection Optics? Coaxial-Illumination Ghosts, Telecentric Lenses, SEM and TEM, Thin Films, Dual-Energy X-ray, Pixel Shift, Deflectometry

1
Last updated at Posted at 2026-10-18

Language / 言語: 日本語 · English

How Far Can Ray Tracing and Simulation Check Inspection Optics? Coaxial-Illumination Ghosts, Telecentric Lenses, SEM and TEM, Thin Films, Dual-Energy X-ray, Pixel Shift, Deflectometry

Coaxial epi-illumination layout

Above: a 45° beamsplitter bends the illumination (red) down onto the part; light mirror-reflected by the part (blue) passes back through the beamsplitter into the lens. Light that reflects off the back face and returns off the front face makes a shifted ghost. (Labels in the figure are Japanese.)

If you inspect mirror-like parts for dents, you may well use coaxial epi-illumination: light delivered along the camera's own axis, from straight above the part. The optics of that scheme contain a plate at 45°, the beamsplitter. A plate has a front and a back, and the back reflects a little light too.

That reflection shows up in the image as a second, shifted copy of the dent. The part is a mirror, so the background is uniformly bright and the shifted copy reads as a plain dent. A simple defect detector cannot tell it from a real one. In this calculation, the detector reported the real dent, the real scratch, and one dent that does not exist.

The first half of this article reproduces that false dent with ray tracing and removes it with a coating and a wedge, with numbers. The same tool covers fold mirrors that shrink the machine, a tilted plate, and the Scheimpflug arrangement. Then: how it was verified, how two CI tolerances were relaxed and why, and what the tool cannot do.

The second half lays out other optical systems used in inspection in the same shape: telecentric lenses for dimension measurement, SEM for wafers, TEM for reading defocus, thin-film interference for thickness, pixel shift to remove colour moiré, TDI for moving subjects, chromatic confocal sensors and OCT that read depth from colour or interference, deflectometry for dents on mirrors, white-light interferometry and moiré for nanometre steps and shifts, polarisation for glare and shape, dual-energy X-ray that separates foreign bodies in meat by material, spectrometers and illumination trains, and a grating interferometer that sees with fringe amplitude what absorption cannot. Each section runs: figure, what the system shows, gates (pass conditions) and results, ★ what the check found (what went against intuition), and what it is not for. Every number was obtained by running the PoC. Most sections are calculations on synthetic data; where a result was compared with real measurements, the section says so.

Terms first

Term Meaning
Coaxial epi-illumination Light is bent by a beamsplitter so that it illuminates the part from straight above, along the camera axis. Used to see dents and scratches on shiny parts
Ghost A faint extra image made by light that reflected twice more than intended inside the optics. Same principle as the double image of yourself in a window at night
Fold mirror A mirror that bends the light path to make a machine smaller. One mirror flips the image; two restore it
Scheimpflug arrangement To focus a tilted surface across its whole extent, the sensor is deliberately tilted too
Telecentric lens A lens whose object-side chief rays are made parallel to the axis, so an object looks the same size whether it moves closer or farther
SEM A microscope that scans a fine electron beam and builds an image from the number of electrons coming out. Used for wafer defect inspection and linewidth (CD) measurement
TEM and CTF A microscope that turns the phase change of electrons through a thin sample into brightness by defocusing. The "transfer table" for each defocus is the CTF
Thin-film interference Reflections from the front and back of a film interfere, so reflectance shows fringes depending on thickness. The same as the colours of a soap bubble
Pixel shift Move the sensor by one or half a pixel and take several shots, so colour interpolation (demosaicing) is not needed
TDI Image the same row with several rows of sensor in turn and add them, to image dim things as they move
Chromatic confocal Chromatic aberration shifts the depth in focus with wavelength; the colour of the returning light gives the surface height
OCT Interference with a reference beam arranges reflections inside transparent layers by depth (optical coherence tomography)
Deflectometry The curvature and slope of a surface are found from how the reflected stripes of a screen in front of it bend
White-light interferometry and moiré The former reads a step from the envelope of fringes; the latter reads nanometre shifts from the coarse fringes of two overlaid gratings
Brewster's angle The incidence angle at which p-polarised reflectance is zero; the specular reflection is then fully polarised
Dual-energy X-ray X-ray inspection that counts photons in two energy windows and splits a transmission image into thicknesses by material. A single image cannot tell thick light matter from thin heavy matter
Spectrometer and illumination train A spectrometer lays out the image of its entrance slit by wavelength with a grating and reads it with pixels; a narrower slit raises resolution and loses light. In an illumination train, which plane of the source is imaged where (Koehler or critical) sets the unevenness of the field
Grating (Talbot) interferometer Uses the self-image of a grating (the Talbot effect) to turn X-ray refraction and scattering into a fringe shift and a fringe fading. Gives transmission, differential phase and dark field

In plain words (the ghost in coaxial epi-illumination)

  • Without an anti-reflection coating, the back face of the beamsplitter reflects about 5 % of the light. That light takes a different path from the 50 % reflected by the front, and lays a faint image on the same image plane.
  • The faint image is displaced sideways by a distance set by the plate thickness and tilt. If the shift is a few millimetres, it looks like a dent in another place.
  • There are three remedies: a coating designed for the angle on the back face, a wedge that throws the ghost off the sensor, and calculating the strength and position of the ghost beforehand.

How the false dent appears

Setup

The PoC system, in order: the object (a mirror-like part with a dent 2 mm in diameter and a scratch 0.15 mm wide), a 45° beamsplitter (a 3 mm plate, front-face reflectance R = 50 %), a two-element lens and the sensor. The part is bright under epi-illumination (brightness 1); defects scatter light and are dark (0.1).

Ghost strength

The path that reflects twice between the beamsplitter's back and front faces is traced with real rays. The ghost-to-image energy ratio has a closed form:

ghost energy ratio = R_front × R_back
                   = 0.5 × Fresnel(back face, incidence 27.96°, unpolarised)

In the PoC output, the ray-traced value is 0.026489 and the closed form 0.026489, agreeing within 1e-6 (the back-face reflectance is 0.052977). So the ghost carries about 2.6 % of the image.

Shift

The shift can be estimated as:

shift = magnification × 2t · tanθ' · cosθ

where t is the plate thickness, θ the 45° incidence angle and θ' the refraction angle inside the plate. The ghost's centroid, measured with real rays, is displaced by 2.601 mm on the image plane; the formula gives 2.597 mm. The gate (pass condition) is 5 %, and it passes. The ghost's spread is a radius of 0.304 mm, much smaller than the 2.6 mm shift, so it survives as a copy of the dent of about the same size.

Detection

A simple detector that calls any blob differing from the background by more than 1.5 % a defect found 3 defects with the bare beamsplitter: the real dent and scratch, plus the ghost's false dent. The false dent lies where "image of the dent + ghost shift" predicts, to within 0.010 mm (pixel 0.02 mm).

The defect brightness is 0.1, so the darkening the ghost makes is about 2.6 % × (1 − 0.1) ≈ 2.4 % (this multiplication is the author's estimate, not a PoC output). It exceeds the 1.5 % threshold, so it is detected.

False defect and remedies

Above, left to right: bare back face, single-layer MgF₂, two-layer coating, 1° wedge. Brightness is stretched to −6 to +3 % of the background; red outlines are detections. Only the leftmost panel shows a false dent.

Three ways to remove it

Back-face treatment Back-face reflectance (near 45°) Ghost energy ratio Detections Ghost shift on the image plane
Bare 5.3 % 2.65 % 3 2.601 mm
Single-layer MgF₂ 2.1 % 1.04 % 2 2.601 mm
Two layers (Ta₂O₅ 20 nm + MgF₂ 157.5 nm) 0.39 % 0.19 % 2 2.601 mm
Bare, with a 1° wedge (same as bare) 2.77 % 2 9.486 mm

Two cautions when reading this table.

  1. A single MgF₂ layer is weak at 45°. A single quarter-wave layer lowers the reflectance to 1.25 % at normal incidence. For light crossing the 45° plate obliquely it only reaches 2.1 %. A coating has to be designed for the angle. The two-layer coating reaches 0.39 %, and the ghost falls to 0.19 %.
  2. By detection count alone, the single layer looks like it removed the false dent. The ghost is 1.04 %, below this PoC's noise-free 1.5 % threshold. In a real machine the threshold is set by noise and illumination non-uniformity, and a 1 % ghost can easily be visible. Compare the ghost energy ratios, not the detection counts.

The wedge works differently from a coating. Tilting the back face by 1° moves the ghost by 9.486 mm. The sensor's half-width is 3.59 mm, so the ghost lands outside the sensor. The energy ratio (2.77 %) does not drop, but it no longer overlaps the image.

Not every ghost becomes a false dent

This system has 5 surfaces, so there are N(N−1)/2 = 10 pairs of surfaces. Among the pairs whose light reaches the image plane, the beamsplitter's front/back pair is large (2.6 %) and also lands close to the image (radius 0.3 mm). The other pairs spread over several millimetres to hundreds of millimetres on the image plane, so they only add a uniform brightness offset and make no dent-like shape.

Ghost surface pairs

Above: energy ratio relative to the image for each surface pair whose light reaches the image plane.

In practice: list all pairs with ghost_analysis, and look only at pairs with a large energy ratio that also land in a small spot on the image plane as candidates for false defects.

Fold mirrors make the machine smaller

To keep an inspection machine short, the camera-side path is often folded with two 45° mirrors. The PoC folds the camera-side 204 mm of a coaxial epi inspection lens.

  • Machine height: 392.9 mm → 248.7 mm
  • Optical path length: 242.22 mm and 242.22 mm (unchanged)
  • Image RMS (spot size): 0.288283 mm and 0.288283 mm (unchanged)

Folded set-up

Above: straight (left) and with the camera side folded (right). A true-scale section; the rays are real rays aimed at the stop.

Folding does not degrade the image, but it changes its handedness. The relation between the number of reflections and reversal can be checked by the sign of the determinant of the image-position Jacobian. The PoC output is +3.046 for 0 reflections, −3.046 for 1 and +3.046 for 2. Negative means mirrored, positive means not mirrored (ordinary imaging with no reflection gives an inverted image, rotated by 180°).

If you evaluate with a flipped image, or handle measurements that assume a coordinate handedness (for example the sign of a step height), always count the mirrors.

The folded image matches the mirror image, about the mirror plane, of the image of the unfolded system (a Householder reflection). Over four tilts and four fields, the largest difference was 2.8e-14 mm.

Lateral shift and astigmatism of a tilted plate

If a protective glass, a window or a beamsplitter plate is tilted against the optical axis, the image shifts sideways and astigmatism (different focus positions for two directions) appears. For a 5 mm BK7 plate tilted by 30° in a converging beam (f/25), real rays give:

  • Lateral shift: 0.9881 mm (agrees with the closed form within 1e-12 mm)
  • Astigmatic difference: 0.5536 mm (the tangential image is farther; agrees with the closed form within 1e-6 mm)

Tilted plate, closed form

Above: lateral shift and astigmatic difference for tilts of 0 to 60°. Real rays and the closed form overlap.

An astigmatic difference of 0.55 mm appears just from putting a tilted plate into the beam. If you insert a plate at an angle in an inspection system, it is worth estimating.

Scheimpflug: focusing a tilted surface across its whole extent

A surface tilted by 30° is imaged from 200 mm with a two-element lens of focal length about 97 mm. Tilting the sensor by tanθ' = m · tanθ brings the whole surface into focus.

  • Image-plane tilt: closed form −28.0049° (magnification m = −0.9211), real rays −28.0047° (the gate is 1e-3°)
  • Largest blur (RMS, object plane ±6 mm, f/12.5): 0.0640 mm with an untilted sensor → 0.0170 mm with the tilted sensor
  • Hinge (the height where the object plane meets the front principal plane and the image plane meets the rear principal plane): 349.049 mm

Scheimpflug

Above: sensor tilt versus blur. With the closed-form angle, the height-dependent blur becomes small.

The blur falls to one third or less. It does not reach zero: what remains is field curvature and astigmatism of the lens itself, which tilting cannot remove.

Verification of the non-coaxial calculation: how we checked it is right

19 gates

The PoC has 19 gates (pass conditions), all passing. The external truths were:

  • The 8 coaxial prescriptions agree with the existing raytrace.trace_rays within 1e-12 (largest difference 0.0 mm, 464 valid rays)
  • Folds: the Householder reflection
  • Plates: Smith's and Coddington's formulas
  • Scheimpflug: tanθ' = m · tanθ
  • Ghosts: Fresnel's equations and the thin-film closed form

A second implementation

Checking a ray tracer you wrote against formulas you also wrote carries the same assumptions into both sides. So an independently developed open-source ray tracer (MIT) was given the same surface poses in absolute coordinates, and the same rays were passed through it. On six systems (fold, periscope, tilted plate, off-axis paraboloid, compound x/y tilt with a decentred tilted lens, and coaxial epi-illumination), the intersections on every surface agreed to at most 9.8e-14 mm (measured on 2026-10-15).

In environments such as CI where that tracer is not installed, the PoC compares against that day's recorded values to 1e-7 mm. When the numbers for this article were re-taken, that tracer was not installed on the machine either, so only the comparison with the recorded values ran (largest difference 4.7e-11 mm).

The off-axis paraboloid uses the same arrangement as that tracer's public example. All rays converge on the parent focus (0, 0, −50) to within 1.9e-9 mm.

Break it and see

A gate that merely passes does not prove the gate is right. So we break things on purpose and check that the gate turns red.

What is broken Gate result
Rotate the coordinate break after a reflection about the y axis by mistake the coaxial gate turns red (max 0.62)
Use the same order and angle for the fold's before and after switches the mirror-image gate turns red (max 49.1 mm)
Trace the reverse segment of the ghost path in the forward direction closed form −6.3529 mm; the correct implementation gives −6.3531 mm, the broken one −5.8825 mm

The non-coaxial gates found a hole in the existing coaxial tracer

Running non-coaxial systems also exposed a wrong answer in the original coaxial tracer raytrace. After a tilted mirror it counted a ray travelling almost parallel to the image plane as valid, and returned an RMS of 3.4e18 mm. Such rays are now counted as invalid.

What CI taught us: two tolerances relaxed

On 2026-10-18 two gates that passed locally turned red in CI, and we relaxed their tolerances. Here is why, and what we did not relax.

Gate Before After Reason
Astigmatic difference of the tilted plate (vs the closed form) 1e-8 mm 1e-6 mm The focus is found as the point of closest approach of two nearly parallel rays. The closer to parallel, the higher the rounding floor of the intersection, and it varies with the environment between 1e-9 and 1e-7 mm (1.4e-9 locally, 1.0e-7 in CI on Python 3.10)
Comparison with the second implementation's recorded values 1e-8 mm 1e-7 mm The iteration that aims the starting ray at the stop (Newton's method with a finite-difference Jacobian, convergence at 1e-11 times the aperture) has a floor that varies with the environment. In the beamsplitter system a starting error grows about 4× on the image plane. One CI environment gave 1.6e-8 mm (4.7e-11 locally)

The floors come from the method of measurement, not from the physics. As long as you use "the intersection of two almost parallel lines" or "the stopping point of an iteration", there is a lower bound that moves with the environment.

Even so, what matters was kept:

  • The lateral-shift gate (1e-12 mm) is unchanged.
  • The raw comparison with the second implementation (every surface intersection, 1e-10) is unchanged. Only the comparison against recorded values, used when the second implementation is absent, was relaxed.
  • The astigmatic difference is about 0.55 mm, so 1e-6 mm only lets through relative deviations around 1e-5 or so.

Two lessons: do not use a green result on your own machine as the basis for a tolerance, and measure the floor before choosing. Do not widen a tolerance "until it passes"; put it at a value whose origin you can explain.

What the non-coaxial calculation cannot do

  • Ghosts up to two reflections only. Three or more reflections, scattering and stray light from the inside of the barrel are not handled.
  • The beamsplitter coating is a fixed given reflectance (50 %). No dependence on angle or wavelength, and no polarisation. Surface coatings are computed with angle of incidence (the two-layer values come from this).
  • Reflectances are unpolarised values at the chief ray's angle of incidence. Polarisation effects are not included.
  • No diffraction and no interference. This is geometric ray tracing.
  • The ghost shape uses the ghost of an on-axis point source for the whole field. The change of shape across the field is ignored.
  • Defect detection is a noise-free image-difference threshold (1.5 %). In a real machine the threshold is set by noise and illumination non-uniformity.
  • No optimisation or tolerance analysis for non-coaxial systems. The existing lensopt and tolerance_analysis work only for coaxial prescriptions.
  • Ray aiming is Newton's method toward the stop point. Rays that cannot be aimed (vignetted or totally reflected) are counted as invalid.
  • Everything is a calculation on synthetic data. It has not been compared against real images or measured ghosts. No learning and no calibration are used.

If you apply this to a real optical system, use the results to decide what to suspect first, and confirm with measurements.

Telecentric: a lens whose image size does not change with height

Ordinary and telecentric lenses

Above: three versions of the same f = 100 mm biconvex lens with only the stop (red) moved. The chief rays (solid) from ±6 mm object height tilt toward the stop in the ordinary lens; with the stop at the back focal point they run parallel to the axis on the object side. (Labels in the figure are Japanese.)

Have you seen a dimension reading move just because the part sat a little higher or lower? An ordinary lens draws near things larger, like the human eye. A telecentric lens puts the stop at the focal point so that the object-side rays run parallel to the axis; an object looks the same size whether it moves closer or farther.

This section traces three versions with real rays, differing only in stop position (ordinary, object-side telecentric, bi-telecentric), and renders a stepped part to measure.

Gates and results

What we looked at Ordinary f = 25 mm Ordinary f = 100 mm Telecentric
Magnification change when the part moves 5 mm closer +6.89 % +1.68 % −0.013 % (object-side and bi-telecentric)
Chief-ray tilt at the field edge (object height 8 mm) −1.515° 0.0517° (object-side) / 0.0483° (bi-telecentric)
Pin top (true 1.6 mm) diameter measured from the image 6.94 % too large at Δz = 0 within 1 % of the closed form under every illumination
Change of the reading when the part moves ±6 mm 8.64 % 0.000 %
Visible fraction of the hole bottom (hole depth 5 mm) 0.948 (2053 pixels of inner wall visible) 1.002 (0 pixels of wall, bi-telecentric)

For the ordinary lenses, the real-ray magnification matched the closed form L/(L − Δz) within 6.8e-5 over ±5 mm (L is the distance to the entrance pupil). The visible fraction of the hole bottom, 0.948 as rendered, matches the closed-form circle overlap, 0.949. All 30 gates passed (full budget, 168 s).

Part views with the work moved up and down

Above: top row in focus, bottom row with the work lifted 3 mm. The ordinary lens (left) shows the inner wall of the hole and the side of the pin, loses the hole bottom, and the pin, hole and scale all swell when lifted. The telecentric lenses (middle, right) look straight down and the dimensions do not change.

★ What the check found

  • Telecentricity is never exactly zero. Because of spherical aberration of the pupil in a single lens, the tilt grows from 9.10e-05° to 0.0517° as object height goes from 1 mm to 8 mm, roughly with the cube of the height (a ratio above 100). A residual tilt of 0.1° makes a point at 8 mm height appear shifted by 9.20 µm across a 5 mm step, within 10 % of the chief-ray estimate 5 × tan 0.1° = 8.73 µm.
  • The telecentric field is set by the front element. The ordinary lens did not vignette even at 16 mm object height (1.3 times the front radius), because its chief rays converge on the lens centre. The telecentric lens loses half its beam at 11.60 mm (object-side) / 12.16 mm (bi-telecentric), short of the 12.5 mm front radius. The paraxial closed form says 12.38 mm, so real rays are cut 0.78 mm earlier: pupil spherical aberration pushes the beam outward and fattens it.
  • Stopping down buys less depth than you hope. With an allowed blur of 22 µm (object side), the smallest NA for which the diffraction circle 1.22λ/NA does not exceed it is 0.0326, giving a depth of field of at most 0.68 mm. NA 0.01 would give 2.2 mm of depth, but the diffraction circle becomes 72 µm and blurs the edge reading.
  • Checked on real images. On a published raw telecentric image (a tilted alignment plate, circle spacing 1 mm) we fitted an ellipse to each ring. The stretch along the long axis is 252.13 px/mm, +0.05 % from the paper's 252.0 px/mm. Although the plate is tilted, the ring centres do not drift in proportion to r² (coefficient 0.0035 ± 0.0034 px/mm²). The same plate through an ordinary f = 25 mm lens would give 1.40, and 0.36 px/mm² even at f = 100 mm, so the lens in the image really is telecentric.
  • A resin sphere is not ground truth. The 3D-printed sphere from the same paper changes radius by 8.1 % as the edge threshold goes from 0.015 to 0.06, because the shadowed edge is dark. The PoC does not use it as a dimensional truth.
  • The "0.000 %" is a product of construction. The 0.000 % in the table for the telecentric lens comes from the PoC's stand-in pinhole being an ideal paraxial one (entrance pupil 1e7 mm). A real telecentric lens moves the reading by the 0.05° above.

Source of the real images: A. W. Stark et al., Scientific Reports 15, 28690 (2025), doi:10.1038/s41598-025-13795-6; images on figshare (CC BY 4.0).

Illumination cone and NA: same NA, different defects visible

When you look for defects rather than dimensions, the relation between the telecentric NA (the observation cone) and the size of the illumination cone matters. With the observation half-angle β = 1.891° (NA 0.033), we varied the illumination half-angle α from 0.5° to 7° and imaged the same three workpieces (a dent, a hairline scratch, a matte finish).

Three workpieces under different illumination cones

Above: the same three workpieces with only the illumination cone changed. The dent shows as a ring only at α = β; on the hairline, the lines vanish at α = 4° and only the scratch stays black. (Labels in the figure are Japanese.)

Workpiece, condition Result
Ring contrast of a dent (slope 0.25°), α = β image −0.0908, closed form −0.0909
Same dent, α = 0.5° and 7° 0.0000 (vanishes; the closed-form "invisible slope" bands are 0.696° and 2.554°, and the dent lies inside them)
Hairline fluctuation, α = 4° 0.014 times that at α = β (below 1/5); scratch contrast −1.000
Same scratch, α = 7° (too wide) −0.688 (only part of the scratch slope turns dark)

To see dents, match α to β; to erase the lines and keep the scratch, put α inside the band the closed form gives (here 3.53° < α < 6.11°). We confirmed this use against both images and closed form. 15 gates, all passed (53 s).

The failure conditions come out in numbers too. With surface waviness (±0.25°), the background fluctuation at α = β is 1.6 times the dent's depth, so a threshold cannot pick up the dent alone. On a rough surface (roughness σ = 4°), whatever α you choose, the dent contrast falls from 0.091 to 0.001.

What it is not for

  • Even a telecentric lens cannot image anything larger than its front element. A wider field needs a bigger lens.
  • Tilted faces and the insides of tall walls remain invisible. What you see is the shape from straight above.
  • The images are synthetic. Only the telecentricity of the alignment plate was checked on a real image.
  • For the illumination cone section, we could not find, under a reusable licence, comparison photos of the same part with only the illumination solid angle changed (2026-10-15), so the comparison with real images is not done.
  • It is ray tracing, so diffraction and stray light (ghosts) are not included.

SEM: seen by electrons, a dimension moves with voltage and with where you put the edge

How far electrons spread inside the sample

Above: density of 400 primary-electron trajectories (log scale). In Si the Kanaya-Okayama range R_KO grows from 31 nm to 0.47 µm to 4.7 µm for 1, 5 and 20 keV, spreading similarly while keeping its pear shape. Au (20 keV) has an R_KO 1/5.5 that of Si and bends sharply near the surface (more backscattered electrons). (Labels in the figure are Japanese.)

A scanning electron microscope (SEM) scans a finely focused electron beam and turns the number of electrons coming out into pixels. As an analogue of an optical system: the beam diameter plays the role of blur (the point spread), and the accelerating voltage sets how deep you look. SEMs are used for wafer defect inspection and for critical-dimension (CD) measurement.

This section sets two PoCs side by side. One is a virtual SEM that follows electron-solid interaction by Monte Carlo and varies voltage, detector and charging. The other shows that measuring a defect area on a SEM image makes it too big by the width of the bright edge.

Gates and results

The virtual SEM was scored against published measurements.

What we looked at Reference Result
Backscatter fraction η (7 elements × 5/10/20/30 keV) published measurement range ± 0.04 The implementation using Browning's expression falls inside in every case. The screened-Rutherford expression misses for W and Au at 5/10 keV
Electron range Kanaya-Okayama R_KO Maximum depth is 0.75 to 1.05 R_KO; the 95 % depth scales as E^1.75 in Si (the R_KO formula has E^1.67)
Shape of the secondary-electron yield (C to Ag) Lin & Joy 2005 universal curve RMS 0.076 or less; peak position Emax within ±20 % of the table (not fitted)
Charging (PMMA, after 60 scanned frames) bisection of η + δ·F(V*) = 1 stops at +1.7 V at 0.5 kV; reaches −102.4 V at 20 kV; the positive-side potential agrees with the separate solution to 1.8e-15 V

The bias of the defect area was measured on synthetic images where the true area is exact.

Defect radius (px) × beam spread Area ratio before correction After
12 × 1.5 1.308 1.017
12 × 3.5 1.698 0.933
36 × 1.5 1.093 1.005
36 × 3.5 1.223 1.007
Median deviation from 1 over all 12 combinations 0.261 0.008

The correction is "area − perimeter × beam-spread width". The shape agreement (Dice) has a high median of 0.885, yet the area is inflated 1.093 to 1.698 times.

Inflation of a defect in a SEM image

Above: a synthetic SEM image (a conical defect of radius 22 px). Green is the true edge, red the edge measured by a threshold. The threshold picks up the bright edge too, so red falls outside green. The shape matches, but the size is systematically inflated. (Labels in the figure are Japanese.)

★ What the check found

  • A good shape match does not mean a good size. With Dice 0.885 the area was still up to 1.7 times too large. The inflation is explained well by "perimeter × beam-spread width"; the median ratio of effective edge width to beam spread is 1.01. Small defects have a larger perimeter-to-area ratio, so they inflate more.
  • Linewidth depends on voltage through which height of the sidewall you measure. For a PMMA line (base 40 nm, height 40 nm) on Si, with a 88° sidewall the threshold linewidth is 39.1 nm at 1 kV and 39.9 nm at 20 kV (top width 37.2 nm). 1 kV measures the upper part of the sidewall (0.33 of the height), 20 kV the foot (0.03).
  • But "lower voltage measures higher" is not a general rule. At an 80° sidewall the voltage difference is small and in the opposite direction (0.15 at 1 kV, 0.20 at 20 kV). For a vertical wall (90°), every voltage measures wider than the true width (40 nm): +0.3, +0.6 and +1.0 nm at 1, 5 and 20 kV.
  • The detector changes what you see. A W grain on Si has contrast +35 % in the in-lens secondary electrons and +111 % in backscattered electrons at 1 kV. W buried at the surface at 1 kV shows +96 % in backscatter but only +5 % in secondaries: nearly invisible.
  • Deeply buried things need higher voltage. W at 150 nm depth is +3 % at 1 kV even in backscatter (the electrons do not reach it) and +154 % at 20 kV.
  • "Invisible in secondary electrons" is a low-voltage statement. At 5 kV, surface W is +80 % in secondaries, because the secondaries made as backscattered electrons leave (SE2) carry atomic-number information.
  • The direction of charging flips with voltage. At 0.5 and 1 kV, η + δ > 1: the surface charges positive, gets darker, and stops by itself. At 5 and 20 kV, η + δ < 1: it keeps charging negative and gets brighter.

The same part at 3 voltages × 3 detectors

Above: rows are accelerating voltages, columns detectors. In-lens SE shows the top of the PMMA bright at 1 kV and only a bright band along the edges at 5 and 20 kV. Backscatter shows the W grain best at 1 kV and nearly erases the PMMA lines. 2.4 nm per pixel, 90 electrons per pixel. (Labels in the figure are Japanese.)

What it is not for

  • Secondary electrons from heavy elements do not fit. For W and Au the shape of the secondary yield departs from the universal curve (the peak position Emax is +114 % off the table for W). This is unresolved and only pinned down as numbers. The maximum yield δmax comes out low, 0.79 times the table on average for light to medium elements.
  • Charging is a phenomenological upper bound. Leakage and the drop in landing energy are not included. Read the numbers as upper-bound behaviour.
  • The defect-inflation check is on synthetic images only. The real-data gate (real SEM images) runs only when the data is placed, and did not run this time. Detection rate of embedded defects (synthetic noise floor) is 0.25 at a diameter of 12 px and 1.00 at 16 px; the diameter for 90 % detection is 16.5 px (17.7 px when the confidence interval is included).
  • The line is a trapezoid. It has a 40 nm base and 40 nm height; only the sidewall angle is varied.
  • Run time: the virtual SEM took 204 s of CPU time, the defect inflation 2 s.

TEM: defocus can be read from the rings in the power spectrum

Power spectra at four defocus values

Above: power spectra of the same sample (amorphous carbon) at four defocus values. The first dark ring moves inward by √6 when the defocus grows six-fold, from 0.4 to 2.4 µm. (Labels in the figure are Japanese.)

A transmission electron microscope (TEM) looks at the phase change of electrons passing through a thin sample, turned into brightness by deliberately defocusing. The amount of defocus decides which fine patterns appear and how strongly. This "transfer table" is the contrast transfer function (CTF), and in the power spectrum of a micrograph (the strength at each spatial frequency) its zeros appear as concentric rings (Thon rings). From the spacing of the rings you can work back to the defocus used.

This PoC follows, on synthetic data, the electron wavelength, the sample potential, the CTF, defocus estimation from the rings and the correction, and finally checks against public real micrographs.

Gates and results

What we looked at Reference Result
Electron wavelength (100/200/300 kV) published values agree to 5 digits (max difference 4.9e-05 pm); skipping the relativistic correction makes it 13.7 % too long at 300 kV
CTF zeros closed form within 1.7e-12 Å⁻¹
First zero at the Scherzer focus (842 Å) textbook 0.66 Cs^¼ λ^¾ 2.493 Å, within 0.5 % of the textbook 2.501 Å
Dark-ring radius (4 points, defocus 0.4 to 2.4 µm) closed form max difference 1.0 %
Defocus estimate (4 synthetic cases) truth errors +5.9 / +3.1 / +3.1 / +12.8 Å (truth 6000 to 25000 Å)
Astigmatism (400 Å or more) truth magnitude within max(60 Å, 10 %), direction within 8° (worst 5.2°)
Correlation with the projected potential after CTF correction uncorrected raw 0.093 → phase flip 0.842 → Wiener 0.874

All 34 gates passed (CPU 16.6 s).

CTF curves

Above: the CTF multiplied by the spatial and temporal envelopes (300 kV, Cs 2.7 mm). The larger the defocus, the faster the oscillation and the earlier the envelope drops. (Labels in the figure are Japanese.)

★ What the check found

  • With the wrong defocus, the correction is almost useless. Phase-flipping with the defocus 10 % wrong brings the correlation back only to 0.104 (0.842 with the right value), barely different from 0.093 before correction.
  • Drift erases the rings. If 10 dose-fractionated frames drift by (2.0, 0.6) pixels each, the plain sum loses the rings along the drift direction; the fit resolution is 15.6 Å. Aligning each frame by phase correlation before summing brings it back to 5.3 Å, and the ring peak rises from 9.1 to 28.0 MAD (median absolute deviations).
  • A fit that fell into a wrong valley was rejected by a 2-D test. In a 9-tile fit, the 1-D peak looked good at 18.0 MAD, yet the estimate was 25862 Å with astigmatism 1595 Å, which is wrong (truth 25000 Å). The 2-D z rejected it, so no accepted estimate was wrong.
  • When rings cannot be seen, it stops instead of giving an estimate. All four cases were rejected: no sample (noise only), dose 0.3 e/Ų, near focus, and only nine tiles. By default it raises ValueError.
  • A wrong pixel size or voltage drags the defocus with it. A +2 % pixel size gives a defocus 1.039 times larger; mistaking the voltage for 200 kV gives 0.802 times. A defocus read from the rings assumes the pixel size and voltage are correct.
  • The thin-sample approximation breaks with thickness. With a phase rms under 0.1 rad, the linear and nonlinear images differ by under 10 % (1.9 % at 0.019 rad), but by 37.8 % at 0.386 rad. For carbon, the projection approximation differs from multislice by 8.2 % at 25 Å and 17.3 % at 200 Å.
  • The electron scattering factor of Cu is off by 10.5 %. Light elements (C, O, Mg, Si) are within 3 % of the DFT table (max 2.3 %), but Cu is −10.5 %. The five-Gaussian fit of the X-ray scattering factor cannot capture the outer electrons; this is kept as a known limit.

Checking on real micrographs

Power spectra of three real micrographs and the fit

Above: power spectra of three real micrographs (left observed, right the CTF² this PoC fitted). Three images from EMPIAR-10028 (W. Wong et al., eLife 3, e03080, 2014, CC0) were cropped and processed. (Labels in the figure are Japanese.)

On three images of the public dataset EMPIAR-10028 (a malaria-parasite ribosome) we compared with the authors' CTFFIND3 values. In this run the real-data chapter did not download the data; it takes the path that prints the values recorded in the run of 2026-10-15. The recorded values are a defocus of 30440.5 Å for image 1 (authors 30495.7 Å) and 23358.3 Å for image 3 (authors 23358.8 Å). The worst ratio against the tolerance max(100 Å, 1 %) is 0.2, and the worst astigmatism-direction difference is 7.2°.

What it is not for

  • The samples are synthetic amorphous carbon and small particles. The real ribosome images are used only for defocus estimation. Reconstruction of structure inside a particle is out of scope.
  • Simplified imaging. Weak-phase approximation, projection approximation and multislice only.
  • The real-data comparison covers defocus estimation only. The accuracy of reconstruction after correction was not examined on real images.
  • It assumes you know the pixel size and voltage. As above, a 2 % error in pixel size becomes a 4 % error in defocus.

Thin films: reading thickness from a reflectance spectrum, and why a narrow interval can still miss the truth

Fringes in reflectance versus thickness and wavelength

Above: reflectance for thickness 0 to 2 µm (vertical) and wavelength 400 to 800 nm (horizontal), by transfer matrix, SiO₂ on Si. The thicker the film, the more fringes; the colour strip on the right (seen under D65) fades past 1 µm because the fringes average out within the band. (Labels in the figure are Japanese.)

Wafers and optical parts carry transparent films from tens of nanometres to a few micrometres thick. As with a soap bubble, light reflected from the front and back of the film interferes, and the reflectance shows fringes across wavelength depending on thickness. Reading the fringes gives the thickness without contact.

There are two ways to read them: take the fringe period with an FFT, or fit a reflectance computed from the layer structure (a transfer matrix) to the measured curve. This section uses two PoCs to look at thin films, a mix-up of materials, oblique light and identification with an RGB camera. The second PoC is mostly about doubting the result of the fit.

Gates and results

What we looked at Reference Result
Transfer-matrix calculation independently written Airy formula max difference 3.4e-15
Number of fringes (0.2 to 2 µm) closed form d·Δx within ±1 (max deviation 0.43)
Thinnest film the FFT can use closed form 2/Δx = 538 nm (hann) the 5 % boundary is 525 nm, agreeing within ±25 %
Model fit (synthetic, from 50 nm) truth max 0.10 nm over the whole range
Oblique light read with a normal-incidence model (30°, 60°) d cos θ_film within 0.2 %
Converging NA read with a normal-incidence model (NA 0.1 to 0.7) d(1 − NA²/4n²) within 0.3 %; at NA 0.5 a 1000 nm film looks like 970.2 nm
Measured standard 476.3 nm (5 spectra) nominal all five within 2 % (max 1.2 %)
Measured standard 198.7 nm (5 spectra) nominal 4 read 6.6 % thick (median); one best candidate went off to 51 nm
Thickness map with a spectral camera (synthetic wafer) truth RMS 0.17 nm over 155106 pixels

The reflectometry PoC has 37 gates (52 s) and the calibration PoC 17 gates (CPU 107 s); all passed.

Thickness maps from an RGB camera and a spectral camera

Above: a wafer with uneven thickness measured with a spectral camera (RMS 0.17 nm from the truth at every pixel) and an RGB camera. With RGB, 14 % of pixels keep two or more candidates: colour returns to a similar colour every ≈ λ/(2n), so the order gets mixed up. (Labels in the figure are Japanese.)

★ What the check found

  • The FFT cannot measure thin films. For the measured 98 nm film it gives 85.1 nm and itself says "not reliable" (the closed-form lower limit is 554 nm). A model fit decides even a 50 nm film with less than one fringe. That fit works so well only in the synthetic case where nothing but noise differs from the model (an "inverse crime").
  • If you mix up the material, the FFT is silently wrong. A 1000 nm SiO₂ film read with the Si₃N₄ index is pulled by the fit to 712 nm, keeping the optical thickness n·d (measured 708 nm). The FFT says 685 nm and nothing more. The fit can notice, since its residual is large (RMS 0.064; 4e-10 for the right material).
  • A microscope objective admits oblique light, so it reads thin. The measured microscope spectrum of a film (reference 98.5 nm) reads 92.9 nm (−5.7 %) with a normal-incidence model and 95.8 nm (−2.7 %) with the NA 0.5 model that minimises the residual. The microscope's NA could not be read from the paper and is unconfirmed.
  • On the thin standard, the best candidate was wrong. For one nominal 198.7 nm sample, the best candidate was 50.9 nm (−74.4 %). The correct thickness (203.9 nm) remains as the second candidate. Do not collapse a fit to one answer; look at the candidates.
  • Colour alone does not fix a thick film. Even with an ideal calibrated RGB, from 1.2 to 1.5 µm 97 % of points have several candidates, and 38 % of points are off by 30 nm or more. On the thin side (300 to 600 nm) the colours are strong and a single candidate remains (several only for 1 %).
  • Read from a real photograph, −11 %. From a published colour microscope photograph (camera unknown, JPEG) the median thickness on the SiO₂ side was 87.4 nm (reference 98.5 nm). The order is right, but it is four times coarser than the spectrometer.

The calibration PoC: doubting even a narrow interval

Fitting a model with dispersion, NA and gain to the measured spectrum gave these thickness readings.

Model 95 % thickness interval Absolute χ²/ν Verdict
Rich model (dispersion, NA, gain free) 94.63 to 99.03 nm (width 4.39 nm) 0.287 contains the reference 98.5 nm; but no point estimate is given (of five knobs, d, A, NA and gain can stand in for each other)
Normal incidence, tabulated index 93.02 to 93.07 nm (width 0.05 nm) 1.98 narrow, yet excludes the reference; rejected by the absolute χ² gate
Constant index ignoring dispersion 92.60 to 93.19 nm 5.57 rejected
Real photograph (colour microscope) 86.43 to 86.86 nm 11.7 −12 % from the reference; rejected; residual PCA finds a 2-component structure (the camera's spectral response is missing)
  • A narrow interval is not evidence of being right. The normal-incidence interval is only 0.05 nm wide and misses the reference. The interval width is set by noise alone and does not include model error. What caught it was the absolute χ² gate that asks whether the residual fits inside the noise floor (0.00054).
  • The held-out wavelength gate comes from statistics. The ratio of χ² on the 328 held-out wavelengths to the training χ² was 1.211. The upper tail of F(328, 325) is p = 0.0564, above the significance level 1e-3, so it passes (the limit from the older bootstrap was 1.249). Multiplying the held-out residual by 1.5 gives p = 1.3e-18 and is rejected. This p = 0.056 does not prove "no overfitting"; it means "no evidence of overfitting was found".
  • Recovery of synthetic truth is 40 out of 40 within 3σ, and the standard deviation of the error divided by the bound is 1.00.

Profile likelihood of thickness

Above: how χ² grows when the thickness is fixed and the other knobs refitted. The range that does not exceed 3.84 is the 95 % interval (width 4.4 nm). Local collinearity is large, so no point estimate is given. (Labels in the figure are Japanese.)

What it is not for

  • In a 98 nm film, dispersion of the index is invisible. Even a constant index ignoring dispersion passes the absolute χ² (0.286) when A is free. With this measurement, "ignoring dispersion" cannot be rejected.
  • No point estimate. d, A, NA and gain are determined only in combination, so the thickness is stated as an interval. To get one number, NA and the index must be fixed by other measurements.
  • Sometimes only the optical thickness n·d is determined. Measured at one wavelength, n and d are confounded and only A^1·d^0.93 is fixed (for a thin 98.5 nm film the exponent of d is 3.63, which also departs from n·d).
  • Colour identification fades beyond 1 µm. Under continuous light it drifts to grey (chroma C* 8.2); under line-emitting illumination the colour stays (14.5).
  • One real photograph. The camera's spectral response is unknown and CIE colour-matching functions stand in. Against the wafer colour chart, 59 % of the first- to third-order hues fall within ±36° of the tabulated colour names, with the note that colour-name saturation is higher than reality.

Sources of the measured data: Schwarz et al., Adv. Opt. Mater. (2024), doi:10.1002/adom.202402502, data Zenodo 10.5281/zenodo.13753754. Sánchez-Arriaga et al., Sensors 23, 5326 (2023), doi:10.3390/s23115326, data 10.15131/shef.data.23285603. Both CC BY 4.0.

Pixel shift: false colour can go to zero, but resolution may not improve

False colour disappears with pixel shift

Above: a circuit board wiring pattern, a weave, a halftone print and a resolution chart (top to bottom). Left: an ideal sensor measuring three colours at every pixel. Middle: one Bayer shot with bilinear demosaicing. Right: four shots shifted by one pixel each. With a static scene and zero error the four-shot false colour is zero by definition. (Labels in the figure are Japanese.)

A colour sensor measures only one of red, green and blue at each pixel (a Bayer pattern). The other two are filled in from neighbours, which puts colours that do not exist (false colour) on fine stripes. If you shift the sensor by one pixel and take four shots, all three colours are measured at the same point and no filling-in is needed. That is pixel shift. Shifting by half a pixel seems to promise detail finer than the pixel pitch as well.

This PoC checks how much of that expectation is true: for static scenes, when the lens becomes the limit, and for moving subjects. Finally it checks on four raw frames from a real camera.

Gates and results

What we looked at Result
False colour of 4 one-pixel-shifted shots (4 synthetic subjects, static, zero error) 0 (1 shot + bilinear: mean 0.043 to 0.084). Built so that it is 0 by definition
False stripe (frequency f₀ = 0.7 cyc/px) aliases to 1 − f₀ = 0.3 in a single shot, at the same height as a real stripe; with half-pixel shift the peak stands at f₀ = 0.7
MTF50 of a slanted edge 1 shot 0.4782, half-pixel 0.4749 cyc/px, closed form 0.4665; within 3 % of each other (shift does not raise MTF)
Stripe amplitude within 1 % of 0.4·sinc(f₀) (the aliased stripe has the same height)
Piezo positioning error σ = 0.1 px false colour of 4 shots 0.0122, smaller than the single-shot demosaic (0.0526)
R error when one shot is off by δ = 0.05 px measured 0.02489, closed form 0.02520
Noise (R, B as σ/√c; G as σ/√(2c)) within 5 % of the closed form (4 to 32 shots)

All 34 gates passed (20.7 s).

Lens versus pixel

Above: pixel 3.45 µm, wavelength 0.55 µm, F 1.4 to 22. When Q = λN/p exceeds 1.43, the diffraction MTF is zero at 0.7 cyc/px and no stripe remains even in the half-pixel-shifted image. For Q ≥ 2 there is no signal above 0.5 cyc/px and the gain from shifting is 1.0. (Labels in the figure are Japanese.)

★ What the check found

  • The lens hits its limit first. Half-pixel shift widens the usable band from 0.5 cyc/px for one shot to 0.837 cyc/px (1.67 times) only at F 2.8 (Q = 0.45). At F 8 (Q = 1.28) the gain is 1.12 times, and at F 11 it falls to 1.00. The gain runs out at Q* = 1.470 (about F 9.2), before the aliasing boundary Q = 2. Between Q* and 2 lies a zone that is "pixel-limited yet gives a gain of 1.0".
  • MTF does not rise. Half-pixel shift removes aliasing, not MTF. The slanted-edge MTF50 was 0.4782 for one shot and 0.4749 for half-pixel. Resolution "appears" to rise because the false stripes disappear and the true ones stand in their true places.
  • A false stripe appears as strong as a real one. In a single shot a stripe at f₀ = 0.7 appears at 0.3 with the same amplitude as a real one. You cannot tell false stripes from real ones by looking at the image.
  • A good demosaic nearly matches four shots. On real raw data we compared a third-party demosaic (AHD) with the four-shot merge. For stripes finer than 0.25 cyc/px the amplitude is 1.01 times that of four shots and the luminance RMS difference is 0.0127 (bilinear: 0.0608). The colour residual is 0.0203 for AHD, even less than 0.0251 for four shots. The colour left in the four-shot image therefore is not demosaic false colour but something else.
  • For moving subjects, four shots become worse than one. For chip components on a conveyor, the RGB error in the moved region (RMS) is 0.161 for four shots versus 0.205 for a single-shot demosaic at 0.25 px/shot, so four shots are better; at 1 px/shot it is 0.214 versus 0.197, reversed. Falling back to the single-shot demosaic only where there is motion helps at 1 px/shot and above, but loses at 0.25 px/shot (0.205 against 0.161).
  • More shots mean more error for a moving subject. Noise drops with the square root of the number of shots, but the error for a moving stripe (0.1 px/shot) grows: 0.0811 with 4 shots, 0.1608 with 8 and 0.2733 with 16.
  • The shooting-order convention differs per camera. The four real shots are in the order (0,0)→(1,0)→(1,−1)→(0,−1). On a static subject 0.09 % of pixels are judged "moved" with this order and 23.2 % with the op's default order.
  • Passing the sign backwards raises no exception. Giving the sensor's shifts as they are to an independent implementation (drizzle) puts the f₀ = 0.7 peak at 0.3. It lands where aliasing would, so the mistake is hard to notice.

A resolution chart from a real camera

Above: the same place (256 × 1152 pixels, 1:1) from a real sensor-shift camera (full-frame mirrorless). Top: the first raw shot with bilinear demosaicing. Middle: the same shot with AHD. Bottom: the four shots merged. Bilinear shows colour moiré on the fine stripes. Data: PixelShift200 (G. Qian et al., ICCP 2022), CC BY 4.0 (modified). (Labels in the figure are Japanese.)

What it is not for

  • It assumes a static workpiece and a fixed positioner. It is unsuitable for moving subjects or vibrating machines. By the numbers above, once the conveying speed exceeds 0.25 px/shot a single shot is safer.
  • Stopping down erases the gain. The lens hits diffraction first (beyond Q* = 1.47 the gain is 1.0), so check the ratio to the pixel pitch before choosing the F-number.
  • Noise does not drop. Four-shot pixel shift is for false colour; R and B noise is the same as in one shot. To lower noise, repeat the cycle.
  • "False colour 0 in four shots" is a product of construction. In the synthetic evaluation, with zero error and a static scene, it is 0 by definition. The meaningful numbers are those of the sections with positioning error and motion, and the real raw data.
  • The real-camera check covers one model and one chart. It does not necessarily hold for other models or subjects.

TDI line scan: more stages reveal dim defects, but synchronisation and the lens break first

Defects as seen with different TDI stage counts

Above: a dim line with 40 photons per stage × reflectance and 12 e⁻ read noise. From the left: a scratch (1.3 px wide, 12 % deep), four pinholes (16 % deep) and a foreign particle (8 % deep). Each panel is stretched to its own median ± 3σ, so the figure shows differences in SNR, not in brightness. (Labels in the figure are Japanese.)

To inspect things that keep flowing past, such as film, steel sheet or wafers, you image them with a one-row sensor (a line scan camera) while they move. TDI (time delay integration) images the same row with N rows of sensor in turn and adds them, so even a dim line collects N times the light. Because the exposures are summed, though, any small mismatch between transport speed and the sensor's readout rate smears the image.

This PoC follows the relation between stage count and SNR, the blur from a synchronisation error, skew and meander, and the difference between a line-scan lens and a general-purpose one.

Gates and results

What we looked at Reference Result
SNR measured from images (1 to 64 stages, charge and digital summation) closed form: EMVA 1288 Eq. 21 times the stage count worst 1.2 % over all stage counts and both methods
Growth of SNR with 64 digital stages √N = 8 ×8.09
Growth of SNR with 64 charge-summed stages (dim line) ×26.86 (far above √N = 8)
Blur from a synchronisation error ε (45 conditions) |sinc(f·N·ε)| max difference 0.0035
Cross-direction blur from yaw (skew) (9 conditions) |sinc(f·N·sin θ)| max difference 0.0017
Defect detection (3 kinds) 0/3 with 1 stage, 2/3 with 32, 3/3 with 64; zero false detections
Illumination = cos⁴ × pupil × distortion exact max difference 2.2e-16

All 19 gates passed (9.3 s).

SNR versus stages

Above: SNR measured by the EMVA 1288 two-image method (temporal noise) and the closed form, Eq. 21 times the stage count. (Labels in the figure are Japanese.)

★ What the check found

  • Charge summation beats √N when dim. Charge summation pays the read noise only once, so on a dim line of 40 photons per stage, 64 stages give an SNR 26.86 times higher. Digital summation gives the expected 8.09 times (√N). When bright (4000 photons per stage), charge summation also returns to nearly √N (×8.235). The benefit of TDI is largest when it is dim.
  • A synchronisation error acts N times over. Over 64 stages the image drifts by 64·ε pixels. At ε = 2 % that is 1.28 pixels, and the MTF at 0.25 cycles/px falls to 0.84; at ε = 4 % it is 0.45. The MTF is a |sinc|, so the first zero is at 1/(N·ε) (0.391 c/px at ε = 4 %).
  • Encoder synchronisation removes speed waviness. With a ±3 % speed ripple and a 1 % offset, the line pitch of a free-running camera ranges 0.980 to 1.040 rows and the local MTF drops to 0.637. With encoder synchronisation the pitch stays 1.000 and the MTF returns to 1.
  • Yaw and meander cannot be fixed with an encoder. If the web is skewed by θ from the scan axis, it shifts 64·sin θ pixels across the width over 64 stages (2.23 pixels at 2°). It is a cross-direction motion, so matching the speed does not remove it. The MTF at 2° and 0.2 c/px was 0.703.
  • Reusing a C-mount lens leaves the sensor ends dark. For an 8192 × 7 µm (57.3 mm) sensor, the illumination at the end (image height 28.7 mm) was 0.976 with the line-scan lens and 0.000 with the C-mount lens (zero from image height 19.7 mm). 2589 columns get no light, and flat-field correction over the full width is refused.
  • The line-scan lens is brighter at the end than the cos⁴ law says. Where cos⁴ alone gives 0.855, barrel distortion (−2.9 %) shrinks the image for ×1.111 and the pupil adds ×1.027.
  • Brightness can be corrected, blur cannot. The modulation at 0.2 c/px does not change with correction (max difference 0.0006). At image height 14 mm, the C-mount modulation is 0.000 against 0.211 for the line-scan lens. The CNR of a foreign particle at the end stays 1.52 → 1.54 with the C-mount lens even after correction, and 2.49 with the line-scan lens.

Brightness shading over the full width

Above: full-width images on the same brightness scale. The ends of the C-mount version lie outside the image circle and receive no light (the correction is refused). (Labels in the figure are Japanese.)

What it is not for

  • The synchronisation model covers a constant speed error ε and ripple only. Statistics of belt slip and the discreteness of charge transfer are not included.
  • Light levels are two points, 40 and 4000 photons per stage. To match your own camera, replace the values (quantum efficiency, read noise, gain) with those from its EMVA 1288 datasheet.
  • The lens model is not the prescription of a real part number. Do not quote the image-height numbers as the performance of a particular lens. What you can quote is the property: with too small an image circle the ends vanish, and correction restores illumination but not MTF.
  • The defect images are scratches, pinholes and a particle placed on a synthetic cold-rolled steel texture. They were not compared with images from a real machine.

Reading depth from colour: chromatic confocal and OCT

The rainbow ruler

Above: white light enters a 16 mm focal-length dense-flint aspheric singlet and eleven colours of rays are traced as real rays. Below: a close-up near the focus (vertical stretched 5 times against horizontal). The foci of 450 to 700 nm line up along the axis over 1191 µm. That is the scale. (Labels in the figure are Japanese.)

Two methods read the distance (height) to a surface from the chromatic aberration of a lens and from interference of light. Both use the fact that the depth in focus, or the interference fringes, change with wavelength, so depth can be read without mechanically moving the focus. Chromatic confocal sensors measure surface height; OCT (optical coherence tomography) measures the thickness of transparent layers inside.

Chromatic confocal: colour tells the height

If the chromatic aberration of a lens is deliberately large, blue focuses near and red far. Illuminate with white light, split the light returning through the pinhole into a spectrum, and the strongest wavelength gives the height of the surface.

What we looked at Reference Result
Paraxial focus closed form for a thick lens within 3.6e-12 µm at all wavelengths
Measurement range (450 to 700 nm) 1191 µm by real rays (paraxial closed form 1161 µm)
Width of the axial response (mirror) 0.443 λ/(1 − cos α) 21.19 µm (numerical 21.10)
Step truth 50 µm read as 49.959 µm, profile RMS error 0.276 µm (with noise)
Surface tilted by 2° returned light falls to 71 %, RMS error 0.227 µm
Thickness of transparent plates (200 to 500 µm, four plates) with NA correction truth within 0.1 %

All 33 gates passed (34 s).

  • ★ The ranking of peak estimators flips with noise. Without noise the bias is 0.060 µm for the Gaussian fit, 0.108 µm for the parabola, 0.293 µm for the centroid and 2.043 µm for the maximum bin. With noise, though, a three-point Gaussian scatters 4.4 times more than the centroid. Choosing by noiseless bias alone gets reversed on a real machine.
  • ★ Calibrating with a mirror removes the Gaussian's bias (0.060 → 0.014 µm) but leaves 0.090 µm for the parabola. A smooth bias can be absorbed by a calibration table; a bias that oscillates with each bin step cannot.
  • ★ An asphere corrects spherical aberration for only one colour. Even with zero longitudinal aberration at 575 nm, 450 nm leaves −40.2 µm and 700 nm +18.9 µm. A mirror-calibrated peak sits about half of the longitudinal aberration away from the paraxial focus (−20.0 µm at 450 nm), which the calibration absorbs. A spherical singlet of the same focal length has −863 µm of longitudinal aberration and a response 28.7 times wider, unusable as a scale.
  • A transparent plate reads wrong by −1.23 µm with the paraxial correction alone. For 500 µm borosilicate crown, including the NA correction gives −0.067 µm. Using the catalogue n_d gives −2.18 µm (the difference between the index at the colour that sees the lower face and n_d).
  • A gold surface reads far. Reflectance rises sharply near 509 nm, so the reading shifts by up to 0.15 µm. Dividing by the tabulated gold reflectance brings it back to −0.005 µm.
  • Unevenness of a white LED is a bias too. It pulls the reading by up to 0.93 µm; dividing by a white reference gives 0.014 µm.

What it is not for

  • If the mirror-like surface tilts more than 8.8° (red) to 9.5° (blue), nothing returns. The spectrum synthesis refuses with "no return" and does not silently read zero.
  • Transparent films thinner than 32 µm do not split into two peaks (Sparrow's closed form: 30.6 µm). It refuses to guess a thickness for thin films.
  • The real-image stage (reading a groove depth from figures in a published paper) runs only when the figures are placed, and did not run this time.

A real B-scan of OCT

Above: raw interference spectra of automotive paint samples (CC BY 4.0), k-linearised and Fourier transformed using Fullseye ops only, with interfaces traced by dynamic programming. Width 1 mm (100 lines). The white sample scatters strongly in the coloured layer and the lower interface does not stand out. The horizontal line below the surface in III-B is an autocorrelation ghost. (Labels in the figure are Japanese.)

OCT: reading layer thickness by interference

OCT interferes a reference beam with the light reflected from the sample and arranges the reflecting positions along depth. It measures the thickness of paint or coatings without cutting. A spectrometer records the interference spectrum; converting it to wavenumber and taking an FFT gives the reflection at each depth.

What we looked at Reference Result
Axial resolution and depth range (SD 840/50 nm, 2048 pixels) closed form 6.23 µm (air), depth range 2257 µm
Measured clear-layer thickness (4 samples) OCT and microscope in the paper within 2 µm of the paper's OCT, within 4 µm of the microscope
Multilayer film (synthetic, PMMA 25 / PC 40 / PS 15 µm) divided by the group index truth within 0.05 µm (max 0.037 µm)
Point-spread width closed form within 1 %
Broadening from dispersion mismatch √(1 + σ⁴φ₂²) within 0.5 %
SNR of the lower interface Beer-Lambert within 1 dB

All 32 gates passed (63 s).

  • ★ On the measured coloured layers, one sample was off by −7.6 µm. Of four samples, three coloured layers were within 2.5 µm of the microscope, but VI-D was off by −7.6 µm. The spacing of the two peaks in the mean profile is 17.1 µm (optical path), which does not match the paper's OCT value 15.4 µm either. It is left unresolved.
  • ★ The paper gives no mapping between sample files and table rows. We fixed the mapping uniquely from the clear-layer thickness (sum of deviations 2.47 µm for the best, 28.87 µm for the next), so it is an inference. The comparison of the coloured layer is independent of this mapping.
  • A white paint hides its lower interface. The coloured layer scatters strongly (μ_t ≈ 36 /mm estimated), and the lower interface has no peak 1 dB above the valley, so it was refused. The four black and dark samples were accepted.
  • An autocorrelation ghost appears horizontal. In III-B a horizontal line stands at 155.9 µm depth (clear-layer optical thickness 155.6 µm). It tilts only −0.3 µm against the surface tilt of −18.2 µm over 1 mm, so it is an interference between the surface and the lower interface, not with the reference. It can be removed only with a difference of two shots with shifted phase.
  • FFT on wavelength-equispaced data widens with depth. The point-spread width grows to [31.1, 91.3, 151.6] µm; after k-linearisation it is a constant 7.3 µm.
  • Interpolation can make SNR look better. Wavelength-equispaced data with cubic interpolation looks 0.96 dB better than the closed form (interpolation correlates the noise and lowers the floor). Sensitivity must be quoted from the noise before interpolation.
  • Dividing by the phase index gives 1 to 2 % too thick. Dividing by the group index matches the truth.
  • A surface in front of the reference folds to the positive side at the same depth. A surface 300 µm in front appears at +299.7 µm. A quadrature pair (I₀ + i I_{π/2}) separates the true surface to the negative side, and the residual for a reference phase error δ agrees with 20 log tan(δ/2) within 0.1 dB.

A B-scan of a coating

Above: a synthetic B-scan of a coating over a step (width 1.2 mm). At the delamination on the left (an air gap of 3 to 8 µm) the plate surface brightens; at the cavity on the right (radius 11 µm) the upper and lower surfaces appear as dots. (Labels in the figure are Japanese.)

In the synthetic B-scan that searches a coating over a component step for delamination and voids, the median thickness error over the 175 columns outside delaminations, voids and edges is 0.30 µm and the 95th percentile 4.12 µm. It detects 72 % of delamination columns and 5 of 5 void columns, with 0 false columns outside.

What it is not for

  • Thin layers have a lower limit. Layers thinner than 5.81 µm without a window, or 6.83 µm with a Hann window, are refused (two point images overlap and their peaks pull each other, so the thickness would be biased even if seen).
  • Strong scattering sinks the lower interface. The SNR budget gives an upper limit μ_t of 102 /mm, above which it is refused.
  • When the delamination gap is 3 to 8 µm, reflections from the upper and lower surfaces interfere and the brightness oscillates with thickness, causing missed detections (72 % detected).
  • The coating B-scan is synthetic. The only measured B-scans are the paint samples (figure above).

Deflectometry: a 3 µm dent the photo cannot show, seen in the bending of stripes

Photograph versus stripe reflection

Above: the defect signal in the photograph is at most 0.00066, below one 8-bit step (0.0039). A reflection of stripes bends only slightly at the dent (under a tenth of a period), but it gets clearer going phase → gradient → curvature. The SNR of the curvature map is 110 for dent A and 57 for dent B. (Labels in the figure are Japanese.)

Dents a few micrometres deep on a mirror or glass surface are almost invisible in an ordinary lit photograph. A mirror only reflects the lighting, and a dent changes only the direction of the reflection. Phase-measuring deflectometry shows stripes on a screen in front of the surface and photographs how the stripes bend in the reflection. The bending is the change of surface slope, from which curvature and height can be recovered.

In this PoC a screen (520 × 320 mm) 300 mm from the surface displays the stripes; a 40 mm field of mirror carries a 3 µm dent A, a 1 µm dent B, polishing marks and waviness, and we imaged it both as a photograph and with stripes.

Gates and results

What we looked at Reference Result
Dent signal in a photo (reflecting a softbox) one 8-bit step = 0.00392 at most 0.00066 (0.17 of a step), under noise σ 0.004
Dent SNR in the curvature map dent A 110, dent B 57 (photo: 0.17)
Dent depth after integration truth A: 2.662 µm (truth 2.676, −0.5 %), B: 0.990 µm (0.994, −0.4 %)
Section through dent A truth RMS 0.004 µm
Phase noise √(2/N)·σ/b measured 7.30e-03 / closed form 7.31e-03 rad
Noise-free round trip (render → phase → slope) analytic truth at most 1.35e-05 rad outside the polishing marks
Believing the screen distance is 2 % longer slope ∝ 1/d dents read −2.34 % shallower

22 checks, all passed (CPU 23 s).

Recovered profile of the dent

Above: truth (dashed) and recovery (solid) nearly overlap, so the difference is shown ×10 as a dotted line. The 0.8 µm waviness overlaps too. (Labels in the figure are Japanese.)

★ What the check found

  • Height and slope cannot be told apart with one camera. A surface being Δz higher and its normal being tilted by Δz·sin θ/d make the same phase. Place the part 0.3 mm high and the apparent slope at the field centre becomes 3.42e-04 rad, which looks like a 13.7 µm step across 40 mm. The dent depth changes only from 2.676 to 2.658 µm (−0.7 %). Local defect inspection is robust against this ambiguity.
  • A distance error turns into a bowl over the whole surface. An error of 2 % in the screen distance makes the whole surface look like a bowl of radius 41 m. That is why the depth is measured after removing the local quadratic shape.
  • Roughness has a stage where noise grows and a stage where measurement fails. Raising the diffuse fraction k_d, the slope noise grows as 1/(1 − k_d), as the closed form says. Up to k_d = 0.85 (stripe amplitude about 15 steps of 8 bit) the 1 µm dent is visible; at 0.9 the SNR of dent B drops to 1.2 and fringe orders of the coarse stripes start to jump. At k_d = 0.95, 8.55 % of orders jump and at 0.99, 68 %; beyond that it is no longer "noise grows" but "cannot be measured". Both happen at the same k_d because the phase noise of the coarse stripes (period 160 mm) counts 16 times larger than that of the fine ones.
  • The back reflection of a cover glass makes the dent look a quarter as deep. Without an anti-reflection coating (n = 1.52), the front reflection (4.29 %) and the light returning from the back (3.93 %) are almost equally strong, so the phase of the sum of two stripe patterns shifts. Moreover, the light from the back goes back and forth through the wedge of the dent slope and bends the opposite way, shrinking the slope sensitivity to (2 R1 − 1.15 R2) / 2(R1 + R2) = 0.246 (measured 0.246). For thicknesses 0.10 to 2.00 mm the depth of dent A is off by −75 / −75 / −75 / −74 / −71 %.
  • Focusing on the screen makes the dent look shallow. Focused on the surface, the circle of confusion on the screen side is large and the stripe amplitude falls to 0.60, but the dent depth is preserved. Focused on the screen, the stripes are sharp but the surface is blurred and the dent looks 0.52 times as deep.
  • A photo of a uniform screen shows zero signal. Reflecting a uniform white screen, the defect signal is at the rounding level (1.1e-16). A mirror shows only the pattern of the lighting, so how a defect looks depends on that pattern.

Back reflection of a cover glass

Above: front and back reflectances are almost equal (R1 0.043, R2 0.039), so the phase of the sum of the two stripe patterns can shift by up to 1.16 rad. The dent depth is off by −75 / −75 / −75 / −74 / −71 %, regardless of thickness. (Labels in the figure are Japanese.)

What it is not for

  • Surfaces with a large diffuse component (k_d 0.9 or more). When the stripe amplitude approaches one 8-bit step, the phase is undetermined.
  • Transparent plates without an anti-reflection coating. The dent looks a quarter as deep, so it is unsuitable where the absolute depth matters. Check for a coating first.
  • Absolute height. Because of the ambiguity, height is usable only as a local relative value.
  • Large fields or sharp shapes. The field here is 40 mm, and the maximum slope of the dent is about 1.5 mrad, a smooth shape. For fine shapes like the polishing marks, the error of bilinear re-reading reached 13 %.
  • There is no comparison with measured images. All the numbers are for synthetic surfaces.

Interference and moiré: measuring steps in nanometres, and the pitfall where the reading shrinks

A fringe-based step measurement and gain error

Above: the gain (measured / true) is the same for four step heights. That means it is a scale error, not an offset. Reading reproducibility as accuracy lies here. (Labels in the figure are Japanese.)

Steps and displacements of nanometre order are smaller than the wavelength of light. There are two tools for measuring them. White-light interferometry reads the step from the envelope of the light. Moiré reads the displacement from the movement of coarse fringes made when two gratings are overlaid. Both convert a small quantity into a large visible one.

White-light interferometry (coherence scanning): the step never wrapped

Phase-shifting, which measures a step by the fringe phase, gets the fringe order wrong once the step exceeds a quarter wavelength. White-light interferometry measures from the fringe envelope (the hill of fringe strength), so it should not wrap.

What we looked at Reference Result
Step measured without noise (50 to 500 nm) truth error at most 6.9e-11 nm
1 % noise, 40 repeats is the bias distinguishable from noise biases +1.62 / −1.16 / −1.79 / +2.41 nm are indistinguishable; standard deviation 10.5 to 14.1 nm
Steps near integer multiples of λ/2 = 0.30 µm (9 points) phase shifting phase shifting jumps the fringe order at all 7 points of 0.151 µm and above; the envelope method is at worst 6.9e-11 nm
  • ★ The prediction was wrong. We looked for a λ/2 wrap and could not find one. The envelope has no period, so there is nothing to wrap. It is not a bug but the definition of the method.
  • ★ The estimator with the best reproducibility is not necessarily the best. The centroid method scatters 1/3 to 1/5 as much as the Gaussian fit, but as noise rises it shrinks the step itself. The gain (measured / true) was 0.811 at 1 % noise, 0.550 at 3 % and 0.201 at 10 %. The gain is the same for 50 nm and 500 nm steps. It cannot be found by repeating a measurement without planting a true value.
  • A finer scan does not improve it. A 0.02 µm step (601 planes) scatters as much as 0.10 µm (121 planes) and takes five times the time, because the local fit looks only at the three points near the maximum.
  • The step ceiling is not a safe operating point. At 0.14 µm, just under the Nyquist limit λ/4 = 0.15 µm, a noise-free error of +14.1 nm already appears (0.02 to 0.12 µm are within 0.351 nm).
  • The error of the "maximum sample" is not noise but rounding to the scan grid. With a scan step of 0.04 µm and a step of 2.5 scan steps, the error is exactly half a scan step, −20.0 nm, matching the prediction exactly. A sub-sample estimate gives −1e-11 nm from the same data.

What it is not for

when the noise (amplitude ratio) exceeds 0.5 %, the total error of the Gaussian fit for a 100 nm step exceeds 10 % (for the centroid, 0.2 %). At 5 %, 30.7 % of pixels are rejected. Which estimator to use can be decided only with a measurement where the true value is planted.

Moiré alignment: a shift of an invisible grating appears as the motion of coarse fringes

Moiré marks

Above: the same camera (pixel 0.5 µm, blur σ 1.5 µm) and the same noise. A 2 µm grating vanishes in the camera, and only the difference frequency of the product of the two remains. In (d), the orange lines are the fringes after the wafer moved 600 nm; A and B move in opposite directions. (Labels in the figure are Japanese.)

Overlay a wafer grating of pitch 2.04 µm and a mask grating of pitch 2.00 µm, and fringes of period 102 µm appear. If the wafer moves 100 nm, the fringes move 5.0 µm, a magnification of 50. An image of the wafer grating alone is uniform grey, and the shift is invisible.

What we looked at Reference Result
RMS error over eleven 1 nm steps moiré 0.083 nm (cross-correlation + parabolic interpolation 1.03 nm)
Ratio to the noise bound (CRLB), σ 0.003 to 0.030 closed form 1.00 (sits on the bound)
Differential when a flow of 300 nm and a 30 % illumination tilt overlap truth differential −0.021 nm (single pair −6.578 nm)
When the camera magnification is mistaken by 2 % differential +0.007 nm; cross-correlation goes off by a factor 1.020
Four-quadrant mark truth (12, −25) nm (11.95, −25.00) nm

All 32 gates passed (4.9 s).

  • ★ Most of the 91-fold difference is the bias of the competitor. With the same noise, the moiré RMS error is 91 times smaller than that of cross-correlation with parabolic interpolation, but most of that is the bias of parabolic interpolation (−17.4 % of the shift). With only the random error after removing the bias, it is 0.077 nm for moiré against 0.192 nm for cross-correlation, a factor of only 2.5.
  • Wrapping is one period. The capture range of a single pair is the wafer pitch (2.04 µm), and the differential wraps every 1009.9 nm. Fixing the order with a coarse cross-correlation reads 0 to 5 µm without wrapping (RMS 0.137 nm).
  • A change in gap makes the reading jump. At close gaps, the fringe sign reverses at half the Talbot length (2p²/λ = 14.55 µm), that is 7.27 µm. If the gap between the reference and measured images crosses the reversal, 2 → 6 µm, the reading jumps by half a period (1020 nm) and reads −990 nm.

What it is not for

it assumes the fringe period is sufficiently longer than the camera pixel. The smaller the pitch difference of the two gratings, the larger the magnification, but the narrower the capture range.

Moiré on a screen: the two failures that cancel when you blur

Leakage and attenuation by smoothing

Above: at a smoothing width σ ≈ 8 px, leakage and attenuation balance. Looking only at the sum makes it look like "a good way to measure". (Labels in the figure are Japanese.)

When you photograph the luminance unevenness of a display with an inspection camera, interference between the screen pixels and the camera pixels produces moiré with a period of about 20 px. The usual shop-floor trick is to blur it: the moiré vanishes and only the unevenness remains.

  • ★ A 0.9 % error from blurring is two opposite failures cancelling each other. With a smoothing σ = 8 px, the error in the amplitude of the unevenness (true value 0.0200) is +0.9 %. The breakdown is a leakage of +8.3 % read from the stripe-only image and an attenuation of −7.4 % from the unevenness-only image. When the panel brightness or the stripe phase changes, the cancellation breaks at once.
  • An optical low-pass on the camera side (σ 0.30 px) is the only method that brings both to zero. It squashes the stripe (3.05 cyc/px) by 6.6e-8 while reducing the unevenness (0.00781 cyc/px) only to 0.999892, because the frequencies are 400 times apart. In post-processing the moiré has already aliased into the same low-frequency band as the unevenness, so the same trick does not work.
  • A harmonics trap. A stripe density k = 0.67 (one displayed stripe imaged at 1.5 pixels) is safe if you look only at the fundamental, but the third-order beat falls into the band with a period of 100 px and leakage becomes +202.6 %. At k = 3.05 the third order is harmless because the pixel aperture's sinc crushes the higher orders.
  • Rotating the camera by only 0.5° moves the moiré period from 20.0 to 17.7 px. It depends strongly on the mounting accuracy of the fixture, which is how "it didn't appear yesterday" happens.
  • A plain notch fails because of the analysis-window length. When the beat sits between FFT bins (bin 25.60), the leakage skirt spreads over the whole band and 28.5 % leaks. Cutting the analysis window to 360 pixels so that δ·L is an integer (18.00) brings the leakage to +0.0 %. No re-shooting is needed; it is a window problem.

What it is not for

a second-order surface fit cannot represent a four-period cosine and picks up only 4 % of the unevenness. Do not reuse a shading-correction op as a luminance-unevenness meter. All the numbers in this section are from synthetic images.

Polarisation: removing glare and measuring shape, with Brewster's angle as the lead

Incidence angle and degree of polarisation of the specular reflection

Above: the p-polarised reflectance R_p crosses zero at Brewster's angle. Too shallow or too steep an angle lowers the degree of polarisation, so the usable window is narrow. (Labels in the figure are Japanese.)

The glare (specular reflection) from metal and resin is polarised, because light reflected from a surface has different reflectances for the component parallel to the plane of incidence (p) and the one perpendicular to it (s). Rotating a polariser while shooting changes only the glare, so you can remove it or work out the orientation of the surface. For a refractive index of 1.5, the angle at which the p reflectance becomes zero, 56.31°, is Brewster's angle, and the degree of polarisation of the specular reflection is 1.

This section uses two PoCs. One separates the diffuse reflection (the object's colour) from the specular reflection (the glare) using images taken through a polariser at four orientations. The other reconstructs surface slope (normals) and shape from polarisation.

Gates and results

What we looked at Reference Result
Error of the diffuse component separated at Brewster's angle 4.7e-17 (the double-precision floor); the best naive method without polarisation 1.3e-02
Error at incidence 20° / 40° / 70° closed form R_p × E 2.012e-02 / 8.608e-03 / 2.556e-02; difference from the closed form at the 1e-17 level
Degree of polarisation of the specular reflection closed-form Fresnel 1.0 at Brewster's angle (max difference from another Fresnel implementation 7.8e-16)
Normal error obtained from polarisation (dome) truth median 0.53° (lens 1.09°)
Same part by photometric stereo truth median 26.4°, 50 times that of polarisation
Height of the dome truth 37.9 px max 37.5 px, RMS error 0.62 px
Refractive index (measured with a calibration sphere) truth 1.57 1.5691

The ops of the separation PoC run at about 83 ms per megapixel (13 times a naive minimum, but fast enough for every frame). The shape PoC has 11 checks, all passed (2.2 s).

Normals from polarisation

Above: a comparison of normals. Photometric stereo sees only the glossy points and forces normals onto the diffuse-reflection formula. (Labels in the figure are Japanese.)

★ What the check found

  • The best incidence angle splits by the axis of evaluation. In absolute terms the error of the diffuse component is worse at 70° (2.6e-02) than at 20° (2.0e-02), because the p reflectance rises gently on the shallow side and steeply on the steep side. Against the method without polarisation, though, 70° is best (4.03 times) and 20° worst (1.20 times). "The best incidence angle" has no meaning until you fix the axis of evaluation.
  • What matters is not "s is strong" but "p vanishes". The closed form of the error is R_p × E and does not depend on R_s. We expected the opposite.
  • The landslide win at Brewster's angle holds at one point only. The ratio to the method without polarisation is 14 to 15 orders of magnitude at Brewster's angle but 1.2 times at 20°. Do not generalise from one point.
  • If the incidence angle is known, the bias can be removed in closed form. The corrected error is at the 1e-17 level. The price is noise amplified by 1/ρ, 5.9 times at 20°.
  • Saturation breaks things silently. With 0.6 % of the pixels blown out by glare, the error is 0.15 times the bias at 70°; 1.3 % gives 0.49 times and 2.4 % gives 1.35 times (9.7 % of the mean diffuse is wrong). Noise stops it with a rejection and calibration error is small (0.06 times even when 20° off), whereas saturation never raises an exception. The fail-closed check only looks at whether the minimum intensity goes negative and lets saturation at the top pass.
  • Calibration errors break different things. An angle offset common to all pixels does not break the separation at all (it stays at the 1e-17 level even when shifted by 20°). Instead the orientation of the polarisation is off by exactly that amount, which breaks only shape reconstruction.
  • The fourth image helps only with noise. There are three unknowns, so three images determine them without noise. At noise σ = 1e-2, four images are 1.46 times better than three.
  • The polarisation degree of the whole scene dilutes the glare. The whole-scene degree of polarisation is 0.0778, one sixth of the pixel maximum 0.4676. Judging by the average misdiagnoses the scene as "polarisation is of no use".
  • In shape reconstruction every pixel has four candidates. The degree of polarisation of the specular reflection has two zenith angles on either side of Brewster's angle, and two azimuths differing by π. All 8797 pixels had four candidates; polarisation alone cannot say which is right, so the candidates are returned as a set and resolved later.
  • Noise concentrates at the Brewster ridge and at the apex. The normal error was 0.57° on the slope, 1.27° on the ridge (where the top of the polarisation degree is flat and the inverse unstable) and 4.87° at the apex (where the degree is 0 and the azimuth undefined).
  • A wrong refractive index shifts everything smoothly. With the true n = 1.57, n = 1.40 gives 2.21° and n = 1.75 gives 2.15°. Mixed-in diffuse reflection makes the error grow monotonically: 2.5° at 5 % and 10.1° at 50 %.

Effect of saturation

Above: 1.8 times the pixel fraction gives 2.8 times the error. Unlike noise (proportional to σ) and calibration error (proportional to δ), saturation acts super-linearly. (Labels in the figure are Japanese.)

What it is not for

  • Setups where the incidence angle is far from Brewster's angle. Too shallow or too steep and polarisation does not help; at 20° it beats the method without polarisation by only 1.2 times.
  • Scenes with a lot of blown-out glare. Saturation overestimates the diffuse component without warning. Lower the exposure, or count the saturated pixels first.
  • Surfaces with a strongly mixed diffuse reflection. Shape reconstruction has an error of 10° at 50 % diffuse. There is not yet an op that estimates the mixing ratio.
  • No measured images were used. All the numbers are values for synthetic surfaces.

X-ray (dual energy): one transmission image measures only thickness; counting at two energies lifts bone and glass out of meat

Foreign bodies on a meat tray

Above: a synthetic tray of meat 25 to 60 mm thick and uneven, with bone, glass and other bodies buried in it. In the single transmission image (upper right) the bone and glass steps are only 0.86 and 0.88 times the meat unevenness, so one threshold flags 86 % of the meat. Lower left is the high-energy band alone: the edge of a meat overlap stays as two false lumps. Lower right is the Al image from splitting the two windows into lean meat and Al: only the foreign bodies remain (0 false lumps). (Labels in the figure are Japanese.)

The transmission image in food X-ray inspection measures one number per pixel, L = −ln(I/I₀). Thick meat and a thin hard foreign body produce the same L. If the swing in L from unevenness in the meat is larger than the step made by a bone fragment or a glass shard, a single image cannot tell them apart.

A detector that counts photons in two energy windows (photon counting) changes this, because the shape of the attenuation μ(E) differs by material. At low energy the photoelectric effect dominates and attenuation scales as Z³/E³, so materials with a large Z rise steeply. At high energy Compton scattering dominates and materials line up by electron density. Using that difference in slope, two equations per pixel separate thickness from material: the basis decomposition shown by Alvarez and Macovski in 1976. This PoC splits every pixel into a "lean-meat thickness" and an "Al thickness". A foreign body appears on the Al side as its difference from the meat it displaces.

Attenuation values come from the NIST SRD 126 tables. The X-ray tube spectrum is a simple physical model (Kramers thick anode, electron depth, self-absorption, characteristic lines) whose four scale constants were fitted to the shape of a public open-source spectrum calculator (MIT licence).

Gates and results

What we looked at Reference Result
Mass attenuation μ/ρ NIST published values (Cu at 8 keV 52.55 cm²/g; 278.4 above the K edge) Difference 0.0e+00 at the published points (as expected for a table lookup); 38.39 just below the K edge at 8.97 keV
Effective atomic number of water Mayneord's formula (exponent 2.94) 7.42 (7.4167)
Half-value layer of the tube Eight IEC 61267 qualities, within 7 % (not used for fitting) Max 5.8 %
Convergence of the basis decomposition Every pixel 0 rejected / 38400 pixels
Bone and glass step (single image) Smaller than the meat unevenness (confirms they are buried) Bone 0.86×, glass 0.88×
Bone and glass step (Al image) More than 5× the noise Bone 7.5×, glass 6.5×
False detections at the threshold that catches 90 % of bone and glass Single image: 86.30 % of the meat (1 false lump) / high band: 0.54 % (2) / Al image: 0.00 % (0)
Error of the basis direction (through noise and background estimation) Within 0.35 rad 0.007 to 0.186 rad (largest for glass)
Apparent Z (no noise) Within 1.5 of the composition's Z_eff Bone 13.8 (composition 13.2), glass 12.7 (12.2), aluminium 13.0 (13.0), stone 15.0 (15.1)
Closed-form error rate Φ(−d′/2) Monte Carlo (20000 samples each) Max difference 0.0041 (tolerance 0.0156)
Al thickness at which they cannot be separated (5 % error) Closed form and Monte Carlo within 10 % Closed form 0.125 mm, measured 0.126 mm; 0.364 mm under 40 mm of meat
Noise of the decomposition Within 5 % of the Cramér–Rao bound 0.995× and 0.997× the bound; correlation −0.974 (bound also −0.974)
Decomposing without knowing 25 % charge sharing Disappears once the response is known Al component of meat −0.3224 cm (−13.8× the noise); 1.5e-06 cm with the response
Monochromatic approximation (beam hardening) Al −0.0054 cm at 1 cm of meat, −0.1459 cm at 6 cm
Inputs that cannot be measured Refused, no value returned 6 / 6

All 21 gates passed (3.6 s).

Colouring foreign bodies by material

Above: on the single transmission image (grey), only the pixels that stand out in the Al image are overlaid with the apparent Z read from the basis direction (green 12 to 14, yellow to orange 15 to 20, red 25 and above). Polyethylene and rubber do not reach the noise pixel by pixel and are not coloured. (Labels in the figure are Japanese.)

★ What the check found

  • A single image loses even if you take only the high-energy side. At the threshold that catches 90 % of bone and glass, 86.30 % of the meat is flagged. Taking only the high-energy side cuts false detections to 0.54 %, but the edge of a meat overlap stays as two false lumps. In the Al image from lean meat plus Al, both the thickness and the overlap of the meat go to the lean-meat side, so there were 0 false lumps.
  • A pair that gives the same L cannot be told apart in one window. Thick polyethylene and thin Al, matched to the same L in the high window, have d′ = 3.1e-14 in a single image, which is 0. With two windows d′ grows in proportion to the Al thickness, but a thin enough layer still cannot be separated. The thickness at which the error rate is 5 % is 0.125 mm in closed form and 0.126 mm by Monte Carlo. Putting 40 mm of meat on top removes photons and moves it to 0.364 mm (2.9 times).
  • Organic matter lighter than meat is not picked up pixel by pixel. In the Al image, polyethylene and rubber sit at −0.9 and −1.2 times the noise per pixel, short of 3. Averaged over a region, Al comes out negative (lighter than meat): −0.0212 cm and −0.0272 cm.
  • The apparent Z of a buried body moves with density, not only composition. PVC has a composition Z of 13.9 yet reads 18.7 even without noise. Chlorine's photoelectric effect and the low density (1.41) pull its difference from the displaced meat towards stone. With noise, bone read 15.2 (composition 13.2) and glass 12.3 (12.2).
  • Decomposing without knowing the detector response turns meat into a foreign body. If a detector with 25 % charge sharing and 8 keV energy resolution is treated as ideal, photons from the high window leak into the low window and all the meat reads as "containing Al", at −13.8 times the noise. No exception is raised. Decomposing again with the response brings it down to 1.5e-06 cm.
  • The monochromatic approximation biases more as the meat gets thicker. Solving the equations with the mean μ of the empty spectrum makes Al come out negative for meat alone: −0.0054 cm at 1 cm and −0.1459 cm at 6 cm (about −1.5 mm). Solving the polychromatic forward model stays at 0.
  • The noise sits on the bound. The standard deviation is 0.995 and 0.997 times the Cramér–Rao bound, and the errors of the two bases move in opposite directions with correlation −0.974 (overestimate Al and you underestimate lean meat). Beyond that the limit is set by photon count and window placement, not by the algorithm. The Al noise was lowest with the window boundary at 34 keV.
  • For the same photon count, two tube voltages are slightly better. Under 4 cm of meat the Al noise was 0.209 mm for two tube voltages (energy-integrating) and 0.220 mm for two counting windows.

What it is not for

  • Telling bone, aluminium and glass apart. Their effective atomic numbers are 13.2, 13 and 12.2, so two energies put them in the same group. The classes you can separate are coarse: organic matter, light inorganic matter, calcium-rich stone, metal.
  • Detectors with an unknown response. This PoC takes the response as known (calibration 0); drop that and meat turns into a foreign body, as above.
  • Real machines with scattered radiation. The effect of scatter making L look small with a wide beam and no grid, K-fluorescence escape, pile-up, double counting from charge sharing between pixels, and the anode heel effect are not included.
  • The apparent Z of thin bodies. The larger the Z, the more the basis direction collapses to one point, so a small error in direction (from fitting the meat unevenness) becomes a large error in Z.
  • No measured images were used. The meat thickness and the foreign bodies are synthetic values.

Spectrometers and illumination trains: the bandwidth comes from the slit and the grating; whether the lamp pattern shows in the field comes from conjugation

Slit width, bandwidth and throughput

Above: how slit width moves bandwidth and etendue (throughput) (1200 lines/mm, 625 nm). Left: a narrow slit stops at the diffraction floor 0.886 λ/(mN), and raising the NA to light more grooves lowers the floor. Right: with a wide slit, throughput times resolution is constant (slope −1); narrowing past the floor only loses light. (Labels in the figure are Japanese.)

A spectrometer lays out the image of the entrance slit by wavelength with a grating and reads it with detector pixels. How well wavelengths separate (the bandwidth) is the half-width of the instrument function that overlays three things: slit image, pixel and diffraction. The chromatic confocal PoC used the spectrometer line width, and the hyperspectral PoC used "a 10 nm band", as given numbers. This PoC builds those numbers from the entrance slit width, the groove density, the mirror focal lengths and the detector pixels with the grating equation.

The same PoC also covers the unevenness of microscope and coaxial lighting. It is set by which plane of the source is imaged where (conjugation). The coaxial case is the same optics as the first section of this article.

Gates and results

What we looked at Reference Result
Grating equation Second implementation (a wave grating equation with a different sign convention) β = 29.101078°, agree (difference below 1e-9)
Resolving power mN Upper bound 2W/λ (Palmer) mN = 30000 (below the bound 90909)
Off-axis angle of the camera mirror under Shafer's condition Published 14.968° (Feng 2021, Table 1) 14.9679°
Camera focal length (Eq. 16) Published r₄/2 = 68 mm, within 1.5 % 68.88 mm
Centre resolution (Feng 2021) Published 0.4 nm 0.497 nm. Does not agree (0.491 nm from the slit image alone)
M-type slit-image width (500 / 625 / 750 nm) Published 40 / 43 / 50 µm, within 8 % 39.2 / 43.7 / 52.6 µm (max 5.2 %)
M-type resolution Published 0.391 / 0.386 / 0.385 nm, within 5 % 0.397 / 0.397 / 0.397 nm (max 3.17 %)
Diffraction floor 0.8859 λ/(mN) (NA 0.02 / 0.05 / 0.11) Closed form, within 5e-4 relative for a rectangular pupil 0.2187 / 0.0874 / 0.0395 nm
Bandwidth of a wide slit (150 µm) w d cos α/(m f_col), within 2 % 2.371 nm vs 2.370 nm
Etendue Proportional to slit width 150×
Smile (4 mm slit, 546 nm) Closed form y′²(sin α + sin β)/(2 f cos β), within 0.2 % 41.9 µm (3.0 pixels); Littrow radius of curvature f/(2 tan β) is 123.60 mm
Keystone Within 3 % 60.3 µm at the 750 nm edge
Second-order stray light (Hg lamp) Second-order positions of 253.65 / 365.02 nm False lines at 507.30 / 730.04 nm; gone behind a 400 nm long-pass at 1.7e-17 / 7.9e-17
Slit for "10 nm" (900 to 1700 nm, 150 lines/mm, InGaAs 15 µm) Closed form, within 3 % 10.01 to 10.03 nm at a 75 µm slit
Coil stripes under Koehler illumination (CV) Below 1e-9 2.4e-16 (critical illumination: 0.531)
Field diameter under Koehler illumination Ray trace of the field-stop edge (independent path) Trace 1.0000 mm, op 1.0000 mm
Irradiance from a uniform source E = L π NA², within 1 % 0.07086 vs 0.07069
Coaxial round trip R·T 1/4 at 50/50 Agree; with 6 % absorption the best R is 0.47
Edge of the image of a mirror-like part (panel/2)/(1 + h/H) 19.23 mm (within one pixel)

All 42 gates passed (CPU 16.1 s).

Bowing of the slit image

Above: Hg 546 / 577 / 579 nm for a long (4 mm) slit drawn on one detector frame (14 µm pixels; right: the 546 nm line magnified 6× sideways). The red dotted line is a straight reference through the line centre. With the correct 3-D equation both ends of the line bow about 3 pixels towards longer wavelengths. A model that reuses the in-plane equation stays straight and fails the closed-form gate. (Labels in the figure are Japanese.)

★ What the check found

  • The tolerances of 8 % and 5 % were set from physics, not from the residual. The published table has digits to 1 µm for the image width (±1.25 % of 40 µm) and to 0.001 nm for the resolution (±0.13 %). On top of that, this model has no mirror aberrations while the published values come from ray tracing of real mirrors, so a few per cent of difference is expected. The image width is affected on the 750 nm side, where cos β is small and aberration is largest, so 8 %; the resolution is a product of image width and inverse linear dispersion, which cancels part of the aberration, so 5 %.
  • The margin is small. The image width has a 5.2 % residual against a tolerance of 8 % (2.8 points of margin), and the resolution 3.17 % against 5 % (1.83 points). Widening the tolerance would let anything through, so the reason for not widening it is on record.
  • The one case that disagrees with the published value was left disagreeing. From the paper's own values (collimator 40 mm, slit 25 µm), the slit image alone gives 0.49 nm for the centre resolution of Feng 2021. The published value is 0.4 nm. The published spectrometer's resolution that "worsens at the edge" (0.75 nm) is an aberration effect that this model does not produce, so the PoC's values are lower bounds.
  • The published image width depends on wavelength more gently than the model. Published 40 → 50 µm, model 39.2 → 52.6 µm. It does not come out of a closed form and I believe only real-mirror tracing produces it, but the paper's body could not be read by machine, so this is unconfirmed.
  • Narrower is not always better. With a wide slit, throughput times resolution is constant. Narrowing stops at the diffraction floor, and beyond that you only lose light.
  • Too little resolution turns two lines into one false peak. The two yellow Hg lines (576.96 / 579.07 nm, 2.11 nm apart) separate at a 10 µm slit (half-width 0.17 nm) and at 50 µm (0.79 nm), and merge into one at 150 µm (2.37 nm). At 250 µm it is 3.95 nm, at 400 µm 6.32 nm.
  • The slit image bows. The image of a 4 mm slit bows 41.9 µm (3 pixels) towards longer wavelengths at the edge. A broken model that reuses the in-plane equation gives 0 bowing and fails the closed-form gate. The trapezoidal distortion (keystone) is 60.3 µm at the 750 nm edge.
  • Ultraviolet lines become false visible lines. The Hg lines at 253.65 nm and 365.02 nm land in second order on the pixels of 507.30 nm and 730.04 nm. The first-order 546.07 nm appears at 546.076 nm. A 400 nm long-pass removes them.
  • The hyperspectral "10 nm" corresponds to a 75 µm slit. A 25 µm slit gives 3.39 nm, and at 8 µm and below the pixel sets it at 1.52 nm. The instrument function is trapezoidal, not Gaussian.
  • Widening the spectrometer slit makes the chromatic confocal sensor refuse thin plates. With a visible spectrometer (600 lines/mm), a 25 µm slit separates the two faces of a 40 µm plate and reads its thickness within 3 %. At 100 µm the 40 µm plate, at 200 µm the 60 µm plate, and at 400 µm even the 100 µm plate merge into one peak and the readout refuses. It does not guess the thickness.
  • Coil stripes show in the field under critical illumination and vanish under Koehler. The coefficients of variation are 0.531 and 2.4e-16. Moving the aperture stop 4 mm off the condenser focal plane lets stripes leak back into Koehler illumination, to 0.0089.
  • A mirror-like part under coaxial illumination shows the panel stretched. An ordinary lens stretches it by 1 + h/H, and at the edge of the field it looks outside the panel and goes black (19.23 mm). A telecentric lens gives 1×, and a 22 mm field inside 25 mm is not vignetted. A matte part integrates the whole panel, so the pattern vanishes.

What it is not for

  • Resolution of real machines with large aberrations. The mirrors have no aberration and the camera is a distortion-free linear mapping. The values are lower bounds.
  • Higher-order diffraction efficiency. It is a constant 0.3 of the first order (a model). Stray-light strength is a rough guide, and the wavelength dependence of grating efficiency is not included.
  • Darkening at the edge of the illumination. It is paraxial; cos⁴ and lens aberrations are not included.
  • The centre resolution of Feng 2021. It still disagrees.
  • Comparison against a real machine. Only two published spectrometers were compared; none of my own was measured.

Grating (Talbot) interferometry: fibre orientation and micro-cracks that absorption cannot see, read from the fringe amplitude

Talbot carpet

Above: the intensity I(x, z) behind a π-phase grating (28 keV, p1 = 4.36 µm). Horizontal: distance from the first grating, 0 to z_T/2 (429 mm); vertical: two periods. The distances where fringes of period p1/2 form are the fractional Talbot distances (m − 1/2)p1²/(4λ) = 54, 161, 268, 376 mm. At z = 0 the grating is purely phase, so the intensity is uniform and there are no fringes. (Labels in the figure are Japanese.)

An X-ray transmission image shows only "how much was absorbed". Fibre orientation in a resin plate, a crack 2 µm wide and a cluster of pores absorb almost the same as their surroundings, so they vanish from the transmission image.

A grating interferometer places two gratings (three if the source is large) and takes several shots while shifting one by a period fraction at a time. Each pixel then yields a sine, and the mean gives transmission, the phase shift gives differential phase, and the amplitude loss gives dark field, all three at once. The dark field measures small-angle scattering from structures smaller than a pixel.

The foundation is the self-image of a grating (the Talbot effect). Behind a π-phase grating, fringes of period p2 = p1/2 form at particular distances: d = (m − 1/2)·p1²/(4λ). The fringe phase shift φ follows from the wavefront slope as φ = 2π d α/p2, so the refraction angle is recovered as α = φ·p2/(2π d) (with wavefront phase Φ, α = (λ/2π)·∂Φ/∂x).

Gates and results

What we looked at Reference Result
Positions of the 4 visibility maxima Fractional Talbot distance (m − 1/2)p1²/(4λ), within the 0.89 mm grid 53.7 / 161.0 / 268.3 / 375.6 mm, same as the closed form
Visibility at a maximum Fundamental of a square wave 4/π = 1.2732 1.2733
Second implementation (FFT propagation of the sampled field) Within 2e-3 at 9 distances Max difference 8.2e-04
Visibility of a uniform source Closed form |sinc(π w d/(L p2))| vs incoherent sum of source points Max difference 2.5e-07
Source with a 2 mm focal spot Fringes wash out to ×0.001
Source grating (Lau condition) Best period at the condition 0.9998 × p0 (p0 = 48.7 µm, 41 slits); visibility 0.6367 = 2/π, within 6.4e-05 of the point sum
Detuning the source-grating period by 1/aperture count (2.4 %) Fringes vanish ×0.0000
Recovery of the three images (synthetic plate) RMS of transmission and dark field Transmission 0.0056, dark field 0.0372 (Poisson estimate 0.037)
2 µm crack (grating at 45°) Dark-field CNR at least 5× absorption Dark field 13.5, absorption 1.34
Fibre orientation recovered from four dark-field directions Median error 2.7°, 90th percentile 6.6°
Weld line behind the hole Orientation perpendicular to the flow (90°) 89.8°
Thickness of a round rod (4.8 mm diameter) Integration of the differential phase Within 1.00 % (max fringe phase 0.96 rad)
True |φ| above π Refuse Refused from 3.5× (then 3.35 rad)
Steps per period P (reference / sample) Truth 20.85 / 22.30 Estimated 20.85 / 22.29
RMS error of the differential phase Assuming P = N 0.063 rad → 0.022 rad with the estimated P

All 19 gates passed (CPU 4.5 s). The real-data chapter has further gates (22 in total, according to the PoC's description), but this run did not fetch the data, so the PoC printed recorded values and skipped them.

The three images

Above: the three images from the same 8-step phase scan (40 µm pixels, 6000 photons per frame, V0 = 0.25). In transmission (stretched to the plate's value range 0.814 to 0.847) the fibre orientation, the 2 µm crack (diagonal line at upper right) and the cluster of pores (lower right) are almost invisible. In the dark field the crack stands out at CNR 13.5, and rotating the grating swaps light and dark according to fibre orientation. (Labels in the figure are Japanese.)

★ What the check found

  • A visibility above 1 is not a fault. The fringes from a π-phase grating are close to a square wave, and the fundamental's amplitude is 4/π = 1.2732 times the mean. The computed value was 1.2733.
  • A large source erases the fringes. A 2 mm focal spot gives ×0.001. A source grating that shifts the fringes of each aperture by one period so that they overlap brings it back to 2/π = 0.637. But detuning the period by 1/aperture count (2.4 %) erases them again, so the adjustment has a narrow tolerance.
  • Dark field shows a crack at 10 times the contrast of absorption. A 2 µm crack has an absorption CNR of 1.34 and a dark-field CNR of 13.5.
  • Two directions cannot fix diagonal fibres. With the grating at only 0° and 90°, the median error of fibre orientation was 30.3°. With four directions it is 2.7°.
  • Pores and fibres differ in the direction of scattering. Pores are isotropic, with an anisotropy-to-mean ratio of 0.41; fibres are 1.01.
  • Wrapping is refused in some cases and not in others. If the fringe phase exceeds π over a region, neighbouring pixels jump by nearly 2π and the op refuses. But a plate whose sharp edge pushes only one pixel past π has a wrapped value within π of the background, passes unseen, and silently returns a centre thickness of −857 µm (true 2000 µm).
  • "One period scanned" does not mean the step count N is the period P. Assuming P = N for a scan of 20.85 steps per period gives a differential-phase error of 0.063 rad, which follows the phase field (the offset differs with each fringe phase), so subtracting the mean does not remove it. Estimating P from the residual minimum gives 0.022 rad, leaving only noise.
  • Dividing by the fitted mean biases the residual minimum. The minimum is biased by +0.03 steps and reads 20.88 (true 20.85). The op divides by the raw mean.

Checking against real data

The same procedure was tried on a public real data set (Sanchez-Lara and Garcia-Pinto, 2025, "Talbot Lau Phase Contrast Images", Zenodo, doi 10.5281/zenodo.16944391, CC BY 4.0, with 2×2 pixels binned): a reference scan of 22 frames and a sample scan of 24. This run did not fetch the data, so the numbers below are the recorded values that the PoC printed from its 2026-10-18 run with the data.

  • One period was estimated at 20.8 steps for the reference (22 frames) and 22.3 steps for the sample (24 frames), so N and P again disagree. The residual of the sine fit dropped from 0.0073 to 0.0044 for the reference and from 0.0065 to 0.0040 for the sample.
  • The strongly absorbing sphere scatters little (−ln D of 0.17) and the weakly absorbing fibre bundle scatters strongly (0.55). The sign of the differential phase is opposite on the left and right edges of the sphere (+0.12 rad, −0.17 rad). There is no ground truth for real data, so these physical directions were used as the gates.

The three images from real data

Above: the three images from real data (drawn from a run that had the data). The sphere (strong absorber) is dark in transmission and almost disappears in dark field. The fibre-bundle rod (weak absorber) is dark in dark field. The colour difference left and right in the differential phase is a tilt of the background phase, thought to be a grating offset between the reference and sample shots or a cone-beam effect. (Labels in the figure are Japanese.)

What it is not for

  • Phase steps that are not monochromatic, ideal sines. The model leaves out higher harmonics of the gratings, errors in step position and detector point spread.
  • The magnitude of scattering. Scattering from fibres and cracks is an "oriented Gaussian scattering" model, and the size of σ is a chosen value. In reality it is set by the ratio of the structure size to the autocorrelation length ξ = λd/p2.
  • Polychromatic sources. Absorption raises the mean energy and visibility drops even for an object that does not scatter (−ln D ≈ 0.17 at the centre of the sphere in the real data). A monochromatic forward model does not have this effect.
  • Integrating thickness across a sharp edge. A step where a single pixel passes π cannot be recognised as wrapped.
  • Ground truth for real data. There is none, so only the physical directions are checked (the sphere scatters little, the bundle strongly, the edge signs are opposite). The data are not bundled; the PoC runs on them only when the environment variable FULLSEYE_TALBOT_DATA points to where they are.

Pitfalls that appeared in every system

Laying different systems side by side showed the same pitfalls again and again. They are cues for doubting your own inspection.

  • A narrow interval is not evidence of being right. In a thin-film fit, the thickness interval was only 0.05 nm wide and still missed the reference. The width is set by noise alone and does not include model error. Check separately whether the residual fits inside the noise floor.
  • Do not read reproducibility as accuracy. The centroid method in white-light interferometry scattered little yet shrank the step itself (gain 0.550 at 3 % noise). Only a measurement with a planted true value finds it.
  • Folding into one number makes opposite failures cancel and vanish. Blurring the moiré of a luminance-unevenness image gave a 0.9 % error, but the breakdown was leakage +8.3 % and attenuation −7.4 %.
  • "The best condition" depends on the axis of evaluation and on the one point measured. The best incidence angle in polarisation split between absolute error and ratio. The benefit of pixel shift vanishes with the lens F-number.
  • What breaks silently is the most dangerous. Saturation in polarisation overestimates the diffuse component without any exception. Reversing the sign of the drizzle shift only puts the peak where aliasing would be, with no exception. The FFT answers 685 nm even when the material is mistaken. In X-ray, decomposing without knowing the detector's charge sharing turns meat into a foreign body (−13.8 times the noise). A grating interferometer returns −857 µm for a plate of true thickness 2000 µm when a sharp edge pushes a single pixel past π.
  • For a comparison with published values, write down where the tolerance comes from, and leave the one that disagrees. The spectrometer was compared with published values at 8 % for image width and 5 % for resolution. The residuals are 5.2 % and 3.17 %, leaving margins of 2.8 and 1.83 points. Widening a tolerance lets any value through, so it was set from physics (the digits of the table, and a model with no mirror aberrations). Only the centre resolution of Feng 2021 (published 0.4 nm, model 0.497 nm) does not agree, and it was left disagreeing.
  • When 0 or 1 comes out, suspect that it was built that way. The 0.000 % magnification change of a telecentric lens and the zero false colour of pixel shift are values built to be so by definition. Look at the breakdown of an unusually good number first.

Try it

pip install fullseye==0.7.0

A minimal example. It was run in a fresh venv containing only pip install fullseye==0.7.0, from a directory outside the repository.

import raytrace3d as R3

# 1. Fold mirror: one mirror flips the image
s = R3.noncoaxial_system([{"R": 51.68, "t": 5.0, "n": "BK7", "ap": 12.5},
                          {"R": float("inf"), "t": 40.0, "n": 1.0},
                          {"type": "fold_mirror", "tilt": (45.0, 0.0), "ap": 30.0, "t": None}], stop=0)
print("reversed:", R3.image_orientation(s)["reversed"])

# 2. Beamsplitter in epi-illumination: the two-reflection ghost between back and front faces
epi = R3.noncoaxial_example("epi_beamsplitter")
g = R3.ghost_analysis(epi)
print(g["ghosts"][0]["label"], round(g["ghosts"][0]["energy_ratio"], 4))

# 3. Back-face reflectance: bare / single-layer MgF2 / two layers (BK7 to air, incidence 27.96 deg)
for name, coat in [("bare", None), ("MgF2", "MGF2"),
                   ("2-layer", [("TA2O5", 20.0), ("MGF2", 157.5)])]:
    r = R3.surface_reflectance(n_before="BK7", n_after=1.0, coating=coat, angle_deg=27.96)
    print(name, round(r["R"], 4))

# 4. Tilted plate (5 mm BK7, 30 deg)
p = R3.tilted_plate_shift(thickness_mm=5.0, glass="BK7", tilt_deg=30.0)
print(round(p["lateral_shift_mm"], 4), round(p["astigmatism_mm"], 4))

# 5. Scheimpflug
sc = R3.scheimpflug_tilt(object_distance_mm=200.0, object_tilt_deg=30.0)
print(round(sc["image_tilt_deg"], 4), round(sc["magnification"], 4), round(sc["hinge_height_mm"], 3))

Output of that run:

reversed: True
BS:front/BS:back 0.0265
bare 0.053
MgF2 0.0208
2-layer 0.0039
0.9881 0.5536
-28.0049 -0.9211 349.049

In order: one mirror flips the image; the beamsplitter's front/back ghost is 2.65 %; the back-face reflectance is 5.3 % bare, 2.1 % with a single layer and 0.39 % with two layers; the 30° plate shifts the image by 0.9881 mm with an astigmatic difference of 0.5536 mm; and for Scheimpflug the image-plane tilt is −28.0049°, the magnification −0.9211 and the hinge height 349.049 mm.

To run the whole PoC (19 gates), use the command below. The environment variable FULLSEYE_FIGURES=off stops it from writing figures (set FULLSEYE_FIGURE_DIR to choose where figures go).

python -m examples.poc_noncoaxial_optics

If the last line is PASS, all 19 gates passed.

The PoCs of the other sections can be run in the same way. The table shows the time taken on 2026-10-18 at full budget (values from a shared machine with other jobs running, so only a guide). Heavy ones can use a lighter budget with the environment variable FULLSEYE_POC_BUDGET=reduced. All numbers in this article are from the full budget.

Section Command (python -m examples.<name>) Time
Telecentric poc_telecentric_metrology 169 s
Illumination cone and NA poc_illumination_cone_vs_na 53 s
SEM (defect inflation) poc_sem_wafer_defect_edge_bias 2 s
SEM (voltage and detector) poc_virtual_sem_kv_cd_bse 206 s
TEM poc_tem_ctf_thon_rings 17 s
Thin film (reflectance spectrum) poc_thin_film_reflectometry 52 s
Thin film (calibration) poc_simcal_thin_film 109 s
Pixel shift poc_pixel_shift 21 s
TDI poc_tdi_linescan 10 s
Chromatic confocal poc_chromatic_confocal 36 s
OCT poc_industrial_oct 63 s
Deflectometry poc_phase_measuring_deflectometry 25 s
White-light interferometry poc_interferometry_step 11 s
Moiré alignment poc_moire_alignment 5 s
Moiré on a screen poc_moire_screen 4 s
Polarisation (separation) poc_polarization_specular 1 s
Polarisation (shape) poc_shape_from_polarization 4 s
X-ray (dual energy) poc_dual_energy_xray 7 s
Spectrometers and illumination poc_spectrometer_illumination 18 s
Grating (Talbot) interferometry poc_grating_interferometry 5 s

Chapters that use real data (raw telecentric images, pixel-shift raw files, real TEM micrographs, real grating-interferometer data and so on) download the data only when you set the environment variable that permits it. Without it, a PoC prints recorded values or skips the chapter; the output of each PoC says which happened.

Watch it move

Videos are collected on the YouTube channel. There is no video on this article's subject itself yet. Here are two short videos in the same spirit of doubting an inspection number. Both are simulations on synthetic data.

Calibration can show the same reprojection error while the focal-length error differs enormously:

Aligning a scanned point cloud to CAD can produce a dent that is not there:

Takeaways

  • The back face of a coaxial epi-illumination beamsplitter reflects about 5 % and lays a shifted copy of a dent (a ghost) on the image. Its strength is R_front × R_back and its shift is magnification × 2t · tanθ' · cosθ.
  • Remedies: a coating designed for the incidence angle (a single layer is weak at 45°), or a wedge that throws the ghost off the sensor.
  • Fold mirrors shrink a machine without changing image quality (392.9 → 248.7 mm in this example), but the number of mirrors decides whether the image is mirrored.
  • A tilted plate adds lateral shift and astigmatism. A tilted surface is focused better by tilting the sensor by tanθ' = m · tanθ.
  • The calculation was checked from three directions: closed forms, a second implementation, and deliberate breakage. It is a geometric-optics calculation, though, and has not been compared against a real machine.
  • A telecentric lens moves magnification only −0.013 % when height changes by 5 mm (+6.89 % for an ordinary f = 25 mm). But telecentricity never reaches zero and the field is set by the front element.
  • A SEM linewidth moves with voltage through which height of the sidewall you measure. Even when the shape matches, the area can inflate up to 1.7 times.
  • TEM defocus can be read from Thon rings within 0.5 %. But a 10 % error in defocus makes the correction useless.
  • A thin-film thickness can miss the reference even with a narrow interval. The absolute χ² gate finds the miss.
  • The gain of pixel shift runs out at Q* = 1.47 (about F 9.2). For moving subjects, four shots are worse than one beyond 0.25 px/shot.
  • TDI gains more from stages the dimmer it is (26.86 times with 64 charge-summed stages). Synchronisation error, skew and the lens image circle break first.
  • Chromatic confocal and OCT read depth from colour or interference. Watch the bias of estimators and mix-ups of group and phase index.
  • Deflectometry sees a 3 µm dent that the photo cannot, at a curvature-map SNR of 110. On a cover glass without an anti-reflection coating, though, the dent looks a quarter as deep.
  • White-light interferometry does not wrap, but the centroid method shrinks the step. Moiré turns nanometre shifts into coarse fringes.
  • Polarisation separates glare exactly at Brewster's angle, but saturation breaks it silently.
  • Dual-energy X-ray turns a meat tray where one threshold flags 86 % of the meat into 0 false lumps, by splitting into lean meat and Al (bone shows at 7.5 times the noise, glass at 6.5). But decomposing without knowing the detector response turns meat into a foreign body.
  • A spectrometer's bandwidth comes from the slit and the grating. The two yellow Hg lines separate at a 50 µm slit (0.79 nm) and merge at 150 µm (2.37 nm). It agrees with two published spectrometers to 5.2 % (tolerance 8 %) in image width and 3.17 % (tolerance 5 %) in resolution, with one case that does not agree.
  • A grating interferometer lifts a 2 µm crack from CNR 1.34 in absorption to CNR 13.5 in dark field, and agrees with the closed form for the Talbot distance (m − 1/2)p1²/(4λ). But a plate whose sharp edge pushes only one pixel past π cannot be recognised as wrapped.

Fullseye is licensed Apache-2.0. The open-source ray tracer used as the second implementation is MIT-licensed, and no code was copied from it.

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?