When a vision check fails, engineers look at the camera first. Megapixels, frame rate, sensor size. They upgrade from a 5 MP camera to a 12 MP, spend twice as much, and the defect rate barely moves. The problem was never the camera.

Lighting is the optics

A vision system doesn’t photograph the part. It photographs the contrast between what you care about and everything else. Good lighting makes the defect the brightest or darkest thing in the image. Bad lighting buries it in texture, reflection, and shadow.

Resolution matters, but only after contrast exists. A 12 MP camera pointed at a badly lit part still can’t see a defect that has no contrast edge. You can’t resolve a pixel that the lighting never created.

The four lighting mistakes that recur

Using a ring light for everything. Ring lights are the default because they’re cheap and easy. They also produce hot spots on curved and glossy surfaces. A chrome fastener under a ring light looks like a mirror. The defect you’re hunting might be a reflection, not a flaw. Switch to diffuse dome lighting for shiny parts, or backlighting for silhouettes.

Backlighting for presence, not for measurement. Backlighting is great for checking if a part is in place and for measuring outer dimensions. It’s terrible for surface defects, because it throws the part into silhouette. If you need to see a scratch on the top face, backlight tells you nothing.

Coaxial light for domed surfaces. Coaxial lighting works for flat, specular surfaces: a wafer, a flat metal plate, a printed label. Aim it at a curved surface and the reflection collapses to a single bright streak. Use low-angle dark-field lighting for scratches and embossed features instead; it makes surface texture glow while flat areas stay dark.

Changing the part without changing the light. A supplier switches from a glossy plastic to a matte one, and the inspection rate drops overnight. The camera didn’t change. The reflection profile did. Every material swap is a lighting redesign, even if the part geometry is identical.

Resolution: what it actually buys you

Resolution sets the smallest feature you can measure, not whether you can see it. The rule of thumb is that a measurable feature needs at least 3 to 5 pixels across it. If your field of view is 100 mm and you need to spot a 0.1 mm burr, you need roughly 30 pixels per mm, which means a 3000-pixel-wide sensor. That’s a 12 MP camera or larger.

But here’s the part people skip: if the burr has no contrast against the part, those 30 pixels are all the same gray. You’ve paid for resolution you can’t use. Sort out the contrast first, then buy the sensor that matches the feature size.

The setup nobody budgets time for

A proper vision installation starts with a lighting trial bench, not a camera. Tape a sample part to a table, try three or four light geometries, and see which one makes the defect jump out. Only then pick the camera, lens, and working distance that fit that geometry.

This takes a day. Most integrations skip it and start with a catalog camera, then spend six weeks tuning thresholds that should have been solved with a $200 light.

Environment matters more than you think

Plant lights change through the day. Sunlight through a skylight shifts the color temperature by 200 K between morning and afternoon. A system tuned at 2 PM fails at 9 AM. Put a shroud around the station, or use a strobe synchronized to the camera exposure, so the ambient light doesn’t matter. If you can’t shroud it, budget for ongoing threshold tuning, because you’ll be doing it.

Bottom line

If a vision check is unstable, start by changing the light before you change the camera. The camera is a measuring instrument; the light is what creates the thing you’re measuring. Get the light right, and a 2 MP camera will outperform a 12 MP camera on a bad light rig every time.