LightingTroubleshooting

Metal part on metal background: lighting for consistent detection

Why a shiny part on a metal background detects intermittently, the lighting fixes that hold contrast all day, and the numbers that prove the fix.

LumaSpec Vision12 min read Share on LinkedIn

On this page 9 sections
  1. 01Why does a metal part on a metal background detect only some of the time?
  2. 02Will a red direct light make detection consistent?
  3. 03Which light stops a shiny part and shiny background from swapping?
  4. 04Do polarizing filters work on bare metal?
  5. 05How do you stop ambient light from changing your images through the day?
  6. 06What numbers prove the new lighting holds before you retrain?
  7. 07When is lighting not the reason your part fails?
  8. 08What do you order to fix a silver-on-silver station?
  9. 09Questions

A silver collar sits on a silver sheet. The vision tool passes it at 07:40 and fails the identical part at 10:15; by Friday you have retrained the template four times. The part has not changed — the reflection has. This guide is for anyone holding a shiny metal part against a metal background: collars, washers, brackets on a conveyor or in a tray. It names the physical cause, ranks the likely culprits in order, gives the geometry and filter fixes with the numbers that size them, and hands you an acceptance test that proves the lighting is stable before you touch the template again. Work through the questions in order; most stations like this are fixed by the third answer.

Why does a metal part on a metal background detect only some of the time?

Intermittent detection here is a specular flip: polished part and polished background both mirror your light, and when either rotates a few degrees the reflected beam moves twice as many degrees, so the grey-level contrast at the collar edge reverses and yesterday's template no longer matches.

A polished surface is a mirror, and the law of reflection returns each ray at the angle it arrived — the same rule that separates bright field from dark field. A directed light — ring, bar, spot — offers that mirror one dominant direction. Tilt either surface 5° and the reflected ray swings 10°. The collar's curved face sweeps a bright streak across its edge while the background sheet does the same in the opposite sense, and the template trained on the first state cannot match the second. The camera, light and part geometry guide shows how strongly contrast follows those positions.

Retraining re-learns the lighting state, not the part. Each new template absorbs today's streak position, today's ambient level and today's tray tilt, so it fails again as soon as any of them move — the cycle you are stuck in.

Rank the causes before buying anything; in the order we meet them:

  1. A directed light on a specular part-and-background pair — the flip above.
  2. Ambient drift: sun through a window, a door propped open, overhead fixtures switching.
  3. Auto exposure or auto gain quietly rebalancing every frame and dragging contrast with it.
  4. Mains flicker beating against the exposure time and dimming random images.
  5. Part pose beyond the template's search angle — a mechanical, not optical, fault.

One test isolates the first four: park the retrain button for a day and save every image. If the collar region's mean grey level swings more than about ±50 levels while nothing mechanical moved, the light is the variable and the next five sections fix it. If the images sit within ±10 levels and it still fails, go straight to the question about when lighting is not the reason.

Will a red direct light make detection consistent?

Color alone rarely fixes it: a monochrome camera turns red, blue and infrared light into the same brightness problem on bare silver, so a red ring still produces the same specular flip — red only earns its place with a matching bandpass filter that shuts ambient light out.

A monochrome sensor records brightness, not hue, and polished silver reflects red, green, blue and infrared wavelengths almost identically. Changing color changes the spectrum, not the geometry: the streak still lands wherever the angles put it. The light color and monochrome contrast guide covers where color does move contrast on a monochrome camera.

Color wins two jobs here:

  • Ambient rejection. A narrowband LED plus a bandpass filter on the lens lets the camera see your light and almost nothing else; daylight and office fixtures fall outside the passband and vanish from the frame. Deep red and infrared versions do this best.
  • Spectral separation. If collar and background differ at the surface — oxide tint, anodize, oil film — some color exaggerates the difference. Image the same part under white, red, green, blue and infrared, compute the part-to-background mean separation under each, and keep the largest. Ten minutes of testing beats a week of retraining.

If both surfaces are the same alloy with the same finish, no color separates them reliably; change the geometry instead.

Which light stops a shiny part and shiny background from swapping?

Replace the directed light with a diffuse one: a dome light hits the part from every angle overhead, so no single specular path is left to flip, and the grey levels at the collar edge hold within a few levels all shift.

A dome is a hemispherical diffuser with a camera hole at the top; LEDs paint its inner wall, and every point of the part sees light from the whole upper hemisphere. Polished surfaces settle at their stable diffuse brightness, and the collar reads as a dark boundary on an even grey field — exactly what a template needs. The illumination types guide maps the alternatives: coaxial light for flat coplanar faces, low-angle bars for edges and dents, and the general dome treatment for curved and wrinkled surfaces. Reflective copper misbehaves the same way; the copper surface guide works that problem on bare metal.

How a dome light works LEDs at the rim light the white inner surface of the dome, which lights the part evenly from almost every direction. The camera looks through a hole at the top; on flat mirror-like areas the hole reflects as a dark spot.Cameradiffuse inner surfacelights the part from every sideLED ringcamera holecurved or wrinkled part; dark spot where the hole reflects
How a dome light works. LEDs at the rim light the white inner surface of the dome, which lights the part evenly from almost every direction. The camera looks through a hole at the top; on flat mirror-like areas the hole reflects as a dark spot.

