Back to Blog
AI

Vision Inspection Accuracy Is Decided by Lighting Before the Model: Selecting Cameras, Lenses, and Illumination

Vision inspection accuracy is decided by the imaging setup before the model ever sees a pixel. Here's how to derive resolution from defect size, choose lenses and lighting, calculate motion blur, and run a solid PoC.

POLYGLOTSOFT Tech Team2026-11-307 min read9
Machine VisionVisual InspectionIndustrial CameraLighting DesignQuality Inspection AI

Why a Better Model Doesn't Fix Your False Calls

When a vision AI inspection line keeps producing false detections, the first instinct is to swap the model. But if a bigger backbone and more data leave accuracy flat, the problem is probably the image itself. If a defect isn't visible in the image, no model can find it. A scratch buried in specular glare, or a micro-crack captured across fewer than two pixels, simply carries no information for the model to learn.

A common mistake is training on whatever the existing line camera already captures. Collect data before validating imaging conditions, and the moment you change the lighting, you'll have to collect it all over again.

Working Backward from Defect Size to Camera Resolution

Resolution is derived from the smallest defect you need to catch. In practice, aim for each defect to span at least 3–4 pixels.

  • Field of view (FOV) 120×90 mm, minimum defect 0.2 mm, 4 pixels per defect
  • Pixel size = 0.2 ÷ 4 = 0.05 mm
  • Required resolution = 120 ÷ 0.05 = 2,400 × 1,800 pixels → a ~5 MP camera (2448×2048)
  • Area-scan cameras suit stationary parts or discrete parts moving one at a time. Line-scan cameras are the better fit for continuous webs—film, steel strip, textiles—and for wide products. Covering 600 mm at 0.1 mm per pixel takes 6,000 pixels, so an 8K line-scan sensor is the choice; at a line speed of 60 m/min (1,000 mm/s), you need a line rate of 1,000 ÷ 0.1 = 10 kHz.

    Lens Selection: Focal Length, Depth of Field, and Telecentrics

    Focal length is roughly `sensor width × working distance ÷ FOV width`. With the 5 MP camera above (3.45 µm pixels, about 8.45 mm sensor width), viewing 120 mm at a 300 mm working distance works out to about 21 mm. If you use a standard 25 mm lens instead, extend the working distance to roughly 355 mm to match the FOV.

    If product height varies, check depth of field. Stopping down the aperture deepens it but cuts light, forcing longer exposures or brighter illumination.

    For dimensional measurement, consider a telecentric lens. A conventional lens magnifies objects as they move closer, so a 1 mm height change can shift your measurement. A telecentric lens holds magnification nearly constant within its depth of field. The catch: the FOV can't exceed the front lens aperture, so costs climb quickly for large parts.

    How Lighting Reveals Defects

  • Coaxial: Shows scratches and dents as dark marks on flat, mirror-like surfaces such as polished metal or wafers
  • Low-angle ring: A dark-field effect that makes surface texture, engravings, and fine scratches scatter brightly
  • Dome: Eliminates glare on cans, curved metal, and crinkled packaging for uniform images
  • Bar: Emphasizes directional defects and pairs well with line-scan cameras
  • Backlight: Captures outlines, holes, and contaminants as silhouettes
  • For highly reflective metal, use dome lighting or polarizing filters to suppress glare. For transparent parts, backlighting or dark-field brings out the edges. Curved products often can't be solved with a single shot, so plan for multiple captures at different lighting angles.

    Line Speed and Environmental Variables

    Motion blur equals `travel speed × exposure time`. For a part moving at 500 mm/s imaged at 0.05 mm per pixel, keeping blur under one pixel requires an exposure of 100 µs or less. To get enough light at exposures that short, use strobe lighting synchronized to the trigger.

    On the floor, block ambient light from windows and overhead fixtures with a shroud, and check camera brackets for vibration. LED output drifts downward with operating hours and temperature, so image a reference gray target periodically and track brightness as a number.

    PoC Checklist

  • Shoot real good and defective samples under 3–4 lighting setups
  • Confirm the smallest defect spans 3+ pixels with sufficient contrast against the background
  • Verify there's no blur at actual line speed
  • Lock down camera, lens, lighting, and exposure settings before collecting training data
  • Document every setting so the setup can be reproduced when hardware is replaced
  • At POLYGLOTSOFT, we design the imaging environment before we touch the model. We derive resolution and optics from your defect specs, validate lighting on real samples, collect data under fixed conditions, then train the model and integrate it with your MES. If you have an inspection line where false calls won't go away, let's start with a diagnosis of your imaging setup.