Zu Content springen
Machine Vision Embedded Vision Hardware Engineering

Choosing the right lens for your vision application

Michael Gilge, Embedded Vision Expert
Michael Gilge, Embedded Vision Expert

In nearly every vision project we work on at PCB Arts, the optics receive less engineering attention than the sensor or the inference pipeline  and yet the lens defines what your sensor can actually see. A 12 MP sensor behind a poorly matched lens delivers the same usable image as a 2 MP sensor. A correctly chosen lens, by contrast, can quietly carry a project across challenging lighting, motion, and environmental conditions without anyone noticing it was ever a risk.

This guide walks through the criteria we apply internally before specifying optics. Embedded vision, automotive ADAS, industrial inspection, and outdoor surveillance all draw from the same toolkit  even if the priorities differ. It is intentionally technical and intentionally ordered: most lens-selection mistakes come from picking a focal length first and only later discovering that the image circle is too small or the MTF cannot resolve the sensor.

1. Start at the Sensor: Image Circle and Sensor Format

Lenses project a circular image. Your sensor crops a rectangle from that circle. The first compatibility check is therefore not focal length, not aperture. It is whether the lens projects an image circle that fully covers the sensor diagonal.

Format

Diagonal

Typical Use

1/4"

4.0 mm

Compact embedded cameras

1/3"

6.0 mm

Automotive, surveillance

1/2.5"

7.2 mm

Embedded vision

1/2"

8.0 mm

Industrial cameras

1/1.8"

8.9 mm

Higher-end industrial

2/3"

11.0 mm

Industrial inspection

1"

16.0 mm

High-resolution industrial

4/3"

21.6 mm

Very high-res, large pixel pitch

 

The rule is simple: lens image circle must be ≥ sensor diagonal. Undersizing causes vignetting, a gradual darkening toward the corners of the image, or in severe cases a hard black ring. Vignetting is not always visible to the human eye in bright conditions, but it becomes a pipeline problem the moment you have a CNN or classical vision algorithm that expects uniform illumination across the frame. Oversizing (using a lens with a much larger image circle than needed) is generally safe, though it can be wasteful in size and cost since you only use the centre sweet spot of the optical design. If the image circle is not listed explicitly in the data sheet, treat that as a yellow flag in itself.

2. Mount Standards: S-Mount, C-Mount, CS-Mount

The mount determines the mechanical interface, the flange focal distance (FFD), and indirectly the size and weight class of the lens.

S-Mount (M12 × 0.5) is the standard for board-level and embedded cameras. The lens threads directly into a small holder, secured with a grub screw, and covers sensor formats up to about 1/1.8". The FFD is not rigidly standardised, focus is set by screwing in or out and locking in place. The S-Mount ecosystem is large due to automotive and security supply chains: compact, low cost, broad selection, and nearly all serious vendors offer day-and-night variants. This is the dominant mount for embedded edge AI cameras, automotive ADAS development cameras, and most GMSL2 sensor modules.