Size the dome by field of view, not part size alone. Keep the emitting area at least twice your field diagonal — a rule of thumb — so the part edge still sees light from a wide angular range. A dark blob in mid-image means the camera hole's shadow has entered the field; the dark spot guide covers the fixes.

Worked numbers for a collar: assume a 40 mm × 30 mm field, a 25 mm collar plus positioning margin. The field diagonal is √(40² + 30²) = 50 mm, so the emitting area needs to reach about 100 mm. The LS-DOM-0085 has a Ø166 mm body and a Ø116 mm emitting area. That is 2.3× the 50 mm diagonal, comfortably past the 2× floor.

Larger fields climb the same ladder:

Specification LS-DOM-0085 LS-DOM-0062 LS-DOM-0133
Outer diameter (mm) 166 194 134
Height (mm) 82 (from the dimension drawing) 94.5 69
Power red (W) – 9 2.0
Price from $409.00 $819.00 $559.00

Values as printed in each product's data sheet; open a part for its drawing and full specifications.

Do polarizing filters work on bare metal?

Yes, with limits: a crossed polarizer pair strips most of the specular sheen on bare metal — metals rotate polarization on reflection, so expect a heavy cut rather than the near-total extinction you get on plastic or glass — and it costs one to two stops of light.

Set it up as a pair: one polarizing sheet over the light, one analyzer filter on the lens, axes crossed at 90°. Specular reflection keeps most of its polarization, so the crossed analyzer blocks it, while light that scattered off the surface comes back depolarized and passes. The cross polarizer guide details the mounting, and the shiny metal pins guide runs the same stack on a harder case.

One stop of lost light is a doubling of exposure: a scene that exposed at 4 ms needs 8 ms, or a 100 µs strobed pulse with proportionally more drive current. Dome plus polarizer usually turns a wide specular swing into a stable image — then prove it with the acceptance test below.

How do you stop ambient light from changing your images through the day?

Strobe the light and cut the exposure: ambient light writes energy into the frame in proportion to exposure time, so dropping a 5 ms constant-light exposure to a 200 µs strobed pulse divides the ambient contribution by 25 while the LED pulse holds its full energy.

Three controls, in this order:

  1. Turn every auto mode off. Auto exposure, auto gain and auto iris each rebalance the frame as the room changes, and the tool then sees contrast move in ways no template absorbs. Lock exposure and gain at values that put the brighter surface around two-thirds of full scale; the brightness drift guide shows what auto modes do to an image over a day.
  2. Strobe, triggered by the camera. The ambient term scales with exposure: a sunlit bench writes 25 times less energy into a 200 µs frame than into a 5 ms frame, while the LED pulse delivers its full energy every shot. Trigger the light from the camera's exposure so the pair cannot drift apart — the discipline the pick-and-place ambient guide applies.
  3. Filter the rest. A bandpass filter matched to the LED wavelength rejects daylight and 50/60 Hz fixtures almost entirely; infrared at 850 nm or 940 nm with a matching filter is the strongest version of the move.

Two controller behaviors decide this job — strobe output and constant-current regulation:

Light controllersDigital control box, 4 ch, 200 W, RS232 (LS-CTL-0070)LS-CTL-0070
Output
Constant voltage 24 V
Channels
4 channels
$549.00View part
Light controllersConstant current controller, 4 ch, 120 W, 89 x 147 mm, for 24 V lights (LS-CTL-0180)LS-CTL-0180
Output
Constant current
Channels
4 channels
$359.00View part

The LS-CTL-0070 is the strobe path, a digital control box with 4 channels, 200 W and RS-232. The LS-CTL-0180 is the stability path, a constant-current controller with 4 channels and 120 W, made for 24 V lights, so LED warm-up cannot pull the grey levels down through the shift.

If dark bands or frame-to-frame brightness steps survive all three controls, the exposure is beating against mains ripple; the flicker guide picks the exposure that escapes it.

What numbers prove the new lighting holds before you retrain?

Judge the fix on grey-level statistics, not on the tool passing: capture 100 parts across a full day of ambient, then require part-to-background mean separation of at least five combined standard deviations and no more than ±10 grey levels of drift — hold both and one template holds too.

Read both numbers from two small regions of interest, one across the collar edge and one on the background:

separation = |mean_part − mean_bg| / sqrt(std_part² + std_bg²)
  1. With exposure and gain locked, capture at least 100 good parts spread across a full working day; include the sunrise and sunset window if daylight reaches the line.
  2. Measure mean and standard deviation in both regions on every image and compute the separation above.
  3. Accept at 5 or higher. Under 3, the tool will hunt again whatever the template says — go back to geometry, not retraining.
  4. Track the part region's mean across the whole set: total drift within ±10 grey levels passes, and more means ambient or LED warm-up still leaks in, so strobe shorter or filter harder.

This gate tells you the lighting — not another template — fixed the station. The ambient rejection acceptance test formalizes the same statistics for sign-off, and the retraining trigger guide lists the lighting changes that legitimately earn one retrain. Hold separation at 5 and a single template with a reasonable search angle runs for weeks.

