LightingGuide

Machine vision lighting angles: surface or silhouette?

Choose machine vision lighting angles for surface defects or silhouettes using reflection geometry, worked examples, and a repeatable bench test.

LumaSpec Vision11 min read Share on LinkedIn

On this page 10 sections
  1. 01Choose surface inspection or silhouette inspection first
  2. 02Use the law of reflection to position the source
  3. 03Select bars, rings or backlights by their optical role
  4. 04Work through an angle and sampling example
  5. 05Run a controlled bright-field and dark-field test
  6. 06Test backlighting independently from surface lighting
  7. 07Check tolerance to tilt, finish and feature direction
  8. 08Know when the usual answer is wrong
  9. 09Complete the ordering and acceptance checklist
  10. 10Questions

A scratch can disappear under direct illumination and become the brightest feature under a shallow side light. An outside edge may be easier to measure when the entire surface becomes a dark silhouette. For inspection designers, these are different optical tasks, not simply different brightness settings. Choose the camera view and lighting geometry first, then select a light that maintains useful contrast across the part’s expected positions and finishes.

Choose surface inspection or silhouette inspection first

Start by identifying where the information exists. Surface texture, printed markings, dents and scratches generally require reflected light. Outside dimensions, holes and gaps often benefit from a backlight positioned behind the object, opposite the camera.

Bright-field and dark-field describe what reaches the camera, rather than a fixed type of light. In bright-field, the undamaged background returns substantial illumination toward the lens. In dark-field, the background directs most illumination away, while edges, texture or defects redirect some toward the lens.

Inspection requirement First arrangement to test Expected image Main limitation
Printed mark on a matte surface Broad front illumination Mark contrasts against the illuminated surface Material colors may respond similarly
Fine scratch on a smooth surface Directional dark-field illumination Scratch appears bright against a darker background Visibility depends on scratch direction
Surface dent or raised feature Oblique light from separate directions Local highlights and shadows change with direction Texture can resemble the defect
Outside edge of an opaque part Backlight Dark silhouette against a bright background Front-surface details disappear
Hole or open gap Backlight Bright opening within a dark part A fixture may obstruct the light path
Transparent component Test reflected and transmitted light separately Contrast depends on refraction, reflection and transmission A simple silhouette may not form

Use the lens and lighting selection test plan to organize the wider camera, lens and illumination evaluation. Here, the decision is narrower: which rays should enter the lens, and which should miss it?

Use the law of reflection to position the source

For an ideal smooth surface, the angle of incidence equals the angle of reflection. Both angles are measured from the local surface normal: an imaginary line perpendicular to the surface.

θi = θr α = 90° − θi

Here, θi is the incident angle from the normal, θr is the reflected angle, and α is the illumination elevation above the surface plane. An elevation of 15° therefore corresponds to an incident angle of 75° from the normal.

With a camera looking perpendicular to a flat, mirror-like part, illumination close to the viewing axis can return toward the lens. Moving the source sideways makes the reflected beam miss the camera. A scratch or tilted facet can then redirect light into the lens while the surrounding surface stays dark.

Bright-field and dark-field lighting geometry High-angle light reflects off the flat surface straight into the lens, so the surface looks bright. Low-angle light reflects away from the lens, so the surface looks dark and only edges or scratches scatter light upward.flat part with a scratchCamerabright field(high angle)dark field (low angle)flat areas reflect away;only the scratch sends light up
Bright-field and dark-field lighting geometry. High-angle light reflects off the flat surface straight into the lens, so the surface looks bright. Low-angle light reflects away from the lens, so the surface looks dark and only edges or scratches scatter light upward.

If the camera views the part obliquely, place the source on the opposite side of the surface normal to obtain a specular return. Moving the light without considering the camera position can turn a bright background dark unexpectedly.

Real surfaces are not perfect mirrors. Roughness spreads reflected light across directions, and a large emitter supplies a range of incident angles. The lens also accepts a finite range of rays. Consequently, practical bright-field and dark-field arrangements have transitions rather than a single sharp boundary.

Select bars, rings or backlights by their optical role

Bar lights let you change illumination direction and elevation independently. They are useful when a defect responds strongly to one direction, or when separate exposures must reveal different surface slopes.

For directional trials, compare the LS-BAR-1047 with the diffused LS-BAR-1276. Their catalog information identifies different source types; it does not establish which arrangement will produce acceptable defect contrast on your sample.

Bar lights290 x 30 mm LED bar light (LS-BAR-1047)LS-BAR-1047
Size
200-400 mm
Type
Standard
$449.00View part
Bar lightsBar light, 372 x 28 mm, White (LS-BAR-1276)LS-BAR-1276
Size
200-400 mm
Type
Diffused
$439.00View part

Ring lights illuminate from positions around the viewing axis. This can reduce dependence on part rotation compared with a single bar. However, simultaneous illumination from several directions may fill shadows that were useful for detecting relief.

