Every machine vision course ends the same way: a stack of theory about sensor formats, MTF curves and lighting geometry, and then a real part on a real bench that needs a camera, a lens, a light and a controller ordered by Friday. The bridge between the two is an order of decisions and the arithmetic that connects them. This guide walks that order once, on one stamped bracket, and shows every number from field of view to exposure time, so you can repeat it on your own part.
What do you choose first: camera, lens or light?
Fix the field of view and the smallest feature size first: those two numbers decide the pixel count, the sensor and the focal length together, and the light follows from the part's surface and the exposure you can afford.
Buying the camera first is the common mistake. A camera fixes a sensor and a mount, but until the field of view is fixed you cannot know whether its pixels land where the part needs them. You then end up bending the optics around a sensor that was never sized for the task. The light comes last in the selection order but first in debugging: most images blamed on the camera are lighting problems. If you want the same reasoning run as bench experiments, machine vision lens and lighting selection: a test plan lays out the sequence, and stable 2D vision inspection systems shows why light and exposure are settled before any algorithm.
The running example for the rest of this guide: a 70 mm stamped bracket presented within ±5 mm, passing the camera at 50 mm/s, with a 0.2 mm scratch as the smallest feature that must be detected. There is 300 mm of bench room in front of the part.
How do you calculate field of view and focal length?
Magnification is sensor width divided by field of view, and f = WD × m / (1 + m) turns that into a focal length: with an 8.4 mm sensor width at 300 mm, a 92 mm field needs a 25 mm lens.
The example needs 70 mm of part plus 2 × 5 mm of wander, so 80 mm minimum. On a 5 MP camera of the classic 2/3 in class — 2448 × 2048 pixels on a 3.45 µm pitch, an 8.4 mm active width — the required magnification is m = 8.4 / 80 = 0.105, and the focal length is f = 300 × 0.105 / 1.105 = 28.5 mm. Stock focal lengths step at 25 mm and 35 mm.
The 25 mm choice keeps the 300 mm working distance and delivers FOV = 8.4 × (300 − 25) / 25 = 92.4 mm. The 80 mm requirement is met with 12 mm of margin, which is not waste: calibration targets and undistortion crop eat the edges, as calibration target field of view and lens coverage margins shows.
The same lens frames different widths on different sensors, because field of view scales with sensor width at a fixed focal length and distance:
| Sensor format | Typical active width | Field with a 25 mm lens at 300 mm |
|---|---|---|
| 1/2 in | 6.4 mm | 70 mm |
| 1/1.8 in | 7.2 mm | 79 mm |
| 2/3 in | 8.8 mm | 97 mm |
Format names are fine for early sizing; the 5 MP sensor above has 8.4 mm of active width and therefore frames 92 mm, so run the final number on the active width, not the format. The thin-lens formula itself is an estimate — it measures working distance to a principal plane inside the lens — so expect a few percent and plan focus travel. The lens focal length calculator runs all three equations in both directions, and blister inspection working distance and field of view applies the same formula to a real inspection layout.
The lens family then has two hard constraints: the image circle must cover the sensor diagonal, and the lens's resolution class must meet the sensor's pixel pitch. In the lens finder that is the C-mount, 2/3 in, 6-10 MP, 25-50 mm filter stack — dozens of lenses that all do this job. Two ends of that class, at 8 mm and 35 mm:
| Specification | LS-FFL-0679 | LS-FFL-1582 |
|---|---|---|
| Resolution | 6.0 Megapixel (2.4 μm pixel size) | 10 MP |
| Focal length | 35 mm | 8 mm |
| Aperture | F2.8 Manual iris | 1:2.8~16 |
| Price | $219.00 | $309.00 |
All 2 share: Mount C-mount. Values as printed in each product's data sheet; open a part for its drawing and full specifications.
When your bench has 368 mm of room instead of 300 mm, a 35 mm lens frames the same 80 mm field (8.4 × 333 / 35 = 80 mm) and puts 6.1 pixels on the scratch (80 / 2448 = 0.033 mm per pixel; 0.2 / 0.033 = 6.1) — the same task bought with bench distance instead of pixels. For that route:
- Type
- Machine vision fixed
- Sensor format
- 2/3"
- Mount
- C-mount
- Resolution
- 6-10 MP
How many pixels do you need on the smallest feature?
Four pixels across the smallest feature for detection and five for measurement; two is the Nyquist floor you never design to: a 0.2 mm scratch at four pixels sets 0.05 mm per object pixel as the limit.
Pixels required across the field: 92.4 / 0.05 = 1848. The 2448-pixel sensor delivers 92.4 / 2448 = 0.038 mm per pixel, so the scratch spans 0.2 / 0.038 = 5.3 pixels — detection with margin. Cross-check the other way: object pixel = pixel pitch ÷ magnification = 3.45 µm / 0.091 = 0.038 mm. Two routes, one number: that agreement is the check that lens, sensor and distance belong together.
When the pixel count runs out, pull three levers in order: a longer lens for a smaller field (free pixels, same sensor), a camera with more pixels, then a finer pixel pitch. The camera resolution calculator does the division. The third lever is the weakest — small pixels collect less light each, and small pixel camera selection covers where usable detail stops following the pixel count.
In the camera finder the example's class appears as a GigE mono camera with a rolling shutter:
- Sensor format
- 1/1.8"
- Lens mount
- C-mount
- Interface
- GigE
- Resolution
- 6-10 MP
Rolling shutter is fine on an indexed station where the part stops; for the 50 mm/s conveyor here, filter shutter: Global. When the field cannot shrink and the feature is finer, step the sensor format up: a 1 in sensor carries roughly twice the linear pixel count of the 5 MP part in this example, and it needs a lens from the 16-22 mm image circle class — the pairing the checks at the end of this guide catch. The USB3.0 mono option in that class:
- Sensor format
- 1"
- Lens mount
- C-mount
- Interface
- USB3
- Resolution
- 16-25 MP
How much depth of field does the f-number buy?
Depth of field is 2 × N × c × (1 + m) / m², and at the example's 0.091 magnification with a two-pixel blur circle each f-stop buys about 1.8 mm, so f/5.6 gives roughly 10 mm.
With c = 2 × 3.45 µm = 6.9 µm and m = 0.091: (1 + 0.091) / 0.091² = 132, so DOF = 2 × 0.0069 × 132 × N = 1.8 × N mm. The bracket varies ±3 mm in height, 6 mm total; f/5.6 gives 10.2 mm and covers it, and even f/4 at 7.3 mm would pass. Depth of field is not yet the constraint — but it collapses with the square of magnification. At m = 0.36, a 25 mm field on the same sensor, the sum gives 0.145 × N mm and f/8 buys only 1.2 mm. That is the point where part height starts dictating the f-number, and working f-number and magnification becomes the controlling discussion. The depth of field calculator runs the numbers.
Each stop also costs light: f/5.6 against f/2.8 passes (5.6 / 2.8)² = 4 times less. The next section caps exposure, so the missing light has to come from the light itself — more output or a strobe — and not from gain, which trades the pixels you just bought for noise. LED overdrive and current control covers driving a light hard inside its ratings.
Which light geometry should you start with?
Start with a diffused ring light around the lens axis for matte parts, move to a dome when the surface is shiny and curved, and drop to low-angle dark field when edges and scratches must glow; geometry decides contrast, brightness only scales it.
A ring light's angle at the part comes from its diameter and its distance: half-angle = atan(d / 2 ÷ WD) = atan(51.5 / 300) ≈ 9.7° for a 103 mm ring at 300 mm — soft, mostly axial bright field, right for a matte bracket. Move the same ring in to 100 mm and the angle opens to atan(51.5 / 100) = 27°, which starts sculpting the surface.
A 103 mm ring light with a 48 mm inner diameter for C-mount barrels, running on 24 V:
- Size
- 100-200 mm
- Type
- Standard
- Angle
- Low angle (0-15°), 50°, 65°, 70°, 75°, 80°, 85°
- Voltage
- 24 V
Then specialize by surface: shiny curved parts get a dome, as in lighting shiny metal pins without glare; flat specular parts get crossed polarizers, per cross polarization in machine vision; scratches on flat parts get low-angle dark field. The full menu — bright field, dark field, dome, axial — with part examples is in lighting geometry for image contrast. The light finder also offers UV rings at 365 nm and 405 nm for fluorescence and surface work: that output is invisible and does not trigger the blink reflex, so shield the station and wear rated eye protection whenever it runs.
How do exposure and triggering close the timing loop?
Exposure is capped by motion blur, not brightness: object pixel ÷ part speed = 0.038 mm ÷ 50 mm/s = 0.76 ms, so set 0.5 ms with continuous light, or strobe the light for tens of microseconds and stop the part in the image.
The camera then needs one frame per part. A station triggering on a photosensor or a PLC signal runs a few frames per second, which every camera in these classes clears comfortably, so bandwidth is rarely the issue at 5 MP. What does need wiring discipline is timing: the strobe must land inside the exposure — camera strobe output to light-controller input — and the PLC arms the sequence. For the controller and PLC side of that handoff, machine vision triggering over PLC I/O covers the input and output options.
When is this order the wrong order?
Above roughly 0.2× magnification, under changing working distance, or with a part that never stops, the fixed-focal-length path stops fitting, and you switch families: telecentric for measurement, autofocus for moving distances, line scan for continuous material.
- Dimensional measurement: perspective error scales with part distance and cannot be calibrated away for parts at varying height. Object-side telecentric lenses — the telecentric filter in the lens finder — image the same size across their depth of field, and they are specified by magnification, so the object-space pixel is a catalog number rather than a calculation.
- Working distance that changes part to part: a liquid-lens autofocus unit refocuses in milliseconds; see liquid lens autofocus for changing working distances.
- Continuous web or an unpause conveyor: line scan builds the image line by line; start at line scan camera field of view.
- Fields beyond about 300 mm: the optics stay easy and the lighting does not; the balance in large field of view lighting becomes the design problem.
What should you check before ordering?
Run these checks against your worked numbers before anything goes in the cart — field, pixels, coverage, distance, depth, light, timing and mounts. Ten minutes here catches the mistakes that cost weeks on the bench.
- Field of view with margin — part plus wander plus about 10% for calibration targets and undistortion crop; here 92.4 mm delivered against an 80 mm need.
- Pixels on the feature at the real field — 5.3 pixels on the 0.2 mm scratch; four is the floor for detection, five for measurement.
- Image circle ≥ sensor diagonal — an 11 mm circle cannot cover a 1 in sensor, and corner vignetting does not calibrate out cheaply.
- Lens resolution class ≥ sensor — a 6-10 MP lens behind a 5 MP sensor; the reasoning is in Nyquist limit and camera resolution.
- Working distance with focus travel — the thin-lens estimate plus lens barrel, mount and light clearance inside your 300 mm.
- Depth of field ≥ part height range at the chosen f-number, and exposure still inside the blur cap with the light that f-number leaves you.
- Light geometry and size — a ring matched to the field, or the dome or dark-field variant the surface demands, plus the controller channel to drive it.
- Trigger, frame rate, interface and mounts — one frame per part, strobe inside exposure, cable length inside the interface's reach, and any mount adapters on order with the lens; C mount vs CS mount if both types live in your spares box.
With the numbers written down, the system configurator walks the same order — camera, lens, light, controller — and checks the pairings, and the contact page reaches the applications team for whatever the arithmetic leaves open.
Questions
Does a bigger sensor always buy a better inspection?
Not by itself. At the same field of view a larger sensor runs at lower magnification, which adds depth of field and relaxes the demand on the lens. The costs are a lens with a matching image circle and a larger, sometimes slower readout. A small sensor behind a sharp, well-matched lens routinely out-resolves a large sensor behind a lens that never covers it.
Can a zoom or varifocal lens replace doing the math?
It can cover several fields of view during bring-up, and that is exactly when to use one. Once the field is fixed, swap to a fixed focal length: zooms carry more distortion, their focal length drifts when the ring is bumped, and contrast at any setting is lower than a matched prime. Do the math, then lock the focal length.
When does the focal length formula stop being accurate?
The formula assumes a thin lens, so working distance is measured to a principal plane you cannot see. Beyond about ten focal lengths the error is a few percent and bench focusing hides it. Below about ten focal lengths, roughly 250 mm for a 25 mm lens, the offset becomes a real fraction of the distance, and fixed-magnification or macro lenses, specified by magnification rather than focal length, are the cleaner route.
What lighting change fixes a shiny, curved part?
Change the geometry before the intensity. A diffuse dome surrounds the part with light from every direction and removes the moving highlight; cross-polarization removes the remaining specular glare at the cost of light level; low-angle dark field turns scratches and edges into bright lines on a dark background. Raising exposure only pushes the highlight further into clipping.
How do you choose the light controller?
Match channels to lights first: one channel per independently timed light. Then match current: continuous operation at the rated drive, and strobed overdrive held inside the light's duty-cycle rating. Trigger the controller from the camera's strobe output so the flash lands inside every exposure, and let the PLC arm the sequence. A controller sized this way keeps brightness stable as the LEDs age.