When is lighting not the reason your part fails?

Lighting is not your problem when the failure follows pose or material rather than the clock: if the collar rotates past about ±10-15° against the trained pose, or the background sheet changes between polished and oxidized batches, no lamp makes one template cover both.

Rule the three non-lighting causes out first — each check costs minutes, not parts:

  • Clipped images. If collar and background both average above about 240 grey, every geometry collapses them into white; cut exposure or close the aperture one stop and re-measure. No lighting change rescues saturated pixels.
  • Pose beyond the search angle. Template matchers tolerate a limited rotation — on the order of ±10-15° for most tools — before scores fall away. Spin in the tray calls for fixturing, a wider search angle at a speed cost, or a feature-based pattern matching locator that measures an edge or hole instead of the whole picture.
  • A background that changes. Fresh versus oxidized sheet, oiled versus dry: different diffuse targets under identical lighting. Bound the background region tightly or gate it out of the match.

If failures follow trays, operators or material batches rather than hours of the day, fix the handling or material question first, then apply the lighting numbers above.

What do you order to fix a silver-on-silver station?

Order three things: a diffuse dome whose emitting area is at least twice your field diagonal, a controller that strobos and regulates current, and — when daylight or fixtures reach the sensor — a bandpass filter matched to the light's wavelength.

m = sensor width / field of view f = WD × m / (1 + m)

Worked example, carrying the 40 mm × 30 mm field onto a 2/3" camera with an 8.8 mm wide, 2448-pixel sensor:

  • Magnification: m = 8.8 mm ÷ 40 mm = 0.22.
  • Object-space pixel: 40 mm ÷ 2448 px = 16 µm, so a 1 mm collar edge spans about 60 pixels.
  • With a 35 mm lens: WD = f(1 + m) ÷ m = 35 mm × 1.22 ÷ 0.22 = 194 mm working distance.
  • Depth of field at f/5.6 and 0.22×: 2Nc(1 + m) ÷ m² with a 20 µm circle of confusion = 2 × 5.6 × 0.02 mm × 1.22 ÷ 0.0484 = 5.6 mm, about ±3 mm of collar height tolerance. Each aperture stop closed halves the light; take it back with exposure, not gain.

The calculator below runs the same sums and filters the lens finder to the result:

Lens focal length, field of view and working distance
Units
Solve for
Focal length
– mm
Field of view
– mm
Working distance
– mm
Magnification
– x
Angle of view
– °
Pixel on the part
– mm

Thin-lens model: m = sensor width / field of view, f = WD × m / (1 + m). Accurate to a few percent above about 150 mm; check the lens's minimum object distance.

Find lenses with this focal length Open the full calculator

The arithmetic asked for 35 mm. The LS-FFL-0679 is a 35 mm, 2/3", 6 MP, C-mount machine vision lens.

Machine vision lenses35 mm, 2/3", 6 MP, C-mount machine vision lens (LS-FFL-0679)LS-FFL-0679
Type
Machine vision fixed
Sensor format
2/3"
Mount
C-mount
Resolution
6-10 MP
$219.00View partBuild a system with it

Size dome, controller and lens this way and the station holds one template across the shift instead of four retrains. The light configurator steps through camera, lens, light and controller in order, the lighting topic page collects the geometry guides behind these numbers, and you can contact us with the part, field of view and line speed to have the stack sized with you.

Questions

Does infrared lighting help with shiny metal parts?

For ambient rejection, yes: an infrared dome at 850 nm or 940 nm paired with a matching bandpass filter on the lens lets the camera see your light and almost nothing else, so daylight and room fixtures stop moving the image. Infrared does not change the specular geometry on bare metal, though — pair it with a dome or coaxial light rather than expecting it to fix glare alone.

Can I fix this by retraining more templates instead of changing the light?

No. A template memorizes one illumination state; a specular scene produces dozens of them across a day as angles, trays and ambient move. Each retrain resets the clock rather than extending it. Fix the lighting geometry so grey-level separation holds within a few levels, and a single template with a reasonable search angle does the job for weeks.

How bright should the part be in the image?

Target a mean around 160-180 grey, of 255, for the brighter surface, with nothing clipped at 255. Clipped pixels carry no edge information, and no lighting geometry can recover contrast between two white regions. If the scene saturates, cut exposure or close the aperture one stop — f/4 to f/5.6 halves the light — then re-measure.

Do polarizing filters work on bare metal, or only on plastic?

On both, with different strength. Dielectric surfaces keep polarization intact on reflection, so a crossed pair kills their glare almost completely. Bare metal partially rotates polarization, so the sheen drops heavily rather than to zero — usually still enough to turn a wide swing into a stable image. Budget one to two stops of light loss and recover them with exposure or strobe drive.

Which light color separates two silver parts that look the same in white?

Only when the surfaces differ — oxide tint, anodize, oil film — because then some wavelengths absorb more than others. Image the same part under white, red, green, blue and infrared and keep the color with the largest part-to-background mean separation; blue and near-UV often exaggerate oxide and oil. Same alloy and finish: no color helps — change geometry.