The diffused LS-RNG-0143 is another candidate for the bench comparison. Check its mechanical drawing, lens clearance and intended mounting geometry before selecting it.

Ring lights100 mm dia. ring light with diffuser, 30° (LS-RNG-0143)LS-RNG-0143
Size
100-200 mm
Type
Diffused
Angle
30°
Voltage
24 V
$169.00View partBuild a system with it

Backlights separate the source from the camera with the part between them. For opaque parts, the camera primarily sees which rays are blocked, making the arrangement suitable for many outline and opening inspections.

The LS-BKL-1468 is a candidate for a transmitted-light trial. Confirm that the illuminated area covers the required background throughout the permitted part movement.

BacklightsFlat Backlight, 150 x 150 mm, Red (LS-BKL-1468)LS-BKL-1468
Size
100-200 mm
Type
Standard
Voltage
24 V
$389.00View partBuild a system with it

Use the lighting finder to compare dimensions, source types and electrical requirements after the optical trial. Housing dimensions alone do not establish usable illumination coverage at the part.

Work through an angle and sampling example

Consider a flat opaque plate measuring 60 × 40 mm. The inspection needs to detect surface scratches and check an outside edge. A field of view of 80 × 60 mm provides room around the plate, while a hypothetical image contains 1600 × 1200 pixels.

The object-space sampling is:

horizontal sampling = 80 mm / 1600 pixels = 0.05 mm/pixel vertical sampling = 60 mm / 1200 pixels = 0.05 mm/pixel nominal scratch width = 0.20 mm / 0.05 mm/pixel = 4 pixels

That nominal width is a starting point, not proof of detection. Optical blur, scratch profile, contrast and processing affect visibility. A narrow scratch may scatter light into a wider image feature, while poor illumination can hide a geometrically resolvable scratch.

Use the camera resolution selection guide to distinguish image sampling from measurement capability.

Camera resolution for the smallest feature
Units
Pixels needed
–
Sensor size
– MP
Smallest sensor that fits
–
Pixel on the part
– mm
Pixels across the feature, that sensor
–

Pixels needed = field / feature × pixels per feature on each axis (field incl. margin). The lens must resolve the pixels too: Nyquist = 1000 / (2 × pixel µm) lp/mm.

Find cameras with enough pixels Open the full calculator

Next, position a bar with its emitting center 40 mm above the surface and 150 mm horizontally from the inspection center. Treating the source as a point gives an approximate center-ray elevation:

α = arctan(height / horizontal offset) = arctan(40 / 150) ≈ 15° with the height increased to 100 mm: α = arctan(100 / 150) ≈ 34°

This estimate describes the center ray only. A finite emitter illuminates the part over multiple angles, and each position across the plate sees a different geometry. Compare images at both elevations rather than assuming the shallower arrangement must be better.

Capture the scratch image using reflected light, then capture the outside edge using transmitted light. Separate exposures avoid asking one arrangement to provide both surface detail and a clean silhouette.

Run a controlled bright-field and dark-field test

Use representative good parts and confirmed defects, including finish variation and the least visible defect orientation. Keep the lens aperture, focus, camera gain and image processing fixed during each comparison.

  1. Establish a front-lit reference. Position the source so the normal surface returns light toward the camera. Set exposure below clipping and save an unprocessed image.
  2. Move into dark-field geometry. Shift the light until the normal surface becomes darker. For an initial sweep, try elevations near 15°, 30° and 45° from the surface plane.
  3. Change illumination direction. Move the bar around the part, or rotate a stationary sample during bench work. Test directions separated by roughly 90° to expose orientation sensitivity.
  4. Compare directional and broader illumination. A diffuser or ring may stabilize the background, but it may also reduce the defect signal. Judge both effects together.
  5. Repeat at permitted part positions. Test height, tilt and lateral displacement within the actual fixture limits. Do not qualify the arrangement only at the nominal center.
  6. Save geometry with every image. Record camera pose, source position, exposure, aperture, current setting and sample identity. Preserve settings that can be reproduced mechanically.

For each geometry, first compare images at the same exposure and light setting. Then optimize exposure separately for promising arrangements without clipping. This separates geometric effects from simple brightness changes.

A useful normalized comparison between defect and nearby background is:

C = |Id − Ib| / (Id + Ib) example: Id = 150, Ib = 50 C = |150 − 50| / (150 + 50) = 100 / 200 = 0.50

Here, Id and Ib are mean pixel values from suitable defect and background regions after consistent black-level handling. Use this metric only where the denominator is meaningful. It does not replace noise measurements or detection trials, especially near black or saturation.

The scratch detection and thresholding guide explains the next processing decision once illumination makes the defect consistently visible.

Test backlighting independently from surface lighting

Turn off the front lights before assessing a backlight. Otherwise, reflected illumination can brighten the part and obscure whether the silhouette alone provides a stable edge.

For an opaque object, inspect the background uniformity, edge transition and any unwanted bright regions inside the silhouette. Check that clamps, supports and neighboring parts do not block the required light path.

