Lenses & opticsGuide

Machine vision lens selection criteria: the six numbers to check

Spec a machine vision lens in order: field of view, pixel rule, sensor format, focal length, f-number, distortion - with formulas and a worked 12 MP example.

LumaSpec Vision11 min read Share on LinkedIn

On this page 12 sections
  1. 01The six numbers, in the order that matters
  2. 02Field of view: part size plus margin
  3. 03The pixel rule fixes the camera resolution
  4. 04Sensor format and focal length
  5. 05Worked example: a 12 MP camera over a 90 mm panel at 300 mm
  6. 06F-number: depth of field against diffraction
  7. 07Distortion, telecentricity and measurement
  8. 08Mount, image circle and back focus
  9. 09Catalog lenses as spec reference points
  10. 10When the standard answer is wrong
  11. 11Checks before you order
  12. 12Questions

Most of the time lost to lens selection comes from picking a focal length first and finding the constraints later. Spec a machine vision lens in a fixed order instead: field of view, pixels across the smallest feature, sensor format, focal length, f-number, then distortion and mount. Each number feeds the next, and by the end the lens selects itself - or the arithmetic tells you the station layout has to move. This guide gives the order, the formulas, one worked example with the arithmetic written out, and the checks to run before you order. Every number is one you can carry straight into the machine vision lenses or the lens finder as a filter.

The six numbers, in the order that matters

Work the chain top to bottom and it converges in one pass; jump ahead and every later number moves. Steps 1 to 3 pick the camera, steps 4 to 6 pick the lens. That split is why focal length is not the first decision: until the sensor and the field of view are fixed, no focal length is uniquely right.

# Number Where it comes from What it decides
1 Field of view largest part dimension plus margin camera position, lens type
2 Pixels per feature smallest feature divided by 3 camera resolution
3 Sensor format resolution and pixel pitch image circle, focal length
4 Focal length WD × sensor width ÷ FOV the lens model
5 F-number part height and position spread depth of field vs diffraction
6 Distortion measurement tolerance FA lens vs telecentric

Field of view: part size plus margin

Start from the largest part dimension, not from a lens in a drawer. Field of view is the part size plus margin: 5-10% per side on a fixture, 10-15% per side on a belt or gantry where position wanders. The margin also absorbs the few-percent difference between a lens's nominal focal length and its actual one. Match the field's aspect ratio to the sensor, 4:3 on most area sensors, so no pixels frame empty space.

A 90 mm panel on a fixture gets a 96 mm × 72 mm field: 3 mm of clearance each side. When the camera hangs at a fixed height over a conveyor instead, the height sets the field and the same relation runs in reverse. Sensor size and focal length are what set that field, as the field of view guide shows.

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.

The pixel rule fixes the camera resolution

Divide the smallest feature you must see by 3: that is the largest acceptable pixel scale, in mm per pixel. The camera then needs field of view ÷ pixel scale pixels across. A 96 mm field and a 0.15 mm mark give a 0.05 mm/px limit, so 1,920 pixels minimum: a 2448 × 2048 (5 MP) sensor passes, a 1920-wide sensor sits exactly on the limit. Edge fitting, gauging and small-character OCR want 4 to 8 pixels per feature instead of 3.

The lens inherits the requirement. A lens rated below the camera's resolution class softens exactly the detail the pixels were bought for; the pixel rule sizes the camera, and MTF against pixel size sizes the lens behind it.

Sensor format and focal length

The camera chosen in step 2 fixes the sensor: its resolution and pixel pitch give the physical width that the format name summarizes.

Sensor format Width (mm) Diagonal (mm)
1/2" 6.4 8.0
1/1.8" 7.2 9.0
1/1.7" 7.4 9.3
2/3" 8.8 11.0
1" 12.8 16.0
f = WD × w / FOV FOV = WD × w / f

WD is working distance, w the sensor width, FOV the field width, all in mm. It is the ideal-lens relation: fixed focal machine vision lenses land within a few percent of it, which is what the margin absorbs. Telecentric lenses are the exception, because their field is fixed by design and barely moves with WD. On a 2/3" sensor at 300 mm, a 25 mm lens covers 300 × 8.8 ÷ 25 ≈ 106 mm. The same chain runs backwards: the focal length guide and the field of view and working distance formula both work it, and what format names mean covers the table above.

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

Worked example: a 12 MP camera over a 90 mm panel at 300 mm

Inputs, each with its source:

  • Part: 90 mm × 68 mm panel, smallest detail a 0.15 mm DataMatrix module (part drawing).
  • Margin: 3 mm per side, so a 96 mm × 72 mm field at 4:3 (margin rule above).
  • Camera: LS-CMR-0166 - 12 MP, 4000 × 3000, 1/1.7" rolling shutter, USB3, 30 fps (catalog data).
  • Sensor width: 7.4 mm from the format table, so pixel pitch = 7.4 mm ÷ 4000 = 1.85 µm.
  • Working distance: 300 mm requested by the cell layout, to keep the camera clear of the pallet.

