A Dark-Field Ring Light Tolerates Far More Tilt Than Coaxial Light
LIGHTING
Coaxial light loses the background at a 0.86° tilt, while a 15° dark-field ring holds out to 36.6°.
For 30 μm scratches on a glossy molded housing, I calculated the slope threshold that ring angle and radius create and the limits of a judgment trained on good images only.
About 11 min read
A glossy molded housing seems easier to inspect the smoother it gets, but pick the wrong lighting and the scratches disappear. The target is a black PC connector housing molded in a mirror-polished tool. Assuming a refractive index of 1.58 for PC, 5.1 % of light arriving straight on bounces off like a mirror, and the black pigment swallows most of the rest, so diffuse reflection is very weak. A surface that people on the floor call full of messy reflections is usually this mix of strong specular reflection and scattering from fine texture. The defect to find is a scratch 30 μm wide.
With a coaxial light1 on a glossy surface, it seems flat areas should glow white and scratches should show as dark lines. Yet if the housing is even slightly curved, the background brightness flips from place to place, so a scratch shows dark on a bright background and nearly invisible on a dark one. Images like that cannot be judged with a single threshold, and once thresholds start changing by location, false alarms and misses rise together. A missed scratch passes through assembly and gets caught at the customer’s incoming inspection, and the cost comes back as returns and re-inspection.
I split the problem into two stages. First, I calculate the lighting angle and ring size from geometry to create conditions where the background stays dark, and on top of that, I separate with numbers what a judgment trained only on good images can and cannot do. The camera is assumed to be 2,448 × 2,048 px with 3.45 μm pixels, the lens a bi-telecentric2 design at 0.5 magnification, and the object-side NA3 is set at 0.03. One pixel covers 6.9 μm on the part, the field of view is 16.9 × 14.1 mm, and a 30 μm scratch spans 4.3 pixels.
Why coaxial light cannot handle a curved glossy background
An NA of 0.03 means the lens accepts light within a half-angle of 1.72°. Under coaxial light, a flat glossy surface sends the light straight back into the lens and shows bright, but when the surface tilts, the reflected light bends by twice the tilt, so a tilt of just over 0.86° sends the reflection past the lens and that spot goes dark. The radius of curvature at which the tilt reaches 0.86° at the edge of the field is 563 mm. By my calculation, a housing with a 100 mm radius of curvature keeps only 18 % of the field width bright, and over the remaining 82 % a scratch becomes a dark line on a dark background.
Scratches follow the same geometry. A scratch whose wall slope exceeds 0.86° shows as a dark line under coaxial light, so on a flat coupon it is quite visible. The trouble is that mold texture and fine ripples in the surface make dark spots by the same principle. Scratch and texture both turn into dark patterns, and with the background brightness also shifting with curvature, the contrast never holds steady.
The slope threshold a 15° ring sets
Dark-field illumination4 turns this relationship upside down. With a low-angle ring shining from 15° above horizontal, the light comes in 75° from vertical, and the specular reflection from a flat surface leaves at 75° on the opposite side, never reaching the lens. Bending the reflection into the lens’s 1.72° takes a surface tilt of at least (75 − 1.72) ÷ 2 = 36.6°, so the background of a curved housing stays dark until the tilt reaches 36.6°. The allowance that was 0.86° under coaxial light widens more than fortyfold.

