AI Hints
Home›Computer Vision Tutorial›Measuring the World
Computer Vision · Lesson 50 of 111

Lighting and Cameras

The secret of industrial vision.

⏱ 2 min read▶ Video at 1:20:24🎓 Free
Watch this lesson in the Computer Vision courseWatch on YouTube ↗Full Computer Vision course

Ask a veteran machine vision engineer for their top tip, and it won't be about models. It'll be, get the lighting right. Experienced teams spend more of their budget on lamps and lenses than on software, because a problem that's solved at the camera never reaches your code.

Lighting and Cameras
From the video: Lighting and Cameras
  • A veteran's top tip
  • Get the lighting right
  • Solve it before the code

Lighting techniques

Each lighting setup reveals something different. Back lighting gives you a crisp silhouette, which is ideal for measuring shape. Low angle light makes scratches and dents stand out. Diffuse dome lighting removes reflections from shiny surfaces, such as a waxed apple. And polarising filters cut glare. Pick the lighting which makes your defect obvious.

TechniqueReveals
Back lightExact outlines
Low-angle lightScratches and dents
Diffuse domeShiny surfaces, no glare
Polarised lightCuts reflections
Near-infraredBruises under the skin

Choosing a camera

When you're picking a camera, a few numbers matter. Resolution needs enough pixels on the smallest defect, and a common rule is at least three or four. Exposure time must be short enough to freeze the motion. Global shutter cameras capture all of the pixels at once, whereas rolling shutters skew moving objects. And frame rate must keep up with the belt.

keyvalue
Resolution3-4 pixels on the smallest defect
Exposurefreezes the motion
Global shutterno skew on moving things
Frame ratematches the belt

Seeing beyond the visible

Cameras can see what our eyes can't. Near infrared shows a bruise under the skin, days before it appears. That's why real fruit graders use it. Thermal cameras see heat. Depth cameras see shape. And hyperspectral cameras measure sugar content. If your defect is hard to see in colour, the answer may be a different sensor, rather than a bigger model.

Near-infraredbruises under the skin
Thermalheat
Depthshape
Hyperspectralchemistry

Summary

Solve it at the camera first. Now, let's get back to the code, and start measuring apples. First, how many are there?

Key takeaways
  • Lighting decides what's visible
  • Enough pixels, short exposure
  • Consider other sensors
Next up: Counting Objects — connected components