The rule in words: focal length maps the sensor width onto the field width at the available distance.

  1. f = 300 × 7.4 ÷ 96 = 23.1 mm. Nearest standard focal length: 25 mm.
  2. Check before ordering: at 25 mm and 300 mm the field is 300 × 7.4 ÷ 25 = 88.8 mm. The part is 90 mm, so it fails by 1.2 mm.
  3. Keep 25 mm and solve for distance: WD = 96 × 25 ÷ 7.4 = 324 mm. Mount at 330 mm, giving a field of 330 × 7.4 ÷ 25 = 97.7 mm.
  4. Pixel check: 97.7 mm ÷ 4000 = 0.0244 mm/px, so the 0.15 mm module spans 6.1 pixels, above the 3 px rule.
  5. Depth check: magnification m = 7.4 ÷ 97.7 = 0.0757; at F4 the depth estimate is 5.6 mm total, at F5.6 about 7.8 mm (next section).

Result: a 25 mm C-mount lens at 330 mm covers the part; 300 mm does not. The decision: order a 25 mm C-mount lens with an image circle over 9.3 mm diagonal (a 2/3"-class circle covers it), a resolution class rated for 2 µm pixels or finer, distortion under 1% for code reading, run at F4-F5.6, mounted at 330 mm. The threshold behind the move: the pixel rule demanded 0.05 mm/px or better and the design delivers 0.0244. If the cell cannot spare 330 mm, a 16 mm lens at 300 mm gives a field of 300 × 7.4 ÷ 16 = 139 mm and 4.3 px per module, still passing with a looser margin.

Field of view scales linearly with working distance, so once the real lens is mounted, rerun step 2 with its actual focal length; nominal figures carry tolerance. How the field changes with distance shows that scaling.

The camera assumed throughout this example:

Area scan cameras12 MP USB3 area scan camera, IMX226, 1/1.7" rolling shutter, 30 fps, 4000 × 3000 resolution (LS-CMR-0166)LS-CMR-0166
Sensor format
1/1.7"
Interface
USB3
Resolution
12 MP
Shutter
Rolling
$560.00View partBuild a system with it

F-number: depth of field against diffraction

DOF ≈ 2 · N · c · (1 + m) / m² Airy diameter ≈ 2.44 · λ · N

N is the f-number, c the circle of confusion (take 2 pixels for machine vision), m the magnification from the example. One stop more f-number buys about 41% more depth and costs a 41% larger diffraction disc: both sides of the trade scale together.

For the worked camera (m = 0.0757, pixel pitch 1.85 µm, so c = 3.7 µm = 0.0037 mm): F4 gives 2 × 4 × 0.0037 × 1.0757 ÷ 0.00573 ≈ 5.6 mm of depth, ±2.8 mm; F5.6 gives ±3.9 mm. The diffraction disc at 520 nm is 2.44 × 0.52 × 4 = 5.1 µm at F4, about 2.7 pixels, and 7.1 µm at F5.6, about 3.8 pixels.

Decision: pick the smallest f-number that holds focus across the part's full height range, then stop. Past about two pixels of Airy diameter, contrast falls faster than depth grows; with 1.85 µm pixels that lands near F4-F5.6, not at F11. F-number and depth of field develops the depth side, the diffraction limit against pixel size the blur side, and the depth of field calculator runs your own numbers.

Distortion, telecentricity and measurement

Distortion bends straight features near the frame edge; it never blurs them. Budget by task: presence and assembly checks run fine at 1-2% once the system is calibrated; dimension checks on one camera want under 0.3% or a calibration model that removes distortion every frame; repeatable gauging is where distortion plus part-height perspective error push you to an object-side telecentric lens, which holds magnification constant across depth because its field is fixed.

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.

A telecentric field is read from magnification, not focal length: at 0.4x on the 7.4 mm sensor above, the field is 7.4 ÷ 0.4 = 18.5 mm. The LS-TCL-0574 is an object-side telecentric lens at 0.4x with 227 mm working distance, C-mount, image circle 16-22 mm, sized for a 1.2" sensor.

Machine vision lensesFixed-magnification lens, 0.4x, 227 mm WD, 1.2" (LS-TCL-0574)LS-TCL-0574
Sensor format
1.2"
Mount
C-mount
Image circle
16-22 mm
$2,269.00View partBuild a system with it

Mount, image circle and back focus

Three mechanical checks finish the spec. Image circle: the printed circle must reach the sensor diagonal from the table above, 9.3 mm for 1/1.7" or 11.0 mm for 2/3", or the corners go grey. Back focus: C-mount flange distance is 17.526 mm, CS-mount 12.5 mm, and a 5 mm ring adapts CS glass onto C-mount cameras; every filter or spacer in front of the sensor eats focus travel. Rigidity: on robot-mounted cameras and start-stop conveyors, focus and iris rings that are not locked walk off, so use locking or anti-vibration types. C-mount versus CS-mount covers the adapters and clearance in detail.

Catalog lenses as spec reference points

Three tiers show what the spec lines look like in the catalog. General FA work on a 2/3" sensor: the LS-FFL-0679 is a 35 mm, 2/3", 6 MP, C-mount machine vision lens. Fine-pixel cameras, where the resolution class leads the spec: the LS-FFL-0567 is a 16 mm, 1.1", 20 MP, C-mount lens with F2.8-22 and <0.3% distortion. Cells that need clearance under the optics, where magnification and working distance come printed: the LS-FFL-0914 is a 2/3", C-mount lens at 0.3x with 168 mm working distance.

Machine vision lenses35 mm, 2/3", 6 MP, C-mount machine vision lens (LS-FFL-0679)LS-FFL-0679
Type
Machine vision fixed
Sensor format
2/3"
Mount
C-mount
Resolution
6-10 MP
$219.00View partBuild a system with it
Machine vision lenses16 mm, 1.1", 20 MP, C-mount machine vision lens, F2.8-22, <0.3% distortion (LS-FFL-0567)LS-FFL-0567
Type
Machine vision fixed
Sensor format
1.1"
Mount
C-mount
Resolution
16-25 MP
$679.00View partBuild a system with it
Machine vision lenses2/3", C-mount machine vision lens, 0.3x, WD 168 mm, length 127.9 mm (LS-FFL-0914)LS-FFL-0914
Type
Machine vision fixed
Sensor format
2/3"
Mount
C-mount
Image circle
8-11 mm
$189.00View partBuild a system with it

The table pulls the three data sheets side by side.

Specification LS-FFL-0679 LS-FFL-0567 LS-TCL-0574
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 $2,269.00

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

Filter the lens finder by sensor format, focal length and resolution class once your six numbers are set, or work through the lens configurator from camera to part.

When the standard answer is wrong

Four cases break the recipe. Gauging tighter than about 0.1% of the field: go telecentric, because calibration removes distortion but not the perspective error that part height adds. Fields under 20 mm: use magnification-rated lenses rather than extension tubes, which add magnification but cost resolution and working distance. Fields above a few hundred millimetres: split the view across cameras or move to line scan, because no single FA lens covers it at a sane distance. And buying pixels the rule does not need: 1.85 µm pixels demand a lens class most 6 MP FA lenses cannot hold at the edges, so the bigger camera can mean a costlier lens, not a sharper image - why smaller pixels give lower contrast.

Checks before you order

  • Image circle at least the sensor diagonal, or the corners vignette.
  • Resolution class at or above the camera's pixel class, or the edges soften.
  • Field of view recomputed with the real focal length at the mounted working distance, so the margin survives contact with the actual lens.
  • Depth of field at the chosen f-number covering the part's full height range.
  • Distortion budget matched to the measurement tolerance, or a telecentric selected.
  • Mount, back focus and filter spacing checked, so the lens still reaches focus with the hardware stacked.
  • Working distance plus barrel length inside the cell's clearance.

Take the six numbers to the lens configurator, browse the same chain on the lenses topic page, or contact the applications team with the field, distance and sensor, and we will check the arithmetic with you.

Questions

Does a lens rated for 6 MP work on a 12 MP camera?

Only if its image circle covers the sensor and it resolves the pixel pitch. A 6 MP rating assumes pixels around 3.45 µm, about 145 lp/mm at Nyquist. A 12 MP, 1/1.7" sensor runs 1.85 µm pixels, about 270 lp/mm, which the 6 MP lens will not deliver at the edges. Match the lens's MP class or lp/mm figure to the pixel pitch, not the megapixel count.

How much field of view margin do parts on a moving belt need?

Hold 10-15% per side and add the position wander explicitly: a 90 mm part with ±10 mm of belt wander plus 5 mm margin becomes a 120 mm field, not 99 mm. Exposure must then freeze motion. At 0.025 mm/px a part moving 100 mm/s needs about 0.25 ms to keep blur under one pixel.

Can a photographic F-mount lens be adapted to a C-mount camera?

Mechanically yes: the F flange sits 46.5 mm from the sensor, C-mount 17.526 mm, so about 29 mm of adapter fits. Optically it is a bench shortcut, not a production spec: no locked focus or iris, temperature drift moves focus, and nothing is rated for vibration. Fine for feasibility tests; budget a machine vision lens for the line.

What focal length covers a 300 mm field at 500 mm working distance?

It depends on sensor width: f = WD × w ÷ FOV. On a 2/3" sensor (8.8 mm wide): 500 × 8.8 ÷ 300 = 14.7 mm, so a 15 or 16 mm lens. On a 1" sensor (12.8 mm): 500 × 12.8 ÷ 300 = 21.3 mm, so a 25 mm lens pushed back to 300 × 25 ÷ 12.8 = 586 mm.

Do telecentric lenses need a bigger field than the part?

The field should fit the part with the same margin as any lens, but the barrel is the real constraint: the front aperture must be larger than the field, so size and cost climb steeply with field of view. For fields of a few tens of millimetres they stay practical; beyond that, check a calibrated FA lens or split the field across cameras before defaulting to one large telecentric.