The figure compares two cases side by side: coaxial bright field, where the flat surface and a shallow defect both return light to the lens for low contrast, and low-angle dark field, where the flat reflection misses and only the defect’s scattered light enters the lens. The same geometry is also the threshold for seeing scratches. A scratch with walls steeper than 36.6° sends light from somewhere on the ring into the lens by specular reflection and flashes bright, while gentler walls glow only with light scattered by surface roughness.
Lower the ring angle and the threshold rises to 39.1° at 10°; raise it and the threshold falls to 29.1° at 30° and 21.6° at 45°. The higher the angle, the better shallow defects show, but the gentle slopes of mold texture start glowing too, so on a textured glossy surface I start near 15° and raise the angle only within the range where the texture stays down. The UnitX dark-field explainer likewise says practitioners typically use 10 to 15° from horizontal and suggests 5 to 10° for very smooth surfaces such as polished wafers.
0.86°
Tilt limit for a bright background under coaxial light (NA 0.03)
36.6°
Tilt limit for a dark background under a 15° ring
9/h
False alarms per hour from a top-0.5 % normal-score threshold at a 2-second tact
Incidence angle drift at the edge of the field
A 15° ring angle is exact only at the center of the field. Set a 40 mm radius ring at 15° and it sits 10.7 mm above the part, but at the edge of the field (8.45 mm from center), the near side of the ring sends light at 18.8° and the far side at 12.5°. The slope threshold wobbles from 34.8° to 37.9° as well, so the same scratch can glow differently on the left and right of the field.
Enlarge the radius to 80 mm and the ring height becomes 21.4 mm, the incidence angle at the edge narrows to 13.6 to 16.7°, and the slope threshold to 35.8 to 37.3°. With the radius at 4.7 times the field width, the angle wobble is about 3°, so I take a radius close to five times the field width as my baseline. The ring diameter grows to 160 mm, but the lens sits at a WD of 90 mm and the ring at a height of 21.4 mm, so they do not collide. Focus needs checking too: with the allowed blur set at 2 pixels, the depth of field5 at NA 0.03 is about 0.46 mm, so the 0.36 mm height difference across the field of a housing with a 100 mm radius of curvature fits, while the 0.72 mm of a 50 mm radius does not.
Judging from good images only, and its limits
On a new line with no defect samples, anomaly detection6 trained only on good images pairs well with dark field. A dark-field image keeps its background dark and even, which makes it a good fit for extracting features from each patch of good housing images, remembering them, and scoring how far each patch of a new image sits from that memory. PatchCore, published by Roth and colleagues, builds a memory bank from patch features of defect-free images and trains without defect samples, reporting image-level AUROC7 of up to 99.6 % on the MVTec AD dataset. Running such a model on an edge AI8 module beside the line shortens latency because decisions skip the network, but inference time varies widely with the model and accelerator, so whether it fits the tact time has to be measured.
The way the threshold is set hides a trap that numbers make visible. Take the top 0.5 % of the anomaly-score distribution of good images as the threshold, and by definition 0.5 % of good parts get flagged as defective. Inspecting 1,800 parts per hour at a 2-second tact sends 9 per hour to the re-inspection queue, and 18 at a 1-second tact. The false-alarm rate is fixed this way as a design value, but how many real scratches slip through stays unknown until defect samples pile up and get scored. The report card of a model trained only on good samples covers half the subject.
Some things software clearly cannot cover. If the ring angle drifts and part of the background saturates, or focus leaves the depth of field and scratches blur, the information lost from that image does not come back through any model. That is why I shoot the good images for anomaly-detection training only after the lighting angle, ring height and focus are fixed.
The table below pairs the lighting geometry with the judgment method. The lens WD is assumed to be 90 mm per the datasheet, and the ring sits below it at a height of 21.4 mm, leaving about 69 mm between the lens front and the ring.
| Inspection item | ① Minimum defect size | ② Optical setup · WD | ③ Algorithm parameters · in plain words |
|---|---|---|---|
| Scratch on glossy housing | 30 μm wide = 4.3 pixels (6.9 μm on the object) | 5 MP (2,448 × 2,048) with 3.45 μm pixels, bi-telecentric 0.5 (object-side NA 0.03 assumed), field of view 16.9 × 14.1 mm, WD 90 mm, low-angle ring at 15° (80 mm radius, 21.4 mm high) | Patch-feature anomaly detection trained on 200 good images, threshold = top 0.5 % of normal scores (9 false alarms per hour at a 2-second tact) |
| Curved background and mold texture | Background stays dark up to a 36.6° surface tilt | Incidence angle 13.6 to 16.7° at the field edge | Slope threshold for specular flashing 35.8 to 37.3°; if texture rises, lower the angle |
| Focus | Allowed blur 2 pixels = 13.8 μm | Depth of field about 0.46 mm (NA 0.03, geometric approximation), diffraction resolution 11.2 μm | If the height difference across the field exceeds 0.46 mm, split the area and take two focus positions |
Reading the three rows together, what sets defect contrast in dark field is the slope threshold created by ring angle and radius more than the brightness of the light, and anomaly detection does its job only on images where that threshold holds evenly across the whole field. The false-alarm rate is fixed in advance by the threshold, but the miss rate shows only as defect samples accumulate, so the decision log for the first few weeks records the two numbers separately.
Surfaces where coaxial or dome light does better
Dark field does not suit every glossy surface. If the housing is a flat plate with tilt variation within 0.86°, coaxial light lights the background evenly and shows scratches as crisp dark lines. When diffuse reflection dominates, as on a matte surface, the whole background rises with scattered light under dark field and contrast drops, so coaxial or dome light does better, and the same goes for inspections where even brightness across the face matters, such as checking whether printed characters are present. On strongly curved parts, a low-angle ring can cast shadows, so dome lighting should be reviewed alongside it. Which option wins depends on material, curvature and coating condition, so it cannot be guaranteed before a sample test.
Looking at lighting cost alone, a large ring costs more than a small one, and dark field demands a stronger source than coaxial light because it collects only scattered light. Yet enlarging one ring radius to even out the slope threshold across the field reduces the software upkeep of managing thresholds location by location. This article explains technology and is not investment advice. See our Disclaimer.
Field Note
Setting up a station for a glossy housing, I would measure the curvature of the housing before mounting the ring. Knowing how many degrees the surface tilts at the edge of the field settles at once whether coaxial light can hold up or dark field is needed. After mounting the ring, I place 20 scratch-free housings alternately at the center and the edge of the field and record the background brightness to check whether mold texture rises at the edge. The 200 good images for anomaly-detection training get shot only under lighting that has passed this check.
Field Checkpoints
Once the curvature measurement and the background log of 20 good parts have confirmed the geometry, check the items below in order.
- Within the 90 mm WD, are about 69 mm left between the ring (80 mm radius, 21.4 mm high) and the lens front, with no interference?
- Have you measured the housing tilt at the edge of the field? (Within 0.86°, coaxial; beyond it, consider dark field)
- Does the same scratch show similar brightness at the center and the edge of the field? (Edge incidence angle 13.6 to 16.7°)
- Does the height difference across the field fall within the 0.46 mm depth of field?
- Have you matched the hourly false alarms from the anomaly threshold against re-inspection staffing?
- Do the good samples evenly cover the variation across mold lots and molding conditions?
Frequently Asked Questions
Could a bar light from one side replace the ring?
A bar light comes from only one direction, so scratches running at right angles to it show well, while scratches parallel to it nearly vanish because their walls receive no light. In a process where scratch direction is fixed, two bar lights can be enough, and where directions vary, a ring is the safer choice. The bar angle follows the same slope-threshold calculation.
What happens to good parts that score high?
Images confirmed good at re-inspection are normally added to the good training set for retraining. If scores run high repeatedly at the same location, checking whether the lighting or fixture position is drifting is faster than suspecting the model. A real defect image slipped into the good set dulls later decisions, so a person looks once more before adding anything.
Glossary
- [1] Coaxial light on-axis light
Lighting sent along the lens axis through a half mirror. It shows flat glossy surfaces bright but is very sensitive to tilt. ↩ - [2] Bi-telecentric double telecentric
A lens whose chief rays run parallel to the axis on both the object and sensor sides. Magnification stays nearly constant as height changes within the focus range. ↩ - [3] NA NA
A number giving the half-angle of the light cone a lens accepts, as a sine. NA 0.03 is a 1.72° half-angle. ↩ - [4] Dark-field illumination dark field
Lighting from a low angle that sends reflections from flat surfaces past the lens, so only light-bending spots such as scratches appear bright. ↩ - [5] Depth of field DOF
The front-to-back range on the object side that counts as in focus. By geometric approximation, allowed blur ÷ NA. ↩ - [6] Anomaly detection one-class learning
An approach that learns from good images only and marks places that differ from usual with a score. It does not sort defects by type. ↩ - [7] AUROC AUROC
The area under the curve of detection rate against false-alarm rate as the threshold varies. The closer to 1, the better it separates good from bad. ↩ - [8] Edge AI on-device inference
Running inference on a device beside the line without sending images to the cloud. ↩
References
- UnitX, Dark-Field Illumination for Machine Vision in 2026 (practitioners typically use 10 to 15° from horizontal; 5 to 10° suggested for very smooth surfaces such as polished wafers)
- K. Roth et al., Towards Total Recall in Industrial Anomaly Detection, arXiv:2106.08265 (PatchCore, memory bank of patch features from nominal images, image-level AUROC up to 99.6 % on MVTec AD)
- Formulas: lens acceptance half-angle = arcsin(NA), coaxial background tilt limit = half-angle ÷ 2, dark-field slope threshold = (90° − ring angle − half-angle) ÷ 2, ring height = radius × tan(ring angle), edge incidence angle = arctan(height ÷ (radius ∓ half field width)), depth of field ≈ allowed blur ÷ NA, diffraction resolution = 0.61 λ ÷ NA (λ = 0.55 μm), specular reflectance = ((n − 1) ÷ (n + 1))²
Related reading — Coaxial Light Alone Does Not Settle Fine Scratches on Polished Metal · Six Machine-Vision Lighting Methods and How to Choose · How Strongly Cross-Polarization Suppresses Glare Depends on the Lighting Angle


