How to Handle Imaging on Highly Reflective Surfaces
LIGHTING
On a glossy surface the white glare leaves the frame once the light moves more than 15° off the axis, and every step after that is paid for in light or time.
For a 5 MP setup hunting 50 μm scratches, I calculated angle, exposure, coaxial light, polarization and split shots in the order that costs the least money and light.
About 12 min read
Photograph a polished metal plate or a glossy molded cover, and part of the image blows out to white. Even if a scratch sits in that patch, the image shows only a white surface, and the inspection program sends the part to the good bin. Lowering the exposure shrinks the white patch, but the rest of the image darkens and buries defects elsewhere, so the conversation tends to drift toward buying a new light. If that light does not suit the surface, the equipment cost and setup time get paid a second time.
The surface comes first. Rough surfaces such as paper or matte molded parts mostly scatter light in every direction by diffuse reflection1, so this rarely happens. Smooth surfaces such as polished metal, plating or glossy paint have strong specular reflection2, bouncing light off in one direction at the angle it came in, and if the lens sits in that direction the light shows up as if in a mirror. The fix starts with steering that one direction away from the lens, and the cost starts at zero and climbs with each step.
All the calculations use one setup. Assume a 5 MP camera with 2,448 × 2,048 px and 3.45 μm pixels, fitted with a 25 mm lens and viewing 40 mm across: one pixel covers 16.3 μm, and a 50 μm wide scratch spans 3.06 pixels. The distance from the lens principal plane to the surface, the WD3, is about 143 mm, and the aperture is set to f/5.6. The bar light is taken as 30 mm wide, placed 143 mm from the surface.
A blown-out patch keeps no defect information
Every pixel has a ceiling on the brightness it can record. A 12-bit camera has 4,096 levels from 0 to 4,095, and anything brighter is recorded as 4,095, a state called saturation4. Whether or not a scratch lies on the white patch, the number is the same 4,095, so no filter or trained model can recover information from that spot. The spot is empty. By my rule, the first check is whether the white patch overlaps the places where defects occur, and if it does, I put software adjustments on hold.
Lowering the exposure looks like a fix, but exposure lowers the glare and the background by the same ratio. Set the background to a mid level of 2,048 and assume the glare is 20 times brighter: it would need to read 40,960, so it clips at 4,095. Bringing the glare under 4,095 takes one tenth of the exposure, 3.3 stops5 less, and then the background falls to 205 and the brightness difference a scratch makes shrinks to a tenth as well. The aperture moves both brightness values by the same ratio too, so exposure and aperture only choose which side saturates and never change the ratio between them.