A diffuse backlight emits across a broad angular range. On some part geometries, rays passing around edges or through translucent material change the apparent boundary. A more directional arrangement can help, but the appropriate choice depends on thickness, material and the required measurement uncertainty.

The diffuse versus collimated backlight comparison covers that selection in greater depth. Do not assume collimation is necessary for every presence check or outside-edge inspection.

Transparent parts require particular care. Refraction and internal reflections can produce bright and dark bands that move as the part shifts. If the task concerns internal defects rather than the outline, test how transmitted rays respond to those defects instead of treating every dark region as an edge.

For larger inspection areas, also evaluate coverage and brightness across the field. A uniformly bright empty background is not enough if edge contrast changes with part position.

Check tolerance to tilt, finish and feature direction

A successful nominal image is only the beginning. Smooth surfaces can be especially sensitive to small changes in their orientation relative to the source and camera.

In an ideal mirror cross-section, rotating the surface normal by 1° rotates the reflected ray by 2° for a fixed incoming ray. Real illumination has angular width, but the relationship explains why a small fixture tilt can move a highlight across the inspection region.

Test the actual permitted tilt rather than relying on exposure adjustment to compensate. If moving highlights resemble defects, change the source size, source direction or viewing geometry before adding more processing complexity.

Scratches also have directional behavior. A bar that reveals scratches across one direction may miss scratches running another way. Separate directional exposures can preserve that information better than turning every light on simultaneously.

Use the shiny surface lighting comparison when reflected source images dominate the inspection. For curved surfaces that reflect many surroundings, dome illumination may provide a more useful background than a narrow directional source.

Know when the usual answer is wrong

Dark-field is not automatically the right answer for every surface defect. A shallow stain or printed mark may have little directional scattering. Broad bright-field illumination, combined with suitable wavelength selection, may separate it more reliably from its background.

Likewise, backlighting is not automatically the best choice for every dimensional feature. A feature hidden behind another part of the component cannot appear in the silhouette from that viewing direction. Change the camera view, expose the feature mechanically, or use another inspection method.

A ring is not automatically more consistent than a bar. Its multiple illumination directions can help with part rotation, yet reduce shadows needed for dents or embossed features. Test the intended defect mechanism rather than choosing solely by the light’s shape.

Finally, avoid changing geometry and color simultaneously during the first comparison. Establish a useful ray path, then investigate spectral contrast with the light color selection guide. Keep automatic exposure disabled while comparing those trials.

Complete the ordering and acceptance checklist

Before choosing hardware, confirm the following against the images and mechanical layout:

  • Inspection information: identify whether each feature needs reflected light, transmitted light or a separate exposure.
  • Angle reference: record source elevation from the surface plane and camera orientation relative to the normal.
  • Coverage: verify the complete inspection region at the permitted part positions, not just the center.
  • Mechanical access: check lens clearance, mounting travel and unobstructed backlight paths.
  • Surface variation: include acceptable finish changes and the least visible confirmed defects.
  • Directional sensitivity: rotate defects relative to the source and test all required orientations.
  • Exposure margin: avoid clipped highlights and confirm useful contrast at the required motion conditions.
  • Electrical compatibility: verify supply, connector, control method and any permitted pulse operation from the selected documentation.
  • Acceptance evidence: save raw images and repeat the decision test on samples not used to choose the settings.

Choose the arrangement that preserves useful separation across these variations, rather than the one producing the most dramatic single image. Start the lighting configuration with the geometry established, or contact the applications team with sample images, field of view and mounting constraints.

Questions

What lighting angle should I try first for surface inspection?

There is no universal angle for surface inspection. Begin with the feature’s optical behavior: printed contrast often benefits from broad front illumination, while scratches may respond to shallow directional light. Sweep several elevations and directions, then repeat the comparison across expected part tilt, position and finish variation.

What is the difference between bright-field and dark-field lighting?

Bright-field places useful background reflection within the lens’s acceptance range. Dark-field directs most background illumination elsewhere, allowing defects or texture to redirect light toward the camera. The distinction depends on the source, surface and camera together; a particular light shape does not guarantee either condition.

When should I use a backlight instead of front lighting?

Use a backlight when the required information is an unobstructed outline, hole or gap, particularly on an opaque part. It generally suppresses front-surface detail rather than revealing it. Transparent materials and thick edges need additional testing because refraction and angular illumination can change the apparent boundary.

Why does a scratch disappear when the part rotates?

A scratch’s profile redirects light differently depending on the incident direction. Illumination that produces strong contrast for one orientation can produce little contrast for another. Test perpendicular source directions, and consider separate exposures when simultaneous illumination fills useful shadows or raises the background.

Is a ring light better than a bar light?

A ring can provide illumination from multiple directions around the lens, which may help when parts rotate. A bar offers more independent control of direction and elevation. Compare them using representative defects because broader directional coverage can also suppress shadows or highlights that carry useful inspection information.