How to Choose a Machine Vision Lens

A step-by-step selection guide covering sensor size, focal length, field of view, resolution, distortion and mounts.

In most machine vision systems, the lens affects image quality, measurement accuracy and detection stability more than the camera does. A poorly matched lens causes vignetting, soft edges, unstable measurements and unreliable AI results — no amount of software fixes bad optics.

This guide walks through lens selection in the order an engineer should attack it. You can also send us your parameters and we'll run the calculation for you.

Step 1 — Start with the Camera Sensor Size

The lens image circle must fully cover the camera sensor. If it doesn't, you get dark corners, vignetting and degraded edge resolution. Always match the lens format to the largest sensor you will use — a 1.1″ lens works fine on a 1/1.8″ camera, but not the other way around.

Sensor FormatDiagonal (approx.)Typical Use
1/3″6.0mmCompact systems, embedded vision
1/2″8.0mmEntry-level industrial vision
1/1.8″9.0mmModern 5–12MP industrial cameras
2/3″11.0mmStandard factory automation
1″16.0mmHigh-resolution inspection
1.1″ / 1.2″17.5–18.7mm20–45MP high-end cameras

Step 2 — Define Field of View and Working Distance

Field of view (FOV) is the area you need to image; working distance (WD) is the space between lens front and object. Together with the sensor size they determine focal length:

Focal Length ≈ (Sensor Size × Working Distance) ÷ Field of View

Example: a 1″ sensor (12.8mm wide) must image a 100mm-wide inspection area from a 400mm working distance: 12.8 × 400 ÷ 100 = 51mm → choose a 50mm lens.

Practical tips:

  • Short focal lengths (4–12mm) give wide angles — good for large scenes, but more perspective distortion.
  • Long focal lengths (35mm+) compress perspective and suit precision measurement and long working distances.
  • When torn between two focal lengths, pick the shorter one — you can crop or adjust WD, but you can't recover a field of view that's too narrow.

Step 3 — Match Lens Resolution to the Sensor

The lens must resolve detail at the sensor's pixel pitch. The rule is simple: lens MP rating ≥ camera MP rating. A 20MP camera behind a 5MP lens wastes the sensor — images look soft and low-contrast.

  • 2–5MP: standard FA lenses are sufficient for presence checks and OCR.
  • 8–12MP: use high-resolution series; check pixel-size compatibility on the datasheet.
  • 20–45MP: choose precision low-distortion optics and verify MTF at your working aperture, not just wide open.

Step 4 — Check Distortion Requirements

Distortion moves features from where they appear to where they actually are. For general viewing, 1% is tolerable. For anything that measures geometry — gauging, feature positioning, geometry-based AI inspection — target under 0.1%, or use a telecentric lens (under 0.05%) for true metrology. Software distortion correction helps, but a documented, stable, low-distortion optical design is always the better foundation.

Step 5 — Consider a Telecentric Lens for Measurement

If your system measures dimensions, a telecentric lens eliminates perspective error: magnification stays constant as the part moves within the telecentric range, and the vision system behaves like a measuring instrument. This is the standard for non-contact gauging, thread/bore inspection and high-accuracy defect classification.

Step 6 — Verify the Mount

MountFlange DistanceTypical SensorsNotes
C-Mount17.526mmup to ~1.1″Industrial standard, most rugged
CS-Mount12.526mmsmall sensorsC lens + 5mm ring works; CS lens on C camera does not focus
M12 / S-Mountvariableboard camerasCompact embedded systems
F-Mount / M42 / M58 / M72varieslarge & line scanLarge image circles, line scan cameras

Step 7 — Don't Ignore Aperture and Depth of Field

Smaller apertures (higher F-numbers) increase depth of field — useful for 3D parts and height variation — but reduce light and eventually soften the image through diffraction at small pixel pitches. For fixed installations, always choose a lens with locking focus and iris rings so vibration can't drift your settings.

Quick Checklist

  1. Camera sensor size → lens image circle must cover it
  2. FOV + WD → calculate focal length
  3. Lens MP rating ≥ camera resolution
  4. Distortion target per application (<0.1% for measurement)
  5. Telecentric for dimensional gauging
  6. Mount matches camera
  7. Locking focus/iris for production lines

FAQ

What is the formula for machine vision lens focal length?
Focal Length ≈ (Sensor Size × Working Distance) ÷ Field of View. Example: a 1″ sensor imaging a 100mm area from 400mm needs ≈ 51mm — choose a 50mm lens.
Does the lens need to match the camera sensor size?
Yes — the image circle must cover the sensor diagonal, or you get vignetting and soft edges. Larger-format lenses work on smaller sensors; the reverse does not.
How many megapixels should my lens support?
Lens MP rating ≥ camera MP rating. A lens below the sensor's resolution becomes the system bottleneck.
When do I need a low distortion lens?
Whenever the system measures geometry or trains AI on geometric features: target <0.1% distortion, or a telecentric lens (<0.05%) for metrology.
What is the difference between C-mount, CS-mount and M12?
C-mount (17.526mm flange) is the industrial standard up to ~1.1″ sensors. CS-mount (12.526mm) is a compact variant — C lenses work on CS cameras with a 5mm ring, not vice versa. M12 is a small thread mount for embedded cameras.

Want us to run the numbers?

Send your camera model, FOV and working distance — an engineer will reply with a matched lens recommendation within 24 hours.

Get a Recommendation