Many camera-based inspection projects fail not because the camera is weak or the algorithm is poor, but because the machine vision lighting is wrong. With the same camera, the same lens and the same software, changing how the part is lit can turn a faint scratch into a bright, clear line, or turn an ordinary feature into a washed-out patch of glare. This guide helps QC, production and system integration engineers choose lights and lighting techniques based on the part's surface and the defect to be caught.

Why lighting decides inspection results

A camera does not see an object; it records the light coming back from it. A defect shows up in the image only if it changes how light returns to the lens: a scratch scatters light, a dent redirects reflections, a stain absorbs light. If the lighting geometry does not emphasise that change, the defect is invisible to every algorithm, deep learning included.

The practical rule is therefore optimise lighting first, then the camera and software. A high-contrast image keeps the algorithm simpler, more stable and less sensitive to batch-to-batch variation. For the bigger picture, see what is machine vision and our exterior inspection solution page.

The main lighting techniques

Ring light

A ring light sits around the lens and lights the part from straight above or at an angle. It is the most common choice because it is compact and easy to mount. It suits matte surfaces, frosted plastic, printing and labels. The downside: on shiny surfaces it creates a circular hot spot in the middle of the image.

Dome light (diffuse lighting)

A dome delivers diffuse light from all directions, removing almost all reflections and shadows. It is well suited to curved, shiny or complex parts such as stamped metal housings, can ends and round components. A similar approach is covered in our article on tunnel light diffuse arch lighting. The trade-off is a large body and a short working distance.

Coaxial light

Light is sent through a half-mirror along the same axis as the camera, looking straight down. Flat, shiny surfaces reflect light directly back and appear bright and even, while scratches, dents, engravings and holes redirect the reflection and appear dark. It is very effective for reading laser-marked characters on metal and for inspecting flat glossy surfaces. See a product example in the OPT BC50-W coaxial light.

Backlight

The light sits behind the part and the camera looks toward it to capture a silhouette. Use it for dimensional measurement, hole checks, outlines, missing features, and for transparent parts when only the shape matters. It cannot show surface detail, because everything on the surface sinks into the dark silhouette.

Dark field (low-angle) and square diffuse lights

Light arrives at a very shallow angle, so a flat surface looks dark while scratch edges, dust and engraved marks glow. It suits fine scratches, cracks and embossed characters. See the OPT RBV9855-W diffuse dark-field square light.

Lighting selection table by surface and defect

The table below is a common starting point for choosing a light for visual inspection. Real results still depend on geometry, roughness and working distance, so always test on real parts.

Three common lighting mistakes

1. Glare on shiny surfaces

A ring or bar light aimed straight at glossy metal produces burnt-out white areas that hide the very spot you need to inspect. Fixes: switch to a dome or coaxial light, change the light angle, or add a polarising filter. Adjusting camera exposure does not solve the root cause.

2. Shadows read as defects

One-sided lighting over a part with height casts different shadows each time the part sits a few millimetres off, producing false NG results. Use diffuse light, symmetrical multi-light setups, or deliberately use the shadow as a feature and fix the part position.

3. Ignoring ambient light

Factory lamps, sunlight through a door and neighbouring machines all change the image through the day. A system that works in the evening fails at noon. Fixes: shield the inspection station, use light that clearly outweighs the background, pick a dedicated wavelength (for example red light with a bandpass filter), and use a lighting controller so brightness stays stable from shot to shot.

Quick tests before you buy a light

  • Fix the camera and the part, then photograph the same defect sample with at least four lights: ring, dome or diffuse, coaxial or dark field, and backlight.
  • Test both OK and NG groups, including the subtlest defect and not only obvious ones.
  • Change light angle and distance first, light colour second. Try oblique light from one side and from two sides.
  • Keep exposure time constant while comparing, then fine-tune afterwards.
  • Repeat the shots under real shop-floor conditions: ambient light, vibration, slight part misplacement.
  • Do not lock in lights before the camera is settled. See how to choose an industrial camera for machine vision.

Five-question lighting checklist

  1. What is the surface: shiny, matte, transparent or black?
  2. Is the defect a scratch, dent, stain or missing feature? Does it change brightness or shape?
  3. Is the part flat or curved, with significant height and shadows?
  4. What do working distance, line speed and mounting space allow?
  5. Does the shop floor have ambient light, vibration or dust?

Before and after: one product, four lights

The clearest way to see the effect of lighting is to put four images of the same product side by side: a ring light gives a glary background and a buried scratch; a dome gives an even surface but a faint scratch; a coaxial light makes a dent appear dark on a bright field; dark field makes the scratch glow on a dark background. Same camera, same algorithm, only the light differs, and usually only one or two setups are reliable enough for production.

Frequently asked questions

Is there one light that works for every product?

No. Each surface and defect type has its own suitable technique. In practice, many stations combine two lights, for example a backlight for outline and a diffuse light for the surface.

Can deep learning compensate for poor lighting?

Partly, but you should not rely on it. If the defect is not visible in the image, the model cannot learn it. Good lighting reduces the number of images to label and improves stability.

Choose the light or the camera first?

In parallel. Camera resolution sets the smallest visible detail, while lighting decides whether the defect appears at all. Testing lights on real parts helps settle both.

Does light colour matter?

Yes. Light of the same colour as the part makes it brighter, an opposite colour makes it darker. Choose the colour that maximises contrast between defect and background.

How BeeVision helps

The BeeVision engineering team works with machine vision lights and accessories, including product lines from OPT and Smart Vision Lights; see our machine vision accessories page. Send OK and NG samples and BeeVision will shoot them under several lighting setups, compare the images and recommend a light configuration for your line. Results depend on the application, so we always test on real samples before recommending anything.

Follow BeeVision on LinkedIn and YouTube for more real lighting comparisons, and send your samples through the send samples for a POC page.