A connector inspection keeps failing the same way: the housing is black plastic, the spring terminals inside are white metal, and no single exposure makes both usable. Raise the exposure and the metal clips into flat white blobs with no edges. Lower it and the housing sinks into sensor noise. Gamma and contrast sliders only reshape values the sensor already captured — they cannot recover a channel that saturated or one that drowned. The fix used on production stations is two lights, two frames from one camera, and one calculation that combines the results. This guide shows you how to size each light from the field of view, where to set each exposure, and how to get terminal position relative to the housing in two captures and one coordinate frame.
Why one exposure fails on black plastic and bright metal
Unfilled black moulding compound returns a few percent of the light that reaches it. Tin- or nickel-plated terminal stock returns most of what it receives, much of it specularly. At the sensor that is close to an order of magnitude in signal, and one exposure has exactly one gain. Set the gain so the plastic reads mid-scale and the metal saturates, or set it so the metal keeps its edges while the plastic drops below 30 counts, where noise and threshold hunting live. Post-processing cannot break the tie: gamma and curve adjustments stretch recorded values, so they amplify noise as readily as signal and never restore a clipped pixel.
This is also why bench contrast deceives. The why adequate contrast is not enough guide makes the point that a threshold which survives one lamp, one part batch and one operator is one shift change away from failing. Two purpose-set frames are more stable than one compromise frame.
Two frames beat one blended image
Split the job. Frame one is the datum: a frontal flood, deliberately bright, that shows the housing edges and corners while the terminals clip. Frame two is the terminals: a coaxial or angled pass that puts the white tips bright against a dark plastic floor while the housing barely registers. Each frame gets its own light, its own exposure and its own threshold.
The measurement never blends pixels. Software finds the housing datum in frame one, finds the terminal features in frame two, transforms both into one calibrated pixel-to-millimetre coordinate frame, and computes position or symmetry from those coordinates. Capturing several lighting directions and computing one result from them is standard practice — the same idea behind photometric stereo ring lighting. One station, two strobes, one camera: the cycle cost is one extra exposure and readout, not a second station.
Frame 1: the housing datum with a frontal flood
The datum frame wants every edge of the housing visible at once, so flood it frontally and evenly. Two lights do this well: a diffused ring light mounted around the lens at 0°, or a white coaxial light whose emitting face is about twice the field of view in each direction.
Set the exposure so the plastic body reads 140 to 165 counts on an 8-bit image. The white terminals will clip at 255; let them. Nothing in this frame measures the tips — you are segmenting the housing inner-wall edges, corner notches and part outline, and the near-overexposure lifts the plastic clear of noise while evening out moulding sheen and texture speckle.
Size the ring by the same rule used for coaxial faces, twice the field of view: a 120 mm ring serves fields of view up to about 60 mm. When the field grows past one ring, the large field of view lighting guide covers the coverage-versus-brightness balance. A rear bar light silhouettes the outer outline and works as a datum when the outline is the datum, but it cannot light the inside of an opaque housing, which is why the frontal flood does the datum work in most connector stations.
The LS-RNG-0517 is a 120 mm diffused ring with a 0° output on 24 V.
- Size
- 100-200 mm
- Type
- Diffused
- Angle
- Low angle (0-15°)
- Voltage
- 24 V
Frame 2: the terminal tips against a dark floor
Now isolate the tips. A coaxial light sends its rays down the optical axis through a half-mirror. Flat, shiny surfaces perpendicular to that axis — terminal tips, contact tops — send the light straight back to the camera and read bright. The matte black floor scatters sideways and reads dark. That geometry, not gain, is what separates the materials, and it is the same law of reflection worked through in the bright field versus dark field guide.
Target the histogram. Put the tips at 230 to 245 counts and the plastic floor below 40 counts, 8-bit. A threshold at 100 counts then sits at least 60 counts above the floor and at least 130 below the tips, with margin on both sides.
The shallow black plastic just beneath a tip will ghost slightly into the threshold band. Its edge is soft and low-gradient, so a gradient check or a small morphological open on the tip blob removes it without touching the metal edge.
An angled ring is the alternative when tips are small or canted. Light at 60° grazes the side faces of the terminals and lights bends and tilts that an axial beam misses — dark-field behaviour, and the reason a bent terminal often shows better in a low-angle pass than in a coaxial one. The recessed-contact version of this problem is worked in detail in the connector pin lighting guide.
If the tips glare into blobs instead of uniform bright regions, cross a polarizer on the light with an analyzer on the lens; the cross polarization guide shows the layout. On colour: a monochrome camera with white light is the default, and red earns its place when the housing fluoresces — the trade is set out in which LED colour gives the best contrast.
The LS-CXL-0027 is a 60 x 60 mm coaxial light with 4.4 W of red and 7.2 W of white on a 24 V supply. The LS-RNG-0100 is a 120 mm ring at 60° with 620 nm red LEDs on 24 V.
- Size
- 50-100 mm
- Voltage
- 24 V
- Size
- 100-200 mm
- Type
- Standard
- Angle
- 60°
- Voltage
- 24 V
Worked example: sizing the coaxial light for a 24 x 20 mm field
Take a typical connector cavity: a 20 mm x 15 mm inspection window. Allow 2 mm of position margin on each side, so the camera field of view is 24 mm wide and 20 mm high. The camera is the standard 5 MP, 2448 x 2048 pixel class with 3.45 µm pixels. The rule for the emitting face is twice the field of view in each dimension, which keeps the diffuser's edge falloff outside the window.
A 50 x 50 mm face covers that with margin. Now check the pixels before ordering anything:
A 0.4 mm terminal tip therefore spans about 41 pixels — well above the 10 to 20 pixels a width or position measurement wants — and sub-pixel edge interpolation takes edge repeatability to roughly 1 to 2 µm in a controlled station.
Decision, by field of view: up to 25 x 25 mm takes a 50 x 50 mm face; up to 30 x 30 mm a 60 x 60 mm face; up to 45 x 35 mm a 90 x 70 mm face; larger windows move to the 102 x 100 mm class or split into two stations. Face size comes first; choose the colour by the histogram test on your parts. On a linear sensor, exposure shifts both materials together, so one face sized this way can shoot both passes — a long, clipping exposure for the datum frame and a short exposure for the tips. Two separate lights still win when the housing edges want a different geometry than the tips do.
The LS-CXL-0227 is a 50 x 50 mm blue coaxial light on 24 V. The LS-CXL-0241 is a 90 x 70 mm white coaxial light on 24 V. The LS-CXL-0067 is a 102 x 100 mm coaxial light source on 24 V.
- Size
- 50-100 mm
- Voltage
- 24 V
- Size
- 50-100 mm
- Voltage
- 24 V
- Size
- 100-200 mm
- Voltage
- 24 V
Corner shadows come from the light, not the lens
The second symptom in failing images of this part — shadows of different directions on the left and right while the centre stays lit — is lighting geometry. Any finite light sits at a finite distance; cavity walls block rays that arrive at grazing angles, and the blocked strip along each wall goes dark. Its length follows from wall height and the ray elevation at that point:
With a 4 mm wall and rays arriving at the corners at about 30°, a 6.9 mm strip along each wall loses its light — a third of a 20 mm cavity. Raise the elevation and the strip shrinks fast: the 60° case cuts it to 2.3 mm. A coaxial pass avoids side shadows entirely because its rays travel down the axis, parallel to the walls. So the fix ladder is bigger light face or ring, light mounted closer for steeper corner angles, higher-angle ring segments — in that order — and the coaxial terminal frame sidesteps the problem altogether.
Lens defects produce a different signature. Vignetting dims the corners evenly in all directions from the centre; it never throws shadows that mirror from one side of the image to the other. The lighting geometry guide walks through the camera-light-part triangle behind this effect.
One station, two triggers, one result
The sequence per part: fire the datum light and grab frame one, fire the terminal light and grab frame two, compute each frame, then combine coordinates in the shared calibration. Fixture the part so it cannot move between the two grabs. If a frame comes back dark or half-corrected, check trigger timing before touching exposure — the first frame dark guide covers the settling failure that mimics a lighting error.
Strobing is what makes the near-overexposed datum pass practical: short pulses at high current, within the LED duty-cycle rating. The LED overdrive and current control guide gives the stability numbers behind strobed output. Run both lights from one strobe-capable controller so the two channels fire in a fixed order.
Keep both frames on one camera and one lens at one working distance, so both share one calibrated pixel-to-millimetre transform. Two cameras mean two calibrations that can drift apart. The station-level ordering — lighting, lens and exposure settled before software — is the subject of the stable 2D vision inspection guide.
Checks before you order
- Measure the window at the worst-case part position, add the position margin, then double it. The light face follows the worst-case window, not the nominal drawing.
- Divide wall height by the tangent of the corner arrival angle; the shadow strip must stop short of the nearest edge you measure.
- Confirm a monochrome camera and white or red light; take red if the moulding compound fluoresces.
- Confirm both lights strobe on one controller, in a fixed order, with the duty cycle respected.
- Confirm one camera, one lens, one working distance, one calibration for both frames.
- Bench the two-pass sequence on parts spanning the full tolerance range before locking thresholds.
Size the window, pick the two faces from the thresholds above, and check the pair in the light finder; the lighting configurator builds the two-light set-up step by step. More lighting layouts sit on the lighting topic page, and we are glad to check the layout against your part drawings — send them through the contact page.
Questions
Can I blend the two exposures into one HDR image instead?
Some cameras can expose twice into one buffer, and HDR blending has its uses, but here it throws away what each pass tuned: the datum frame wants the plastic mid-scale with tips clipped, the terminal frame wants the opposite. Measuring each frame separately and combining coordinates keeps both exposures honest and makes threshold drift easy to spot on production images.
How much larger than the field of view should the coaxial light be?
About twice each field-of-view dimension. A diffuser is brightest at its centre and falls off toward its edges, so a face barely larger than the window puts the dim zone inside the inspection area. After mounting, image a flat white target and confirm corner-to-centre gray level varies by less than about 10% across the window.
Is the corner shadowing a lens defect?
Rarely. Lens vignetting darkens all corners radially and by similar amounts, while lighting shadows point in specific directions and mirror around the centre. Rotate the part 90 degrees without moving camera or lights: shadows that rotate with the part come from the lighting geometry, shadows that stay put point to optics or sensor.
Which light colour separates white metal from black plastic best?
On a monochrome camera, white and red both work. Red at 620 to 660 nm often wins: mono sensors keep good sensitivity there, and many black moulding compounds stay dark under red. If the plastic contains optical brighteners that glow under blue or ultraviolet, red avoids exciting them. Choose whichever colour pushes metal and plastic to opposite ends of the histogram.
How much cycle time does the second frame add?
One exposure plus one readout, with the lights strobed in sequence — on the order of a few tens of milliseconds per part with a standard 5 MP area-scan camera. If the line cannot stop the part twice, fire both lights on consecutive frames while it moves, then register the measured motion before combining coordinates.





