Lenses

Bringing it All into Focus: Finding the Right Lens for Your Vision System

A sharp image requires more than just a good camera - only the right lens ensures optimum image quality. Lenses differ not only in resolution, focal length, and size, but also in their design. In the following article, we will show you which lens is suitable for which situation.

What types of lenses are available - and what is important when choosing one?


Choosing the right lens is crucial for the performance of an image processing system. Several technical factors must be taken into account to ensure that the optics and sensor work together optimally - in particular: sensor size, resolution, focal length, and aperture value.

First, a brief overview of the most important lens types:
We are generally talking about entocentric or telecentric lenses, as well as wide-angle and fish-eye lenses. There are also special lenses for the near infrared.

In the following, we will focus on entocentric lenses, which are used in the majority of machine vision applications. They create a perspective image similar to the human eye: distant objects appear smaller, close ones larger. The human eye is itself an example of entocentric optics.

The following technical factors are decisive for the selection of a suitable lens:

  • Sensor size and image circle diameter

  • Resolution and pixel size

  • Focal length

  • Aperture opening and lighting conditions


What types of lenses are available?

1. Sensor size and image circle

Sensor size is a key factor in lens selection. High-resolution area scan and line scan cameras generally have larger sensors than cameras with a lower resolution. Their dimensions are not standardized, but result from the resolution and pixel size - theoretically almost any size is possible, depending on the budget. Sensor sizes are given in inches. However, 1 inch does not correspond to 25.4 mm, but to approximately 16 mm - a historically determined, industry-standard value.

Sensor size and image circle
Adapter ring to connect C-mount lenses to CS_mount cameras

1.1 Mount

The lens is attached to a camera connection that corresponds to a standard size and is referred to as a mount.

A C-mount, which is the most widely available type of mount for machine vision cameras, is appropriate for a sensor diagonal of approx. 20 mm – corresponding to 1.5 inches. For larger sensors, a F-mount or F-bayonet is generally used, though this type is seldom used in industrial applications. For these applications, CS- and S-mounts, which are suitable for cameras with smaller sensors, are more commonly used. S-mount lenses are used for a sensor size of 1/2″, 1/3″, or smaller. To mount a C-mount lens on a CS-mount camera, a 5 mm adapter ring is necessary. This procedure will not work the other way around: a CS-mount lens cannot be mounted on a C-mount camera.


Image circle diameter
The image circle is the circular area on the sensor that a lens can illuminate completely and evenly without significant loss of quality.

1.2 Image circle diameter

The mount of a lens or the mount size only allows limited conclusions to be drawn about the image circle - i.e. the sensor area that is exposed evenly and without edge shading (vignetting).

Like the sensor size, the image circle diameter is specified in inches. A 1/3″ C-mount lens is ideally suited to a camera with a 1/3″ sensor - the image circle is optimally utilized. With a larger sensor (e.g. 1/2″), the same lens would lead to vignetting.

If, on the other hand, a 2/3″ lens is used on a smaller 1/3″ sensor, there is no vignetting and the image sharpness remains high right to the edge - but a large part of the image circle remains unused. This is inefficient, as larger lenses are more expensive. A smaller lens is therefore usually more cost-effective for smaller sensors. The decisive factor is that the image circle diameter must correspond to the sensor size or be larger.


2. Resolution and pixel size

A high-resolution vision system not only requires a sensor with many megapixels, but also a lens that can actually reproduce this resolution. The resolution of a lens determines whether fine details remain visible - or are lost. In the following sections, you will learn why resolution and pixel size need to be considered together and how you can evaluate the performance of a lens.

The lens resolution is given in line pairs per millimeter (lp/mm).
The lens resolution is given in line pairs per millimeter (lp/mm).

Resolution and line pairs per millimeter

The resolution of a lens is specified in line pairs per millimeter (lp/mm). This value describes how many fine lines can still be clearly separated from each other in one millimeter. The higher this value, the sharper the detail depicted. A sensor can only exploit its full potential if the lens resolution is high enough.

Typical resolution test chart
Typical resolution test chart

MTF curves: Sharpness from the center to the edge

