Lenses & opticsGuide

Machine vision lens selection for reliable inspection

Build a machine vision lens selection shortlist from field of view, sensor size and feature detail, then verify coverage, focus and measurement accuracy.

LumaSpec Vision11 min read Share on LinkedIn

On this page 11 sections
  1. 011. Define the inspection requirement first
  2. 022. Check whether the smallest feature has enough pixels
  3. 033. Estimate focal length from actual sensor dimensions
  4. 044. Confirm image-circle coverage and mechanical fit
  5. 055. Compare catalog candidates without confusing them with a solution
  6. 066. Balance aperture, depth of field and exposure
  7. 077. Decide whether perspective requires telecentric optics
  8. 088. Validate image quality at the intended operating point
  9. 099. Recognize when the usual fixed-lens answer is wrong
  10. 1010. Complete the ordering checklist
  11. 11Questions

A lens can fit the camera and still miss the inspection requirement. It may crop a moving part, blur small defects near the corners, or change apparent dimensions as the part height varies. Reliable selection starts with the inspection task, not a familiar focal length.

This guide shows you how to turn field of view, working distance, sensor dimensions and feature size into a lens shortlist. You will also learn which compatibility checks and image tests to complete before committing to an optical arrangement.

1. Define the inspection requirement first

For a fixed inspection station, start with a fixed focal length lens unless changing the field of view is a genuine requirement. Consider telecentric optics when height-dependent magnification could consume your measurement tolerance.

Write down these requirements before browsing machine vision lenses:

Requirement What to record Why it changes selection
Inspection area Required width and height, including position variation Sets the minimum field of view
Smallest feature Defect width, gap or edge detail Sets the sampling requirement
Measurement tolerance Allowed error and repeatability Determines the optical error budget
Working distance Available clearance and its reference surface Restricts focal length and focusing range
Height variation Highest and lowest inspected surfaces Affects focus and perspective error
Camera geometry Active sensor width, height and pixel count Connects object dimensions to image dimensions
Operating conditions Motion, lighting, vibration and temperature Determines exposure and stability requirements

A part measuring 100 mm across does not automatically need a 100 mm field of view. If its center can shift by 5 mm in either direction, the occupied width becomes 110 mm before adding any deliberate border.

Allow room for useful background, calibration features and assembly variation. The guide to calibration-target coverage margins explains why fitting the nominal outline is not enough.

2. Check whether the smallest feature has enough pixels

Calculate object-space sampling before choosing a focal length. Use the active image dimensions after cropping or binning, not a megapixel label alone.

object sampling = field-of-view width / horizontal pixel count pixels across feature = feature width / object sampling

Consider a hypothetical image with 4096 × 3072 pixels covering 120 × 90 mm. The horizontal sampling is:

120 mm / 4096 pixels = 0.0293 mm/pixel 0.15 mm / 0.0293 mm/pixel = 5.12 pixels

A 0.15 mm feature therefore spans about five pixels. That is a reasonable starting point for an imaging trial, not proof of reliable detection. Low contrast, blur, glare and feature orientation can require more sampling.

Doubling the field width while keeping the same image width halves the pixels across that feature. Digital enlargement cannot recover the lost information.

Camera resolution for the smallest feature
Units
Pixels needed
–
Sensor size
– MP
Smallest sensor that fits
–
Pixel on the part
– mm
Pixels across the feature, that sensor
–

Pixels needed = field / feature × pixels per feature on each axis (field incl. margin). The lens must resolve the pixels too: Nyquist = 1000 / (2 × pixel µm) lp/mm.

Find cameras with enough pixels Open the full calculator

For dimensional inspection, separate sampling from measurement accuracy. Subpixel edge localization may improve repeatability under controlled conditions, but it cannot remove perspective error, calibration error or unstable illumination. Use the guide to choosing camera resolution for dimensional inspection to build that broader budget.

If the sampling fails, reduce the field of view, increase the active pixel count, or divide the inspection between views. Compare area scan cameras through the camera finder only after establishing the required image dimensions.

3. Estimate focal length from actual sensor dimensions

Use the sensor's active width and height in millimeters. Optical-format labels are not direct measurements of the active diagonal.

For a first estimate, magnification connects sensor width to object width. A thin-lens approximation then gives focal length:

m = sensor width / field-of-view width f ≈ u × m / (1 + m)

