# Lens Selection Based on Resolution - Advanced

This is Section 7.7 of the Imaging Resource Guide

Once the focal length (or magnification, if using a fixed magnification optic) of a lens has been chosen using How to Choose a Variable Magnification Lens or How to Choose a Fixed Magnification Lens, the modulation transfer function (MTF) curve of the lens can be referenced to determine what the limiting system resolution is (for more information on defining resolution, contrast, and MTF, see Resolution, Object Space Resolution, Contrast, Lens Performance Curves and Modulation Transfer Function (MTF) and MTF curves. The MTF of a lens varies based on several factors: working distance, sensor size, f/#, and wavelength. Lens suppliers are able to provide bespoke MTF curves based on how the lens is used. For example, Figure 1 shows two different MTF curves of the same 25mm fixed focal length lens at the same working distance (providing a magnification of 0.76X), but different f/#s and wavelength ranges. They hardly look like the same lens! The important takeaway is that just looking at MTF curves on specification sheets will not adequately explain the performance of a lens everywhere throughout its range, and specific curves are a necessity. ##### Figure 1: A high resolution 25mm lens’s MTF at different settings, reinforcing the importance of comparing the specific lens curves.

Based on the MTF of a given lens, the minimum resolvable feature size in object space can be determined. However, MTF curves are always in image space, which means the image space information must be transformed into object space information. Luckily, this is as simple as scaling by the magnification. The following example illustrates how to complete these calculations using the curves in Figure 1 as a starting point. Assuming a contrast minimum of 20% for this example, the lens on the left can resolve 250 lp/mm in image space, which is determined by finding the frequency on the curve that matches 20% contrast. Using Equation 1, the pixel size (or in this case, the image space resolution converted from a frequency to a physical object) is calculated to be:

(1)$$\text{Image Space Resolution} = 250 \tfrac{\text{lp}}{\text{mm}} = \frac{1000 \tfrac{ \large{\unicode[arial]{x03BC}} \text{m}}{\text{mm}}}{2 \, \times \, \text{Pixel Size} \left[ \large{\unicode[arial]{x03BC}} \text{m} \right]} \therefore \, \textbf{Pixel Size} \boldsymbol{= 2 \large{\unicode[arial]{x03BC}}} \textbf{m}$$

and scaling by the magnification (0.076X),

(2)$$\frac{2 \large{\unicode[arial]{x03BC}} \text{m}}{0.076 \text{X}} = \large{\boldsymbol{ \unicode[arial]{x03BC}}} \textbf{m minimum object feature size}$$

In comparison, the lens with the curve on the right in Figure 1 can only confidently image an object that is 282µm in size (using the same math as the above example).

The above example also assumes that the exact camera/sensor has not yet been chosen, therefore making the optics the limiting component in the imaging system. If a camera sensor had been chosen prior to the lens, the lens would need to be able to resolve the pixel size of the sensor in use.

Continuing from the example above, if a camera had been chosen with the Sony IMX250 sensor with 3.45µm pixels, using Equation 1 the image space resolution can be found as 144.9 lp/mm. Looking at the MTF curve, the lens achieves >40% contrast, which is more than enough for most applications. However, using those same calculation to scale into object space, 3.45µm pixels only corresponds to a 45µm object, meaning the sensor would be the limiting component in the system, as the lens is capable of 26µm object space resolution.

All of these considerations must be made when determining the proper lens for a given application in order to find the optimal solution to a machine vision problem. More information on matching lenses to sensors can be found in Pixel Sizes. 