The MTF curve (modulation transfer function) can be used to display the resolution of a lens across the entire image field - from the center of the image to the edge. The curve is based on a test chart with black and white lines whose distance gets smaller and smaller. Manufacturers often provide MTF curves on request or in data sheets since they help to objectively evaluate the actual performance of a lens.

Resolution and pixel size

Pixel size and lens selection in practice

The resolution of the lens must match the pixel size of the sensor - only then will every pixel be in focus. With a 5 megapixel sensor, for example, you need a lens that can actually resolve these 5 MP. Some lenses indicate the supported sensor resolution directly in megapixels - this simplifies the selection process, but does not replace testing using technical data such as lp/mm or MTF curves. Only when sensor resolution and lens performance match can the full potential of an image processing system be exploited.

Side note: Megapixel

Many manufacturers of consumer cameras or smartphones advertise the especially high megapixel count of their devices. This suggests to the consumer that more megapixels means more resolution and produces the best image. But the high megapixel count doesn't in fact help if the lens does not fit. Good quality lenses are expensive, so many manufacturers try to save costs here. As an example, if a smartphone with a camera resolution of 20 MP already produces a blurry image, then a sensor with such a high pixel count will only enlarge the blur.

However, a compact camera with a 5 MP resolution and a high quality lens will produce noticeably sharper images, despite the purportedly lesser resolution.

For machine vision, sensors with resolutions of between VGA (0.3 MP) and 5 MP are generally offered. Higher resolutions would not make much sense, at least for C-mount cameras, because the individual pixel is much too small and the noise would be much too great to execute the demanding measuring and inspection tasks.

3. Interaction of focal length & sensor size

We designate the distance between the optical center of the lens and the focal point as the focal length. All the light rays of the parallel incident light intersect in the focal point. The focal length f of the lens is thereby dependent on the refractive power of the lenses and is expressed in millimeters.


Interaction of focal length & sensor size

Focal length and image effect

The larger the focal length, the larger the telephoto characteristics of the lens. The giant lenses that we may recognize from sports photographers and paparazzi clearly have larger focal lengths than the lenses of consumer cameras. Wide-angle and fish-eye lenses have correspondingly smaller focal lengths.

The focal length is determined by the sensor width, the object width, and the operating distance. Most lens suppliers offer calculation tools on their websites that allow you to calculate the focal length.


Example images for various focal lengths

The image comparison shows how the image section decreases and the zoom effect increases as the focal length increases - which is crucial for choosing the right lens. The focal length must always match the sensor size and the specific application setup.

How do I find the right lens - focal length
How do I find the right lens - focal length
How to find the right lens - focal length

4. Aperture & lighting conditions

The selection of the camera aperture has a direct impact on the image quality and the brightness. The F-number (or F-stop) is the ratio of the focal length over the diameter of the aperture and specifies how wide the aperture is opened.


Aperture & lighting conditions
A small F-number can increase the depth of field, but being stopped down too strongly leads to diffraction blur. Therefore, you should find a good compromise.

F-number and image quality

A high F-number means a smaller aperture - less light falls on the sensor. A wide-open aperture is advantageous in low light conditions, as more light is let through.

Smaller apertures increase the depth of field and reduce aberrations such as vignetting, but can lead to diffraction blurring. This is caused by light diffraction at the edge of the aperture and reduces the image quality.

Each lens therefore has an optimum F-number - as a compromise between maximum depth of field and minimum diffraction.

Conclusion: Select the aperture so that it matches the lighting situation of your application - neither too wide nor too stopped down.

Checklist for lens selection

Before deciding on a lens, check the following points:

  • Lens mount: Is the mount of the lens (e.g. C-mount) compatible with your camera?

  • Resolution: Does the lens resolution correspond to the sensor resolution so that all details are in focus?

  • Focal length: Does the focal length match the sensor size and the desired image section of your application?

  • Image circle: Does the image circle diameter cover the entire sensor - without vignetting?

  • Aperture: Is the light intensity (aperture) sufficient for your ambient brightness?


Our lenses & matching accessories

Take advantage of our broad portfolio and choose the right product for your vision system. Our lens selector helps you easily choose the right lens for your overall system.

How can we support you?

We will be happy to advise you on product selection and find the right solution for your application.