A sharp image requires more than just a good camera; it also takes the right lens. Several aspects must be considered to make sure that the camera and lens work perfectly together and fit a specific application.

Sensor Size

The sensor size is a decisive factor in selecting the right lens. In the past, high-resolution area-scan and line-scan cameras had larger sensors than cameras with lower resolution. Today’s features have changed. Since the sensors have become ever smaller, it is more difficult to resolve the tinier pixels. The dimensions of sensors are not determined by any standard, but are defined by the resolution and the pixel size of the sensor. Theoretically, anything is possible here; it is only a question of price.


The camera mount is the second factor to consider when choosing a lens. Mounts come in standard sizes and are labeled according to the screw-threaded type of the camera body. Your camera and the lens should therefore have the same mount. A C mount, for example, is the most common mount in machine vision cameras and is appropriate for a sensor diagonal of up to 20 mm – corresponding to a sensor size of 1.5 inches. Larger sensors often require a larger mount, like the F mount. The size, however, is not very common in industrial machine vision applications; CS and S mount lenses are more commonly used.

Image Circles

Resolution determines the sharpness of an image. The left part of the image demonstrates high resolution; the right part shows lower resolution. (Image Credit: Basler)

Although machine vision sensors – and their pixels – have grown smaller over recent years, the image circle sizes on the matching lenses for those cameras have not changed. The majority of sensors used today are smaller than 1⁄2", but must work with lenses for machine vision applications with an image circle, or circle of light transmitted by the lens, of 2⁄3", as this is the most common type for machine vision lenses. As a result, a large section of the lens’s image circle is not used.

Ideally, a 1⁄3" C mount lens should be mounted on a camera with a 1⁄3" large sensor. The available image circle is then optimally used. If the same lens were attached to a camera body with a 1⁄2" sized sensor, a defect called vignetting would occur.

A Lens Selector from Basler (shown) allows users to enter criteria, such as focal length, working distance, angle of view, and object width. (Image Credit: Basler)

Vignetting is a reduction of an image’s brightness from the center to the edges. Assuming that a 2⁄3" lens with the same focal length is used with a 1⁄3" sensor, vignetting will not occur. The angle of view, however, will change.

In principle, the angle change is an advantage; by using the bigger lens, a larger image circle is created, which means that the brightness of the image remains more consistent from the center to the edge. A large portion of the image circle, however, is not used, which is a waste of money.

The size of the lens’s image circle does not matter; the object size is determined by the sensor size and the focal length of the lens. The larger the image circle of the lens, the more expensive it is. For a smaller sensor, including ones smaller than 1⁄2", you should use an appropriate lens with a smaller image circle.

Resolution, Pixel Size

A high-resolution image can only be created if a high-resolution lens is used. In order to get a first-rate highresolution image, you need more than a high megapixel count. The lens must also be capable of resolving the pixel size. The resolution of a lens is given in line pairs per millimeter and specifies how many line pairs on a millimeter appear as separate from one another. The more line pairs appear as differentiated, the better the resolution of the lens.

If the lens’s image circle and the sensor size do not match, defects like vignetting can occur. Vignetting is a reduction of an image’s brightness from the center to the edges. (Image Credit: Basler)

The lens resolution determines how small the pixels may be. Frequently, the resolvable megapixels are directly specified for the lenses. For a sensor with 5 MP resolution, a given lens must resolve the entire count of 5 MP. Therefore, the resolution of the lens must match the pixel size of the sensor. Five-megapixel lenses, for example, can be optimized for 1⁄2.5" sensors; Basler’s five-megapixel lenses have a resolution of 2.2 μm (230 lp/mm).

Focal Length

The next aspect that must be considered is the focal length: the distance between the optical center of the lens and the focal point. All of the light rays of the parallel incident light rays 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. The larger the focal length, the larger the telephoto characteristics of the lens.

The giant lenses of 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 derived from the sensor size, the working distance, and the object size of the application.

You can find the right focal length for your application by either using a math formula or a software tool.

In theory, you can calculate the focal length f with the formula seen in Figure 1.

Figure 1

In practice, it is very unlikely that you will need to calculate the focal length on your own. Most lens manufacturers provide software for this, a so-called lens selector. Thanks to these selectors, it is sufficient to know only a few values, like the object width and the working distance. The software will then automatically calculate the focal length.


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. A high F number means that the aperture is smaller; less light therefore falls on the sensor. When the aperture is wide open, more light lands on the sensor and less additional light is needed to achieve a good image. For poor lighting conditions, a wide-open aperture is thus beneficial.

The camera aperture has a direct impact on the image quality and brightness. A small aperture (as shown) can reduce undesired effects, such as vignetting and other aberrations, and the focal depth is increased. (Image Credit: Basler)

A smaller aperture can have both advantages and disadvantages. Undesired effects, such as vignetting and other aberrations, are reduced, and the focal depth is increased. With a too small aperture, however, diffraction blur is created. The incident light rays on the edge of the aperture are then deflected, which lowers the quality of the image.

Therefore, there is an optimal F number for each lens, which in fact is nothing more than the compromise between the least diffraction blur and the largest depth of field. Thus, the aperture must be set appropriately for the light conditions in your application.


The aspects you need to consider when it comes to lens selection are the following:

  • Your lens needs the same mount as your camera, like a C mount, for example.
  • The image circle diameter should correspond to the sensor size.
  • The lens resolution must match the sensor resolution.
  • The focal length needs to be appropriate for the sensor size and the application.
  • The aperture must match the predominant light conditions in your application.

If all of these factors are taken into account, then you should find the right lens for your camera and your application.

This article was written by Theda Ebeling, Product Line Manager at Basler (Ahrensburg, Germany). For more information, Click Here .

Imaging Technology Magazine

This article first appeared in the December, 2015 issue of Imaging Technology Magazine.

Read more articles from this issue here.

Read more articles from the archives here.