From the bottom, the steps are angle, exposure and aperture, polarizing filters, a different lighting type and multiple shots. The higher the step, the more you pay in equipment, light or inspection time, so it costs less to confirm first whether the bottom two steps finish the job. As the calculation above shows, exposure and aperture cannot change the ratio, so of the first two steps it is the angle that actually removes the glare.
Moving the light 15° out takes the glare off the frame
When the camera looks straight down at the surface, the directions from which a light reflected in the glossy surface can enter the lens are fixed. The line of sight to the edge of the frame is tilted from the optical axis by half the field angle, and when that line of sight bounces off a mirror-like surface it heads out at the same angle on the other side. In this setup half the field angle is 7.9°, and adding the 0.9° spread of the f/5.6 lens opening, any light inside an 8.8° cone around the axis always shows up somewhere in the frame.
A bar light has width, so it has to move out by another 6.0°, the half angle that 30 mm of width covers at 143 mm. With the center of the light more than 14.8° from the optical axis, the glare lands nowhere in the frame, and beyond that point the flat surface sinks into darkness while only light scattered by the walls of a scratch stays bright, close to dark-field illumination6, so the scratch turns into a white line on a black background. Clearing only the center of the frame needs the light just outside 6.9°, the lens opening plus the light width, while clearing the edges as well means adding half the field angle. Moving the light costs nothing.
Tilting the part or the camera gives the same effect. Tilting a mirror surface by θ swings the reflection by 2θ, so the tilt needed is half, 7.4°. The price is focus. Tilting a 40 mm field by 7.4° leaves a 5.15 mm height difference between its two ends, while the depth of field7 of this setup at f/5.6 is 2.10 mm, so both edges of the frame blur. In my setups I leave the part and the camera where they are and start by moving only the light 15° outward.
If the glare gets in the way
it seems enough to lower the exposure or tilt the camera.
Calculated for this setup
exposure cannot change the glare-to-background ratio, and a 7.4° camera tilt gives a 5.15 mm height difference that exceeds the 2.10 mm depth of field. Moving the light 14.8° out avoids both.
Some surfaces defeat the angle method outright. On a curved surface, wherever the light goes, some facet at some tilt will always reflect it, and on a cylinder or a convex cap the white band only changes position. From here on, the job needs devices that even out or filter the reflection instead of dodging it, and those devices take their payment in light.
Two devices that accept the glare and pay in light
Coaxial illumination8 meets the reflection head on instead of avoiding it. A semi-transparent half mirror sends light down along the optical axis, so the flat surface lights up evenly while the tilted walls of a scratch throw the light out of the lens and remain as dark lines. The reflection that used to hide the defect becomes the background that shows it. The light, though, loses half when it reflects off the half mirror on the way down and half again when it passes through on the way up, so with a 50 : 50 mirror at most 25 % returns to the lens, a two-stop loss. The tilt tolerance is covered separately in the coaxial lighting calculation.
Cross-polarization9 puts one polarizing filter in front of the light and one in front of the lens, with the two set at right angles. Specular reflection from non-metal surfaces such as plastic or paint mostly keeps its polarization, so the second filter blocks it, while light scattered inside the surface comes out with mixed directions and partly gets through. With ideal filters, half survives the first sheet and half of that the second, leaving 25 %; assuming real filters pass only 40 % of unpolarized light per sheet, 16 % remains, a 2.6-stop loss. Metals can twist the polarization when reflecting at an angle and block less, so the effect on glossy metal cannot be guaranteed before a sample test (cross-polarization article).
Both devices give up more than two stops of light, so holding the same brightness means raising the light output more than four times or stretching the exposure by the same amount. A stationary part can make it up with exposure, but on a moving part the longer exposure adds blur, which leaves raising the light as the only route. I place trying polarizing filters ahead of buying a coaxial light. Two filters are cheap and easy to remove, which fits the third step.
Round surfaces get wrapped or split into shots
For surfaces where the angle cannot be avoided, such as cylinders or convex parts, dome illumination10 is the default. The inner wall of the hemisphere glows evenly, so whichever way the surface tilts, what it reflects is wall of the same brightness and no standout white spot forms. Shadows disappear with it, though, so shallow steps are hard to see, and the hole the camera looks through gives off no light, leaving a dark spot where the surface reflects that hole. The relation between that dark spot, the dome diameter and the WD is calculated in the dome light dark-spot article.
The last step is splitting the job into several shots and merging them. Place lights in four directions and take four shots with one light on at a time; the glare lands in a different place in each shot, so picking the darkest value per pixel leaves an image without glare. Assuming the camera takes 40 frames per second, four shots take 100 ms, and the part has to move less than one pixel, 16.3 μm, in that time or the scratch smears into a double image after merging. HDR multi-exposure fusion, which splits the brightness into several shots, carries the same standstill condition.
Four methods held up to one 50 μm scratch
Hold the same 50 μm scratch, the same camera and the same lens, change only the method, and what each one gives up separates line by line. The pixel count is 3.06 in every case, and what changes is the light placement, the amount of light and the time. All four rows assume the camera looks straight down.
| Method | ① Minimum defect size | ② Optical setup · WD | ③ Algorithm parameters · cost |
|---|---|---|---|
| Move the light | 50 μm = 3.06 px (16.3 μm/px) | 25 mm lens, WD 143 mm from the principal plane, f/5.6, bar light center more than 14.8° off the axis | scratch as a white line on black, bright-line threshold, no added cost |
| Coaxial light | 50 μm = 3.06 px | same lens, the half-mirror housing takes space in front of the lens, so the light height must fit inside the 143 mm WD | scratch as a dark line on white, make up 25 % (2 stops) with output or exposure |
| Cross-polarization | 50 μm = 3.06 px | polarizing filters at right angles on the light and the lens, WD unchanged | 16 % of the light (2.6 stops, 40 % per filter assumed), check how well metal is blocked on samples |
| Four-direction split shots | 50 μm = 3.06 px | four lights fired in turn, WD unchanged | per-pixel minimum merge, four shots in 100 ms (40 fps assumed), part motion under 16.3 μm |
Side by side, the four rows show that on a surface where the zero-cost first row works, the other three rows only spend more light or time. The conditions that favor the opposite approach are clear too: on a curved surface, or when hunting defects with weak shadows such as shallow dents, moving the light aside only darkens the background and keeps the defect hidden. On such surfaces coaxial or dome lighting moves up to first choice, and which one fits cannot be guaranteed before a sample test.
What to turn and tilt before buying equipment
When glare shows up, I open the histogram11 before buying any light. If the bars are stacked like a wall at 4,095 on the right and those pixels fall where defects occur, I move the light 15° outward and shoot again. If a white patch still remains, I check whether the surface there is curved; if flat, I look at polarizing filters, and if curved, at a dome or split shots. Selection criteria tuned for metal scratches are collected in the lighting selection map for metal scratches, and the principle of each lighting type in six machine-vision lighting methods.
The people who have this sequence in their hands are the machine vision engineers who handle lighting on site, and for a beginner the fastest practice is measuring, with a mirror and a flashlight, the angle at which the reflection clears the lens. From the equipment-investment side, glare handling costs more in setup time than in lighting hardware, so whether a surface finishes in the first two steps decides the size of the quote. Sending a few photos taken at different light angles along with a request to a lighting supplier also shortens the conversation. This article explains technology and is not investment advice. See our Disclaimer.
Field Note
When a new glossy sheet arrives, I put the camera vertical and shoot the same spot while moving the bar light outward from right beside the axis in 5° steps. In this setup the white band should cross the edge of the frame near 14.8°, and if it leaves much later, the surface is more curved than expected or the light is wider than the calculation. I write the angle at which the band leaves, and the brightness difference of the scratch line at that point, together on the first line of the spec sheet.
Field Checkpoints
To turn the result of moving the light into spec-sheet sentences, answer the questions below in order.
- Is there height left inside the 143 mm WD (25 mm lens, from the principal plane) for a coaxial housing or polarizing filters? (whether the light has room between the lens and the part)
- Have you checked whether the pixels stacked at 4,095 in the histogram overlap the places where defects occur? (a scratch inside a white patch gets missed)
- Is the center of the bar light more than 14.8° from the optical axis? (half field angle 7.9°, lens opening 0.9° and light width 6.0° added together)
- If you tilted the camera or the part, does the height difference between the ends fit inside the 2.10 mm depth of field? (at f/5.6)
- Have you made up the 2 to 2.6 stops lost to coaxial light or polarization with light output or exposure? (on a moving part, use output instead of exposure)
- For split shots, does the part move less than 16.3 μm during the four shots in 100 ms? (vibration included)
Frequently Asked Questions
Does the same order work on glossy molded parts?
It does. A glossy molded part is a non-metal, so the specular reflection coming back from its surface is a little over 4 % at normal incidence, weaker than metal, and polarizing filters tend to block it better than on metal. A black molded part, though, has a dark background, so the brightness gap between glare and background opens wide easily, which makes the first step, moving the light, well worth trying first.
Can I just mask the areas with heavy glare?
A masked area becomes an area that is not inspected. If the glare always forms in the same place and there is no feature to judge there, a mask is a fair choice, but if scratches can occur there, defects in that area ship as they are. If you use a mask, it is safer to write the masked area as a number in the spec sheet so everyone knows the inspection coverage has shrunk.
Glossary
- [1] Diffuse reflection diffuse reflection
Reflection in which light scatters back in every direction from a rough surface. It looks about equally bright from any direction. ↩ - [2] Specular reflection specular reflection
Reflection in which light bounces off a smooth surface in one direction only, at the same angle it came in. If the lens sits in that direction, the light itself shows up in the image. ↩ - [3] WD working distance
The distance from the lens to the surface being inspected. The calculations here use a thin-lens approximation measured from the lens principal plane; the distance from the lens front comes from the lens drawing. ↩ - [4] Saturation saturation
The state in which a pixel has reached the brightest value it can hold and can no longer tell brighter light apart. On a 12-bit camera that ceiling is 4,095. ↩ - [5] Stop stop
A way of counting light in steps of two. One stop down halves the light, and two stops down leaves a quarter. ↩ - [6] Dark-field illumination dark-field illumination
Lighting from a low or outward angle so that the specular reflection of a flat surface misses the lens. The background goes dark and only light scattered by scratches or particles shows up bright. ↩ - [7] Depth of field depth of field, DOF
The depth range in front of and behind the focus distance that still looks sharp. The values here assume a circle of confusion of two pixels (6.9 μm). ↩ - [8] Coaxial illumination coaxial illumination
Lighting sent down along the camera optical axis by a semi-transparent half mirror. Flat glossy areas look bright and tilted defects look dark. ↩ - [9] Cross-polarization cross-polarization
A method that places polarizing filters on the light and on the lens at right angles to each other, filtering out specular reflection that keeps its polarization. ↩ - [10] Dome illumination dome illumination
Lighting that sends light evenly from the inner wall of a hemisphere, wrapping the part from every side. The camera looks in through a hole at the top. ↩ - [11] Histogram histogram
A bar graph that counts the pixels in an image by brightness. Bars piled at the right end mean many saturated pixels. ↩
References
- Formulas: pixel resolution = field of view ÷ pixel count, magnification m = pixel size ÷ pixel resolution, object distance = f × (1 + 1/m), half angle of the cone in which reflections appear = half field angle + half angle of the lens opening, half angle of the light width = atan(light width ÷ 2 ÷ distance), mirror tilt θ → reflection swing 2θ, depth of field ≈ 2 × N × c × (m + 1) ÷ m²
- Assumptions: 5 MP camera (2,448 × 2,048 px, 3.45 μm pixels), 25 mm lens, f/5.6, 40 mm horizontal field, 30 mm wide bar light, 12-bit output, 40 % transmission per polarizing filter, 40 frames per second
Related reading — Six Machine-Vision Lighting Methods and How to Choose · How Strongly Cross-Polarization Suppresses Glare Depends on the Lighting Angle · Raising the Camera Leaves the Glint of Its Built-in Light in Place