Here, m is magnification, f is focal length, and u is object distance measured from the front principal plane. Catalog working distance commonly uses a mechanical reference instead. The difference matters at short distances, so use this calculation for shortlisting and verify the manufacturer's field-of-view data.

How sensor width, working distance and field of view set the focal length Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.CameraField of view (FOV)Working distance (WD)≈ fsensor width slensm = s / FOVf = WD × m / (1 + m)
How sensor width, working distance and field of view set the focal length. Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.

Continue the hypothetical example with an active sensor measuring 12.8 × 9.6 mm. Use an approximate object distance of 300 mm:

m = 12.8 / 120 = 0.1067 f ≈ 300 × 0.1067 / 1.1067 = 28.9 mm

The height calculation gives the same magnification because the sensor and requested field share the same aspect ratio. With different aspect ratios, calculate both directions and select the magnification that covers both requirements.

Lens focal length, field of view and working distance
Units
Solve for
Focal length
– mm
Field of view
– mm
Working distance
– mm
Magnification
– x
Angle of view
– °
Pixel on the part
– mm

Thin-lens model: m = sensor width / field of view, f = WD × m / (1 + m). Accurate to a few percent above about 150 mm; check the lens's minimum object distance.

Find lenses with this focal length Open the full calculator

The nearest catalog focal length is not automatically the right choice. Under the same simplified geometry, a shorter option changes both coverage and sampling:

field width ≈ sensor width × (u - f) / f field width ≈ 12.8 × (300 - 25) / 25 = 140.8 mm pixels across feature ≈ 0.15 × 4096 / 140.8 = 4.36 pixels

The wider field provides more positioning margin but fewer pixels across the defect. A longer option could crop the inspection area instead. Check the actual focusing range and object-to-image data before deciding.

For a deeper treatment of this calculation, use the machine-vision focal-length selection guide. Search the resulting range in the lens finder, rather than treating the estimate as a purchase specification.

4. Confirm image-circle coverage and mechanical fit

The lens must cover the active sensor area with usable image quality. Calculate the active diagonal when the sensor dimensions are available:

sensor diagonal = sqrt(sensor width² + sensor height²) sensor diagonal = sqrt(12.8² + 9.6²) = 16.0 mm

An image circle reaching the corners is necessary, but it does not guarantee adequate corner contrast or brightness. Ask about performance across the field at the intended aperture, wavelength and magnification.

A larger-format lens can cover a smaller sensor when the remaining optical and mechanical requirements match. It does not inherently change the field of view compared with another lens of the same focal length at the same imaging geometry.

The sensor-format compatibility guide explains why format labels are useful screening terms rather than complete coverage specifications.

Check these mechanical details separately:

  • Lens mount and camera mount, including flange distance.
  • Rear-element clearance and any protective window.
  • Required adapters and their optical spacing effects.
  • Lens barrel clearance around brackets and illumination.
  • Focus and aperture access after installation.
  • Support for a heavy lens without loading the camera mount excessively.

Do not assume that matching threads prove compatibility. An adapter can change spacing enough to prevent the required focus or alter the usable field.

5. Compare catalog candidates without confusing them with a solution

Catalog specifications help reject unsuitable options. They do not replace the application calculations or a sample-image test.

The LS-FFL-0679 is a 35 mm, 2/3", C-mount machine vision lens. The LS-FFL-0567 is a 16 mm, 1.1", 20 MP, C-mount machine vision lens.

These examples illustrate different focal-length and sensor-coverage choices, not interchangeable answers to the worked example:

Specification LS-FFL-0679 LS-FFL-0567
Format 2/3" 1.1"
Resolution 6.0 Megapixel (2.4μm pixel size) 20 Megapixel
Focal length 35 mm 16 mm
Aperture F2.8 Manual iris F2.8-22
M.O.D. 0.2 m 0.1 m
Price $219.00 $679.00

All 2 share: Mount C. Values as printed in each product's data sheet; open a part for its drawing and full specifications.

First reject candidates that cannot meet coverage, mounting or working-distance requirements. Then compare image quality at the intended operating point.

A lens resolution label alone is insufficient. Pixel pitch, active sensor size, aperture and field position all matter. When available, compare modulation transfer function data at spatial frequencies relevant to the camera, particularly near the corners.

For production inspection, prefer evidence from the intended geometry over a higher headline resolution rating. A sharp central image is not enough if the critical defect can appear anywhere in the frame.

