Focal Length in Machine Vision

Focal length is the lens parameter that most directly determines the camera's field of view. Change the focal length and the field of view changes. Changing the focal length changes the field of view. Achieving the required field of view with a different focal length often requires changing the working distance, which also affects magnification and depth of field. Understanding these relationships allows engineers to make deliberate lens choices rather than iterating through trial and error on the production floor.

What Focal Length Controls

A shorter focal length provides a wider field of view, while a longer focal length provides a narrower field of view with greater magnification. In practical terms, this means:

A 12 mm lens on a 1/1.8" camera (7.2 mm sensor width) positioned 400 mm from the object produces a horizontal field of view of approximately 240 mm. A 50 mm lens in the same position produces a field of view of approximately 58 mm. The object occupies a larger portion of the image with the 50 mm lens, but the camera captures a much smaller area.

This relationship is linear. For most machine vision applications, this relationship is approximately linear. Doubling the focal length roughly halves the field of view at a given working distance or requires approximately twice the working distance to maintain the same field of view.

The Three-Way Relationship: Focal Length, Field of View, and Working Distance

For a given sensor size, focal length, field of view, and working distance are linked by a fixed geometric relationship. For any two of these values, the third is determined. The Imaging Source Lens Calculator provides an interactive tool for working through these calculations for specific camera and sensor combinations.

The practical implications for system design:

Scenario

What Changes

What to Adjust

Object is larger than current FOV

Need wider FOV

Use shorter focal length, or increase working distance

Object detail is too small to resolve

Need higher magnification (narrower FOV)

Use longer focal length, or reduce working distance

Working distance is fixed by the enclosure

Working distance is fixed

Select focal length to match the required FOV at that distance

Working distance must increase (hot, hazardous, or obstructed environments)

Longer WD required

Use longer focal length to maintain required FOV

The final scenario is common in industrial machine vision applications. In applications where the camera cannot be positioned close to the object (near furnaces, inside inspection cells with moving parts, or in environments with contamination risk), a longer focal length lens allows the camera to be mounted at a safe distance while maintaining the required field of view.

Short vs. Long Focal Length: Design Tradeoffs

No focal length is inherently better. The choice depends on what the application requires.

Short focal lengths (6-16 mm) produce wide fields of view and are commonly used when a wide field of view or short working distance is required. They require less physical space in the system but are generally more susceptible to geometric distortion at the image edges, particularly in lower-cost lens designs. For applications where edge-to-edge dimensional measurement accuracy is required, this distortion becomes relevant. Short focal lengths are common in conveyor-line inspection, packaging verification, and embedded vision where the camera is integrated close to the scene.

Long focal lengths (25-75 mm and above) produce narrower fields of view with higher magnification. Longer focal length lenses are often available with very low distortion and are commonly used in measurement applications. Metrology applications typically use longer focal lengths together with low-distortion optics to achieve accurate measurements. Long focal lengths are also preferred when the camera must be kept physically separated from the object or when imaging through a window or aperture.

The values in the table below are representative because the required working distance depends heavily on the desired field of view and the image sensor size.

Focal Length Range

Typical Working Distance

Field of View

Typical Lens Distortion

Common Applications

6-12 mm

100-300 mm

Wide

Higher

Embedded vision, packaging, short-range conveyor inspection

16-25 mm

200-600 mm

Medium

Moderate

General industrial inspection, AOI, robot guidance

35-50 mm

400-1000 mm

Narrow

Lower

Metrology, component measurement, hazardous environments

75 mm and above

800 mm+

Very narrow

Very low

High-magnification inspection, remote inspection, precision gauging

Focal Length and Depth of Field

Focal length influences depth of field, but the relationship is less direct than it appears. At a constant working distance, a shorter focal length produces greater depth of field. At a constant field of view, however, depth of field is mainly governed by the aperture (f-number) rather than focal length, because maintaining the same field of view with a different focal length requires a corresponding change in working distance.

For machine vision applications where the field of view is fixed by the inspection requirement, the aperture is the more useful parameter for controlling depth of field. A higher f-number increases depth of field but reduces the light reaching the sensor, which typically requires more powerful illumination. A starting point of f/5.6 to f/8 is appropriate for many factory inspection applications with adequate lighting.

Where an application involves significant height variation in the inspected object (parts that are not perfectly flat on the conveyor, or three-dimensional assemblies), a combination of a shorter focal length and a smaller aperture generally provides greater depth of field. The tradeoff is that shorter focal lengths are generally more susceptible to geometric distortion, particularly in lower-cost lens designs so this approach is more appropriate for presence/absence and cosmetic inspection than for dimensional measurement.

Selecting Focal Length for The Imaging Source Cameras

The Imaging Source Lens Calculator matches focal length recommendations to specific camera models based on sensor dimensions, working distance, and field of view requirements. For C-mount cameras in the 33 and 38 Series, the C-Pro Series (6-20 MP) and C-Ultra Series (6-45 MP) cover a wide range of focal length requirements. For board-level and MIPI cameras using M12 optics, the S-Pro and S-Ultra Series provide matched compact lenses.

For close-up inspection tasks with short working distances and small fields of view, the Macro Series provides fixed-focus C-mount lenses designed for high magnification with low distortion across the full frame.

Frequently asked questions

No. Focal length determines field of view and working distance, not optical quality. A well-designed short focal length lens can resolve more detail than a poorly designed long focal length lens. Optical quality is determined by the lens design and manufacturing standard. For high-resolution sensors and applications requiring low distortion, The Imaging Source C-Ultra and S-Ultra series are appropriate regardless of focal length.

The required field of view and working distance determine the focal length, not the other way around. Use the Imaging Source Lens Calculator to identify the calculated focal length from your application parameters, then select the nearest available standard focal length. Standard machine vision focal lengths are typically available at 6, 8, 12, 16, 25, 35, 50, and 75 mm. For detailed guidance on the full selection process, see How to Choose a Lens for Machine Vision.

No. Adjusting focus moves the focal plane closer to or further from the camera but does not change the field of view. The field of view for a given lens and sensor combination is determined by the focal length and the working distance. A zoom lens changes focal length mechanically, which does change the field of view. Fixed focal length lenses cannot be adjusted for field of view.

At very short focal lengths, geometric distortion increases significantly. Straight lines in the scene appear curved in the image, which makes dimensional measurement unreliable. Very short focal lengths also require the camera to be positioned extremely close to the object, which can create practical problems with lighting, physical clearance, and contamination. For applications requiring a wide field of view at close range, a wider sensor format combined with a moderate focal length is typically a better approach than an extreme short focal length lens.

Glossary