C-Mount (1"-32 UN, FFD 17.526 mm) is the industrial workhorse. Larger and heavier than S-Mount, but optical designs scale to 1" and 4/3" sensors and give access to the full machine-vision lens market: telecentric, fixed-focal, varifocal, and high-MTF lenses with calibrated distortion data. Choose C-Mount when you need precision, mechanical repeatability, or sensors above 1/1.8".

CS-Mount (1"-32 UN, FFD 12.5 mm) uses the same thread as C-Mount but a 5 mm shorter flange focal distance. A C-Mount lens can be adapted to CS-Mount with a 5 mm spacer ring; the reverse is not possible. Common in surveillance equipment, less so in modern industrial systems.

Rule of thumb: S-Mount for compact, cost-sensitive, embedded systems; C-Mount for industrial precision and larger sensors.

3. Focal Length and Field of View

Once the mount and image circle are settled, focal length determines the field of view (FoV) at a given working distance. The relationship follows a simple geometric formula:

FoV (horizontal) = 2 × arctan(sensor width / (2 × focal length))

For example: a 6 mm lens on a 1/3" sensor (4.8 mm horizontal) at 1 m working distance yields approximately 44° horizontal FoV  equivalent to a 12 mm lens on a 2/3" sensor (8.8 mm horizontal). Two implications worth pinning to your wall:

  • Sensor size affects FoV at the same focal length. Copying focal lengths from one project to the next without re-evaluating the sensor is a recurring source of bugs.
  • Working distance matters more than people think. In a fixed-mount installation ADAS bracket, inspection station, traffic camera replacing the lens after the mechanical design is frozen is expensive. Always validate FoV against actual installation geometry including tolerances, not a desk estimate.
  • Exposure time at a given illumination level. A one-stop-faster lens (f/1.4 vs f/2.0) doubles the light and halves the required exposure. For automotive cameras at 30+ fps in mixed lighting, this is often the difference between a sharp frame and motion blur.
  • Signal-to-noise ratio at a given frame rate. Critical for low-light surveillance and any AI pipeline whose accuracy degrades on noisy frames. SNR loss is rarely visible to the human eye until well after a CNN has started misclassifying.
  • Depth-of-field budget. A f/1.4 lens has a tight DoF,  fine for a fixed inspection distance, problematic for objects moving in Z. DoF scales roughly with f-number; the trade-off between light and DoF is direct and often painful.
  • 24/7 outdoor cameras security, traffic enforcement, industrial perimeter monitoring running with active NIR illumination at night and ambient visible light by day.
  • Automotive ADAS, surround-view, and driver-monitoring cameras, which operate across mixed lighting and often combine visible imaging with NIR functions.
  • Industrial inspection using NIR for material discrimination: moisture detection in food, plastic-type identification for sorting, inspection through certain inks and coatings, vein imaging in medtech.
  • Axial (longitudinal) chromatic aberration: different wavelengths focus at slightly different distances along the optical axis. Red and blue channels are in focus at marginally different Z positions. The result in a colour image is colour fringing at high-contrast edges a red or cyan halo  and a loss of sharpness in at least one colour channel.
  • Lateral (transverse) chromatic aberration: different wavelengths arrive at slightly different heights on the sensor plane. This causes colour channels to be magnified differently, producing colour fringing that increases toward the corners and cannot be fixed by refocusing.
  • CNN-based pipelines: colour fringing at edges introduces spurious colour gradients that are not present in the scene. Depending on how the network was trained, these can generate false features and degrade classification accuracy, particularly at object boundaries.
  • Colour measurement and grading applications: lateral chromatic aberration shifts colour channels spatially, causing measured colour to depend on position in the frame. This is largely invisible to a human reviewer but corrupts quantitative colour analysis.
  • Stereo and multi-camera rigs: if chromatic aberration differs between lenses (even of the same type), colour-based matching across cameras becomes unreliable.
  • Sensor format → minimum image circle. Eliminates two-thirds of the catalogue immediately. Check for vignetting at corners.
  • Working distance + required FoV → focal length. Validate against actual mechanical installation with tolerances. Use the formula: FoV = 2 × arctan(sensor width / (2 × f)).
  • Pixel pitch → MTF requirement. Match the lens resolution rating to the sensor's Nyquist frequency, with margin. Do not rely on megapixel count alone.
  • Lighting conditions → f-number, T-number, day-and-night requirement. The worst-case low-light scenario drives this, not the typical case. Request transmission curves for noise-limited applications.
  • Colour sensor → chromatic aberration specification. For colour cameras and AI pipelines, check per-channel MTF curves and ask about APO correction. Monochrome sensors can skip this step.
  • Mechanical and environmental constraints → mount, size, locking screws, IP rating, temperature, vibration. For embedded and outdoor projects, this often inverts the priority list.
  • Distortion tolerance → standard, low-distortion, or telecentric. Telecentric lenses maintain constant magnification across the working distance range and are essential for dimensional measurement and gauging. Low-distortion machine-vision lenses suffice for most other metrology applications. Barcode reading and lane detection sit in between.
  • Cost and supply chain → final pass. Confirm the lens has a supply roadmap and a second source, especially for series production.

For wide-angle lenses (≤ 4 mm on a 1/3" sensor), geometric distortion becomes significant. If straight lines must stay straight barcode reading, dimensional measurement, lane detection you need either a low-distortion machine-vision lens or a software calibration step. The engineering time for calibration often exceeds the cost delta of the better lens.

4. Aperture, Light Gathering, and the T-Number

The f-number describes how wide a lens opens relative to its focal length: f/1.4 means a wide aperture with more light and shallower depth of field; f/8 means a narrow aperture with less light, more depth of field, and often better corner sharpness.

In machine-vision contexts, light-gathering capacity drives three things:

The f-number is purely geometric. It describes the aperture diameter relative to focal length. The actual transmitted light is described by the T-number (Transmission number), which accounts for internal reflections and coating losses. A nominally fast f/1.4 lens with poor anti-reflection coatings can transmit light equivalent to an f/1.8 or even f/2.0 lens. In low-light or noise-limited applications, ask the vendor for spectral transmission curves and T-number data rather than relying on the f-number alone.

Vignetting also worsens at extreme apertures, causing a measurable roll-off in corner brightness,  typically expressed in EV or as a percentage of centre brightness. A lens that shows –2 EV at the corners wide open may be acceptable for surveillance but will corrupt any pipeline that relies on photometric uniformity across the frame.

5. Resolution: Matching MTF to Pixel Pitch

A "5MP-rated" lens is one whose Modulation Transfer Function (MTF) sustains acceptable contrast at the spatial frequency that a sensor's pixel pitch demands. MTF describes how faithfully a lens reproduces contrast at progressively finer spatial frequencies, measured in line pairs per millimetre (lp/mm). At the Nyquist limit of the sensor, a lens must still deliver sufficient contrast to feed pixel-level information into the silicon.

The rule of thumb: a lens needs to resolve detail at approximately half the pixel pitch to deliver pixel-level resolution. The smaller the pixels, the harder the optical job:

Sensor / Pixel

Pixel Pitch

Required Resolution

Sony IMX477

1.55 µm

~320 lp/mm

Sony IMX390 (automotive)

3.0 µm

~165 lp/mm

Typical 5.5 µm industrial

5.5 µm

~90 lp/mm

Typical 10 µm industrial

10.0 µm

~50 lp/mm

A lens whose MTF drops to near-zero contrast at the sensor's Nyquist frequency cannot deliver pixel-level resolution  your effective resolution is bounded by the optics, not the sensor. We have seen projects where replacing a generic S-Mount lens with a properly MTF-matched alternative recovered full sensor resolution with no other change.

Important: when a vendor specifies "X megapixels" on a lens, always verify what pixel pitch and sensor format that rating assumes. The same nominal "5 MP lens" can be excellent on a 1/2.5" sensor (2.0 µm pixels) and inadequate on a 1/1.8" sensor at the same megapixel count but smaller pixels and higher Nyquist frequency. Same count, harder problem.

 

6. Day-and-Night Lenses: Focus Stability Across Visible and NIR

Standard machine-vision lenses are designed for visible light (400–700 nm). Their refractive index varies with wavelength (chromatic dispersion), so when you remove the IR-cut filter or use NIR illuminators at 850 nm or 940 nm the focal point shifts along the optical axis. The result: an image that is sharp in daylight but soft at night, or vice versa, with no good mechanical solution short of refocusing.

Day-and-night lenses (also called IR-corrected lenses) use glass formulations and element designs that maintain a stable focal plane across visible and NIR wavelengths. This matters in three scenarios:

A frequent and costly confusion: pairing a day-and-night lens with a sensor that has an aggressive IR-cut filter integrated in the cover glass provides no advantage. The lens transmits NIR, but the sensor blocks it before it reaches the silicon. Always confirm both sides of the optical chain.

7. Chromatic Aberration: The Colour Camera Trap

This section is less commonly covered in lens-selection guides, but it matters the moment you move from monochrome to colour sensors or to multi-spectral pipelines.

Lenses exhibit two types of chromatic aberration:

For monochrome sensors, chromatic aberration is largely irrelevant you're working with a single effective wavelength (or a narrow-band illumination). For colour cameras, both aberrations degrade sharpness and colour accuracy. The practical consequences:

High-quality machine-vision lenses correct for chromatic aberration using apochromatic (APO) or fluorite-element designs. These bring red, green, and blue into a common focal plane and minimise lateral shift. The performance difference between a consumer S-Mount lens and an APO-corrected industrial lens can be dramatic on small pixels, particularly at full aperture and toward the sensor corners.

When evaluating lenses for colour applications, ask the vendor for on-axis and off-axis MTF curves measured independently for red, green, and blue channels. A lens that shows good on-axis MTF but diverging R/G/B curves toward the corners is not suitable for demanding colour or AI applications.

8. Practical Decision Checklist

When specifying a lens, work through these steps in order. Doing them out of order is the most common cause of rework:

If any single step pushes the project into a different mount or sensor category, it is far better to discover that on day two than after a PCB has been routed around the wrong camera module.

A final thought. Optics behave like power supplies in electronic design: when they are right, nobody notices; when they are wrong, every engineering decision downstream suffers. A thirty-minute review of these eight points at the start of a project routinely saves days of debugging later.

If you would like a sanity check on a lens decision for a project you are working on, get in touch. We are happy to take a look.

 

Diesen Beitrag teilen