6. Balance aperture, depth of field and exposure

Depth of field is the object-distance range over which blur remains acceptable for your task. It is not a region where every surface is equally sharp.

Stopping down generally increases depth of field, but reduces the light reaching the sensor and eventually increases diffraction blur. Opening the aperture provides more light, but may expose aberrations and reduce acceptable focus range.

Depth of field around the focus plane Light from the lens converges on the focus plane. In front of and behind it, each point spreads into a blur circle; the zone where that blur stays below about a pixel or two is the depth of field. A smaller aperture gives a narrower cone and a deeper zone.depth of fieldfocus planeapertureoutside it, pointsblur into circleswide aperture: steep cone, shallow zonesmall aperture (high F#): deeper zone
Depth of field around the focus plane. Light from the lens converges on the focus plane. In front of and behind it, each point spreads into a blur circle; the zone where that blur stays below about a pixel or two is the depth of field. A smaller aperture gives a narrower cone and a deeper zone.

For the same scene and approximately equal lens transmission, moving from f/4 to f/8 reduces sensor illumination by roughly a factor of four:

relative illumination ≈ (4 / 8)² = 0.25

Recovering brightness through exposure alone would require approximately four times the exposure duration. That may be unacceptable when the part moves.

Suppose object sampling is 0.0293 mm/pixel and travel speed is 200 mm/s. Limiting motion during exposure to one pixel gives:

maximum exposure ≈ object sampling / speed maximum exposure ≈ 0.0293 / 200 = 0.0001465 s maximum exposure ≈ 147 microseconds

This is a motion-blur estimate, not a camera capability claim. If the exposure budget is already exhausted, increase suitable illumination or reconsider the optics instead of simply extending exposure.

Test the highest and lowest inspected surfaces at the final aperture. Define acceptance through defect contrast or measurement repeatability, not whether the image looks generally sharp.

For controlled stations, a locked manual aperture often provides predictable imaging. Automatic aperture changes can alter depth of field during operation. The guide to iris, exposure and gain control explains those control interactions.

7. Decide whether perspective requires telecentric optics

A conventional lens changes apparent object size as object distance changes. A calibration at one plane does not remove that behavior at other heights.

As a rough perspective estimate, a 1 mm distance change around a 300 mm object distance represents about 0.33% scale variation. Across a 50 mm feature, that corresponds to roughly 0.17 mm. The exact result depends on the optical geometry, but the estimate can quickly reveal an unsuitable measurement approach.

Object-side telecentric lenses reduce magnification changes associated with object-distance variation within their specified operating range. They do not provide unlimited depth of field or eliminate every measurement error.

Perspective with a standard lens compared with a telecentric lens Left: the same part at two distances appears at two sizes through a standard lens. Right: a telecentric lens accepts only rays parallel to its axis, so the part appears the same size at both distances.Standard lensfarnearsensorThe same part looks bigger when nearer:its measured size depends on distanceTelecentric lensOnly rays parallel to the axis enter:the same size at any distance
Perspective with a standard lens compared with a telecentric lens. Left: the same part at two distances appears at two sizes through a standard lens. Right: a telecentric lens accepts only rays parallel to its axis, so the part appears the same size at both distances.

The LS-TCL-2194 is a 0.5x, WD 110 mm, 1", C-mount telecentric lens with coaxial light.

Telecentric lenses0.5x, WD 110 mm, 1", C-mount telecentric lens with coaxial light (LS-TCL-2194)LS-TCL-2194
Sensor format
1"
Mount
C-mount
Image circle
11-16 mm
Type
Object-side telecentric
$1,539.00View partBuild a system with it

Select telecentric magnification from the required field and sensor dimensions, then check working distance, object clearance and optical performance. Do not select it from magnification alone.

Inspection condition Sensible starting approach
Presence inspection with controlled part height Conventional fixed focal length lens
Small defects across a flat, repeatable plane Conventional lens with verified field performance
Tight dimensional tolerances with variable part height Evaluate telecentric optics
Several recipes requiring different fields Evaluate separate fixed setups or a repeatable zoom arrangement

The guide to when telecentric optics are needed for gauging develops the measurement decision. For any selected lens, validate distortion across the usable field. A low headline distortion figure does not establish residual error after calibration; use the distortion-correction accuracy procedure.

8. Validate image quality at the intended operating point

Before purchase approval, request sample imaging or agree on an evaluation method using representative parts. Include marginal defects, not only obvious failures and ideal samples.

  1. Set the intended field, working distance, aperture, lighting and exposure. Record the actual reference surfaces used for distance measurements.
  2. Place relevant features at the center, edges and corners. Check the smallest defect in every location where it may occur.
  3. Repeat at minimum, nominal and maximum part heights. Include tilt and placement variation allowed by the fixture.
  4. Capture moving parts at production speed. A sharp stationary image does not demonstrate acceptable motion performance.
  5. Repeat after focus and aperture locking. Check whether tightening the locks changes the result.
  6. Run the intended inspection algorithm on saved images. Record detection performance or measurement repeatability rather than relying only on visual judgment.

For measurements, include a suitable reference artifact and keep calibration separate from validation. The procedure for length measurement from image markers explains the mapping from image coordinates to physical dimensions.

Keep exposure and image processing fixed when comparing lenses. Otherwise, brightness normalization or sharpening can obscure the optical differences you are trying to measure.

9. Recognize when the usual fixed-lens answer is wrong

A fixed focal length lens is a strong starting point for a stable inspection station, but several conditions require a different approach.

If the required field is extremely wide at short clearance, moving the camera or splitting the inspection may work better than accepting severe perspective and difficult corner imaging.

If one image must cover widely separated heights, stopping down may not provide sufficient useful focus. Consider separate views, controlled part presentation, or a documented focus-changing process.

If recipes require substantially different fields, zoom optics may reduce mechanical changes. Validate positioning repeatability and calibration at each operating setting; a zoom scale is not a metrology reference.

If glare hides a defect, a different focal length may not solve the problem. Correct the illumination geometry, polarization or part presentation before adding pixels.

10. Complete the ordering checklist

Use this short checklist to confirm that the shortlist answers the inspection requirement:

  • Coverage: Both field dimensions include part movement, rotation and a deliberate border.
  • Sampling: The smallest feature has an agreed pixel budget at the final field of view.
  • Sensor compatibility: Active dimensions and image-circle coverage have been checked, including corners.
  • Mechanical fit: Mount, flange spacing, rear clearance and lens support are resolved.
  • Working distance: The stated distance uses a known reference and lies within the focusing range.
  • Depth and motion: Height extremes pass at an exposure compatible with production speed.
  • Measurement behavior: Perspective, distortion and calibration residuals fit the error budget.
  • Evidence: Representative saved images pass the intended inspection or measurement tests.

Start the lens configuration process with your field dimensions, active sensor dimensions, working-distance limits and smallest feature. If coverage or measurement behavior remains uncertain, send those requirements and representative part images through application support before finalizing the lens.

Questions

What should come first in machine vision lens selection?

Begin with the required field width and height, including placement variation. Then establish the active sensor dimensions, available working distance and smallest feature. Together, these determine magnification, approximate focal length and sampling. A focal length chosen without those inputs can produce an attractive image that cannot perform the inspection.

Can a lens rated for a larger sensor work on a smaller camera?

Yes, provided the mount, focusing range and other requirements are compatible. The smaller sensor uses a smaller region of the lens image circle. At the same focal length and imaging geometry, the format rating alone does not change coverage. Verify actual field performance rather than assuming a larger rating guarantees better results.

How many pixels should span the smallest defect?

There is no universal pixel count that guarantees detection. Start by calculating pixels across the smallest feature, then test representative defects under realistic contrast, focus and motion conditions. A feature spanning several pixels may be detectable, but reliable classification or precise measurement can demand substantially more image information.

When does dimensional inspection justify a telecentric lens?

Evaluate telecentric optics when changes in part distance or height create unacceptable scale variation with a conventional lens. They are particularly useful for demanding dimensional inspection. Selection still requires checking magnification, sensor coverage, working distance, depth of field, distortion and the complete measurement error budget.

Will closing the aperture always improve inspection quality?

No. A smaller aperture can increase useful depth of field, but it also reduces illumination and increases diffraction effects. The resulting exposure increase may introduce motion blur. Test the actual height range and smallest feature while holding exposure within the production motion budget.

What information should accompany a lens evaluation request?

Provide the active sensor dimensions, pixel count, required field, working-distance limits, height variation, smallest feature and measurement tolerance. Include representative parts or images, lighting constraints and production speed. Ask for performance evidence at the intended aperture and geometry, including critical features near the image corners.