Lenses & opticsExplainer

Working f-number and magnification: light, DOF, resolution

The ring value is not what the sensor sees up close. Compute the working f-number from magnification, then budget light, depth of field and diffraction.

LumaSpec Vision9 min read Share on LinkedIn

On this page 9 sections
  1. 01What the f-number on the ring sets
  2. 02The working f-number: what the sensor actually sees
  3. 03Worked example: a 0.5x set-up on an f/2.8 dial
  4. 04The three-way trade: light, focus, diffraction
  5. 05Numerical aperture: the same budget from the cone angle
  6. 06Choosing the working f-number: three cases
  7. 07When the dial already is the working value
  8. 08Checks before you order
  9. 09Questions

You set the iris to f/2.8, focus on the part, and the frame comes back darker and softer than the exposure math promised. Nothing is broken: the ring value is defined at infinity, where magnification is zero, and at a close working distance the lens runs slower than the dial says. The number that governs exposure, depth of field and diffraction is the working f-number, (f/#)w ≈ (1 + m) × f/#, where m is magnification. This guide works the factor through a 0.5x example with the arithmetic shown, then turns it into three budgets: light lost, focus gained, and where diffraction starts to blur small pixels. It is for anyone sizing a close-range station — inspection under 200 mm, OCR at 0.3x, measurement at 0.5x.

What the f-number on the ring sets

The marking on the iris ring is the ratio of focal length to effective aperture diameter: f/# = focal length / aperture diameter. A 25 mm lens at f/2.8 opens a 25 / 2.8 = 8.9 mm aperture with an area of π × (4.45 mm)² ≈ 62 mm². One stop down to f/4 halves the diameter to 6.3 mm, quarters the area to 31 mm² and halves the light. That is why ring markings step by √2 and each full stop is a factor-of-two exposure step (the F-number convention).

The definition assumes the object sits at infinity. Your part sits much closer, and that assumption is what fails — nearly every ordinary fixed-focal machine vision lens quotes its f/# at that infinite-conjugate condition.

The working f-number: what the sensor actually sees

At finite magnification the image-side cone slows by the factor (1 + m):

(f/#)w ≈ (1 + m) × f/# DOF ≈ 2 × (f/#)w × c / m² NA = 1 / (2 × (f/#)w)

Here m is image height over object height, which equals sensor width over field of view once the framing is set (how to read it from a calibration). The formula treats the lens as a single unit; real designs follow it within a few percent across the range machine vision uses.

Magnification m Working f/# from a f/2.8 dial Light lost vs the dial
0.1 f/3.1 1.2× (0.3 stop)
0.3 f/3.6 1.7× (0.7 stop)
0.5 f/4.2 2.25× (1.2 stops)
1.0 f/5.6 4× (2 stops)

Below 0.1x the correction is under a third of a stop, so ignore it. From 0.3x up it is most of a stop or more, and every exposure, focus and diffraction figure should be budgeted on (f/#)w from there.

Worked example: a 0.5x set-up on an f/2.8 dial

Take a 25 mm lens on a 2/3" camera (8.8 mm wide sensor) framing a 17.6 mm field of view, so m = 8.8 / 17.6 = 0.5, dial at f/2.8, white light at 550 nm.

  • Working f-number: (f/#)w = 1.5 × 2.8 = f/4.2.
  • Exposure: throughput falls with the square of the working f-number, (2.8 / 4.2)² = 0.44. The frame is 2.25× darker than the dial promised — 1.2 stops. A 1 ms budget becomes 2.25 ms, or you supply 2.25× the light.
  • Diffraction: the spot on the sensor is 2.44 × λ × (f/#)w = 2.44 × 0.55 μm × 4.2 = 5.6 μm (6.8 μm under 660 nm red light). Referred to the object through m = 0.5, that is 11.3 μm of smallest resolvable detail, against 7.6 μm if the dial value had been true.
  • Depth of field: with a 10 μm circle of confusion (about 3 pixels on a 3.45 μm camera), 2 × 4.2 × 0.01 / 0.25 = 0.34 mm. Closing the dial one stop to f/4, which works f/6.3, gives 2 × 6.3 × 0.01 / 0.25 = 0.50 mm.

Fixed-magnification lenses print m on the data sheet, so this whole chain becomes a lookup rather than a bench measurement: the LS-FFL-1023 is specified 0.5x at a 150 mm working distance, F13.4.

Machine vision lenses1/2" machine vision lens, 0.5x, WD 150 mm, F13.4 (LS-FFL-1023)LS-FFL-1023
Type
Machine vision fixed
Sensor format
1/2"
Image circle
Up to 8 mm
$249.00View partBuild a system with it

The three-way trade: light, focus, diffraction

Every working stop buys depth of field and costs light and resolution at once, which is why no single best aperture exists. Normalized to (f/#)w = 2.8 at 550 nm:

Working f/# NA Light vs f/2.8 Airy spot (550 nm) Depth of field
2.8 0.18 100% 3.8 μm 1×
4 0.13 49% 5.4 μm 1.4×
5.6 0.09 25% 7.5 μm 2×
8 0.06 12% 10.7 μm 2.9×
11 0.05 6.5% 14.8 μm 3.9×

The light column is what corners fast-belt and line-scan work into the fastest usable stop. The focus column is what saves applications with part-height variation. The Airy column is the quiet cost: past about two pixels of spot, edges lose contrast faster than focus range grows (contrast and resolution).

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.
Depth of field and diffraction
Units
Depth of field
– mm
About the focus plane
– mm
Diffraction limit
– F/#
Blur limit
– µm
Diffraction spot
– µm
At this F-number
–

DOF ≈ 2 × N × c × (1 + m) / m², c = allowed blur × pixel size. Diffraction spot (Airy disk) ≈ 2.44 × wavelength × N × (1 + m); past the diffraction limit it is larger than the blur you allowed.

Browse lenses by aperture and format Open the full calculator

The spot rule worth keeping: hold 2.44 × λ × (f/#)w at or below two pixels. On a 3.45 μm pixel that is a ceiling of 6.9 / 1.342 ≈ f/5.1 — work at f/5 or faster for clean edges, and stop down further only when focus range outranks the smallest defect. The diffraction limit in numbers, small pixel camera selection and when sharp previews mislead about focus cover each column of that trade in depth.

Numerical aperture: the same budget from the cone angle

f/# and numerical aperture describe one cone of light from two directions: NA = 1 / (2 × f/#). The worked example's working stop f/4.2 is NA = 1 / (2 × 4.2) = 0.12; the dial's f/2.8 corresponds to NA 0.18. A fast lens is a wide cone — short exposures, thin focus. Microscopy quotes NA in object space; machine vision inherited f-numbers from photography. When a discussion moves between the two conventions, convert through the working value, not the dial, or the comparison is off by the whole (1 + m) factor.

Choosing the working f-number: three cases

Exposure-limited (motion to freeze). Choose the fastest working stop your lighting supports and read the dial backwards: at m = 0.5 you need a dial f/2.8 to work f/4.2, and a lens whose dial bottoms out at f/4 only works f/6. If exposure then runs long, the fix is more light or a lower-f/# lens, not gain.

Depth-of-field-limited (part height varies). Size the stop from the height range: (f/#)w ≈ DOF × m² / (2c). For 0.50 mm of focus range at m = 0.5 with a 10 μm circle of confusion: (f/#)w = 0.5 × 0.25 / 0.02 = 6.3, which is a dial f/4.2 at this magnification.

Resolution-limited (small defects, small pixels). Hold (f/#)w ≤ 2p / (2.44 × λ). For 3.45 μm pixels the ceiling is f/5.1; for 2.5 μm pixels it drops to f/3.7, which at 0.5x means the dial cannot close past f/2.5 without softening the image.

Aperture range is then a selection criterion in its own right. The LS-FFL-0567 covers F2.8-22 with <0.3% distortion on a 1.1" sensor.

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

Across that dial span at 0.5x the working stops run from f/4.2 to f/33 — enough range to trade light for focus inside one lens, once you read it through (1 + m).

When the dial already is the working value

Two situations suspend the correction. Fixed-magnification lenses, telecentric or not, are specified and measured at their printed magnification, so the printed f/# is the working value: a lens printed 0.4x, F11 runs at about f/11 at its rated distance, not f/15. The LS-FFL-0914 is 0.3x at 168 mm WD, and the LS-TCL-0574 is 0.4x at 227 mm WD.

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"
$189.00View part
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
$2,269.00View part

The second situation is any set-up where m moves. Extension tubes push an ordinary lens into the high-magnification region where (f/#)w climbs steeply (extension tubes for close-up machine vision), and a floating working distance changes m from shot to shot, which is where autofocus optics or a refocus stage move the working stop for you (liquid lens autofocus for changing working distances). Recompute (f/#)w whenever the framing changes.

Checks before you order

  1. Write down m from field of view and sensor width; check it against a measured target where the part allows.
  2. Multiply the dial value by (1 + m) and carry that working f-number through every exposure, focus and diffraction calculation.
  3. Confirm 2.44 × λ × (f/#)w ≤ 2 × pixel size, or accept the focus-for-contrast trade deliberately.
  4. At 0.3x and above, shortlist a fixed-magnification lens beside the ordinary fixed-focal one: its printed f/# removes the guesswork.
  5. Re-run the numbers whenever the working distance moves, because m moves with it.

Focal length sets what you see (how to choose a machine vision lens focal length); the working f-number decides whether the image is usable. Size the chain in the lens finder or start at the lens step of the configurator; the lenses topic page gathers the rest of the optics guides. If light, focus and spot size will not close at once, send the field of view, sensor and part-height budget through the contact page and we will size the stop with you.

Questions

Why does my image get darker when I focus closer, even at the same f-stop?

The working f-number rises with magnification while the dial stays put. At 0.5x an f/2.8 dial acts as f/4.2, and throughput falls with the square of the working value, so the frame is about 2.25 times darker. Hold the exposure time and add illumination; extend it instead and motion blur, not the camera, becomes the limit.

Does the (1 + m) correction apply to fixed-magnification lenses?

No correction is needed there: those lenses are specified and measured at the printed magnification, so the printed f/# already is the working value. A lens rated 0.4x, F11 runs at about f/11 at its rated distance, not f/15. The (1 + m) factor belongs to ordinary fixed-focal lenses whose markings are defined at infinity and which you refocus far from it.

How much depth of field does one stop buy at 0.5x?

Depth of field scales with the working f-number at fixed magnification: DOF ≈ 2 × (f/#)w × c / m². With a 10 μm circle of confusion, working f/4.2 gives about 0.34 mm and working f/6.3 gives 0.50 mm. One working stop therefore buys roughly 50% more focus range at that magnification, paid for with half the light.

What working f-number can a 3.45 μm pixel camera take before diffraction softens it?

Keep the diffraction spot, 2.44 × 0.55 μm × (f/#)w, at or below about two pixels, which is 6.9 μm here. The ceiling works out to (f/#)w ≈ 5.1, so stay at working f/5 or faster for crisp edges. Under 660 nm red light the same ceiling tightens to about f/4.3, because the spot grows with wavelength.

Why do microscope objectives quote NA while machine vision lenses quote f/#?

They are two views of the same cone: NA = 1 / (2 × f/#) on the image side. f/2.8 is NA 0.18 and a working f/4.2 is NA 0.12. Microscope objectives specify NA in object space, which suits wide-cone, short-distance work; machine vision kept f-numbers from photography, where the dial sets exposure. Convert through the working f-number when comparing the two.