Sitemap
Andrey Winter

Andrey Winter

Senior Optical Engineer

Optics in Computer Vision. Article 1: The Lens

27 min readOct 10, 2026

--

Press enter or click to view image in full size

1. Article 1 — The Lens (you are here)

2. Article 2 — Aberrations

3. Article 3 — Apertures and vignetting (the link will appear later)

4. Article 4 — Optical resolution (the link will appear later)

Introduction

My name is Andrew, and I work as a senior optical engineer, combining optical design, mechanical design, and alignment responsibilities, while also consulting other departments on optical matters. For several years, I have been working closely with a team of machine learning and computer vision developers working on image recognition systems. Through this collaboration, I have gained a solid understanding of which parts of optical knowledge CV developers actually apply in their daily work — and where the involvement of a dedicated optical specialist is already required.

This course grew out of those practical parts, organized in a progressive order. I initially wrote it for the internal training of junior- and mid-level developers in our ML & CV team who were just beginning to work with image analysis. The course covers the issues that machine vision developers most frequently encounter in practice when working with optical systems and assembling prototypes.

Why did I write all of this when Google exists? Because optics is a narrow, specialized, and science-intensive field. When non-specialists search for optical information online, their queries often lead to inaccurate results because they lack the expertise to distinguish correct information from incorrect. Articles written by non-experts (such as photographers or amateur astronomers) tend to contain inaccuracies, while professional textbooks and papers are usually too complex for readers without an optical background. This is why I decided to create a concise and beginner-friendly course aimed at CV developers.

Disclaimer:

This course is intentionally brief and simplified, so in some places I deviate from classical optical theory. Where necessary, I have sacrificed precision in terminology and exhaustive coverage of edge cases to prioritize practical usability.

Also, the course is designed for beginners and opens with basic information. If you already have experience with optical systems, you can skim through the first article and move on to more advanced ones.

Let’s start.

Course Overview

From the vast field of applied optics, there are just three areas that machine vision developers need to understand for practical work:

  1. Key lens parameters: what they mean, what they affect, and how to perform basic calculations to select optics for a given task.
  2. Characteristics of a real image: how real images deviate from the ideal, how to identify the causes of poor image quality, and ways to mitigate negative effects.
  3. Resolving power: how to select optics optimally when the task is to observe a specific object at a specific distance with a specific level of image quality.

A working knowledge of these three areas covers virtually all optical questions that machine vision developers are likely to encounter. If the answer to your question cannot be found in these articles, it probably means that consulting a professional optical engineer would be the best option. This will save you a lot of time.

The selection of topics and subtopics is based on my many years of experience working alongside computer vision system developers. The three areas are spread across four articles to present the material in a logical and accessible progression. The course is designed to be accessible to learners with no prior background in optics.

Throughout this course, the terms computer vision and machine vision are used interchangeably to refer to systems that capture and process images of real-world objects.

Camera Lens as a Hardware Component of Computer Vision

To avoid confusion, the following terms will be used throughout this course:

  • Lens element or single lens — an individual optical element, usually made of glass.
  • Lens, camera lens or objective — an assembly of lens elements that forms a high-quality 2D image of the real 3D world.

When we talk about image processing, the question naturally arises: how do we obtain the original image in the first place? Even photos on the internet had to be captured by someone before being uploaded.

Machine vision systems, as the name suggests, perceive real-world objects much like the human eye does. To obtain images of objects in a form suitable for computer processing, a machine vision system needs its own “eye” — a lens. Without one, it is impossible to transfer an image of the real world into a computer.

Unfortunately, machine vision developers often do not pay enough attention to lens selection, and as a result, they occasionally encounter situations where the entire system fails to work properly — for example, an object detection algorithm fails to detect objects in the frame. To avoid building flaws into a project from the very start, it is worth paying careful attention to selecting the optical components. Just as you cannot receive a satellite phone signal with a TV antenna, you cannot obtain the required image with an unsuitable lens. It is useful for machine vision developers to know how to select the right optics for their applications.

General Structure of Optoelectronic Device

An optoelectronic device consists of the following independent modules, arranged in order from the observed object to the final digital image:

  1. Objective (lens). It forms an optical image behind the lens.
  2. Image sensor (also referred to as a sensor array). A thin semiconductor plate containing an array of microscopic photosensitive elements. The sensor is aligned with the image formed by the lens and is positioned inside the camera.
  3. Camera. A sensor housed in a body with processing electronics (typically based on an FPGA) and connectors for power and data transmission. In some cases, the camera’s FPGA performs initial image processing, such as signal amplification or compression.
  4. Processing module. A computer (or a dedicated computing device such as Jetson), where the image is processed according to the required operations. This includes additional adjustments such as gain, brightness, and color correction, as well as application-specific tasks like tracking, object detection, and more.
Figure 1 ‒ Lens with camera

From now on, the term optical system will be used instead of the pair “camera + camera lens.”

This separation allows the individual components to be selected relatively independently:

  • Select a lens based on the required magnification and resolving power
  • Select a sensor based on the required sensor format and pixel resolution
  • Select the appropriate type of camera (IP or analog)

and so on.

Interesting fact. This principle applies not only in optics but also across other bands of the electromagnetic spectrum. For example, a radar system works on the same principle: its dish-shaped reflector serves as an objective, while the receiver located at the reflector’s focal point is an analog of a camera.

Press enter or click to view image in full size
Figure 2 ‒ Radar

Interesting fact. In photography, the entire photographic device is also called a camera. For this reason, photographers usually use only the terms lens and sensor, while the word camera refers to the photographic device as a whole and therefore has a different meaning than in computer vision.

Perfect Lens as a Convenient Model for Camera Lenses

Any lens forms an image whether or not a camera is placed behind it. If the camera is removed from the lens, the image does not disappear; it remains behind the lens. This image can be observed directly by the eye or projected onto a sheet of paper:

Press enter or click to view image in full size
Figure 3 ‒ The image of the test target forms in the air at the focal plane of the objective

Thus, any lens can be considered separately from the camera and its sensor.

For practical calculations, a real camera lens can be replaced by an equivalent perfect lens. The perfect lens (also called a paraxial lens or ideal lens) is a lens that forms a perfect image without optical aberrations (we will discuss aberrations in the next article).

The perfect lens is a very simple and convenient model for quick optical calculations. Any lens system (except lenses with strong distortion) can be represented, for calculation purposes, by an equivalent single perfect lens. For a given lens, the equivalent perfect lens is located at the point where the extensions of the incoming ray and the outgoing ray intersect:

Press enter or click to view image in full size
Figure 4 ‒ The real lens and the equivalent perfect lens

The position of the perfect lens is defined by the axial ray bundle (a bundle whose rays propagate parallel to the optical axis), but oblique ray bundles, which define the field of view, follow the same rule:

Figure 5 ‒ Axial ray bundle in blue; oblique (field) ray bundle in green

A single perfect lens describes a real lens with sufficient accuracy for computer vision tasks. The multiple lens elements in real camera lenses are used mostly to improve image quality.

The primary characteristic of a perfect lens is its focal length (f′), the distance from the perfect lens to the focal plane. The focal length of the perfect lens equivalent to a given lens is always equal to the focal length of the lens itself.

Notice that the focal length does not depend on the physical length of the lens. It can be either longer or shorter. If the focal length is longer than the physical length of the lens, it is called a telephoto lens; if shorter, it is a retrofocus or reverse‑telephoto lens (Figures 4 and 5 show this type).

Formation of Image in Perfect Lens

Note. In computer vision, the term image usually refers to the entire image captured by the camera. In optics, however, image also refers to the image of a specific object or object feature formed by the optical system. Both meanings of image are used throughout this course, depending on the context.

To use the perfect lens model in calculations, we need to understand how it forms an image. This requires two additional concepts:

  1. Focal point (F′) — the point on the optical axis where the axial ray bundle converges (focuses).
  2. Focal plane — the plane passing through the focal point and perpendicular to the optical axis.

Three rules are used to trace the path of any ray through the perfect lens:

  1. A ray traveling parallel to the optical axis passes through the focal point after the lens, and vice versa.
  2. A ray passing through the center of the lens does not change direction.
  3. Any other ray, after passing the lens, passes through the point where the focal plane intersects the auxiliary ray. The auxiliary ray is parallel to the original ray and passes through the center of the lens.

Suppose an object AB is placed in front of the lens. To determine the position and size of the image, we need to find the positions of points A′ and B′:

Press enter or click to view image in full size
Figure 6 ‒ The perfect lens

Any point can be uniquely defined by the intersection of two lines. Point A lies on the optical axis, which already provides one line; therefore, to find point A′, it is sufficient to find the intersection of the optical axis with any ray originating from point A:

1. From point A, draw an arbitrary ray AD incident on the lens.

2. Draw an auxiliary ray EE parallel to AD and passing through the center of the lens O.

3. According to Rule 3, after refraction, ray AD passes through point J — the intersection of the auxiliary ray EE with the focal plane — and then intersects the optical axis at point A′.

To find point B′, it is enough to trace two rays:

1. Ray BC travels toward the lens parallel to the optical axis and, after the lens, passes through the focal point F′.

2. Ray BO passes through the center of the lens O and therefore does not change direction.

The intersection of rays CF′ and BO determines point B′.

As can be seen, if an object is perpendicular to the optical axis, its image is also perpendicular to the optical axis.

The points A and A′ are optically conjugate. This means that any ray passing through point A and reaching the perfect lens will, after refraction, pass through point A′. The same applies to the pair of points B and B′. The cones of rays originating from points A and B are limited only by the clear aperture of the lens:

Press enter or click to view image in full size
Figure 7 ‒ Optical conjugation of points A–A′ and B–B′

Real images are formed by such light cones, each containing an infinite number of rays. To construct an image, we simply select the most convenient rays from this set, choosing those whose paths through the lens are easiest to trace according to the rules.

In the example above, the object was at a finite distance from the lens. However, it is often necessary to observe distant objects. In this case, the object is said to be located at infinity. To understand how an image is formed for an object at infinity, consider what happens as the object is gradually moved farther away from the lens.

For clarity, let us assume that the upper and lower rays pass through the edges of the clear aperture of the lens:

Press enter or click to view image in full size
Figure 8 ‒ The object and the image at a finite distance

Let us go through Figure 8 from top to bottom.

  • The first lens scheme shows the object and image positions identical to those in Figures 6 and 7.
  • When the object is moved to a distance of twice the focal length, its image becomes the same size as the object (the second lens scheme in Figure 8).
  • As the object is moved farther away from the lens, its image becomes smaller and approaches the focal plane (all the other schemes in Figure 8).

Note that as the object is moved farther away, the angle α between the upper and lower rays decreases. Therefore, as the object moves farther away, the angle α approaches zero, and when the object reaches infinity, α becomes zero. A zero angle between two lines means that the lines are parallel:

Press enter or click to view image in full size
Figure 9 ‒ The object at infinity, its image in the focal plane
  • When the object is moved to infinity, its image is formed in the focal plane (since parallel rays focus there).

For objects at infinite distance, it’s common to switch from linear measures (object height, distance) to angular measures. The angular size of the object in Figure 9 is denoted by ω (omega).

Real objects are never located at true infinity. In practice, any object is positioned at a specific distance from the lens. This distance may be very large, but it is finite. If the distance to an object is so large that its image lies practically in the focal plane and is as sharp as the image of an object at infinity, the object is said to be at practical infinity, or simply at infinity.

Practical infinity depends on the lens parameters (focal length, f-number) and the sensor (pixel size). It does not necessarily begin at a great distance:

  • For the human eye (which is also a lens), it is approximately five meters — which is why the eye chart used for visual acuity tests is placed at that distance.
  • For short-focal-length lenses, it can start at a couple of meters or even closer.

The distance to practical infinity depends on the focal length, f-number, and sensor pixel size. It begins closer to the lens when the focal length is shorter, the f-number is higher (the aperture is smaller), or the sensor pixel size is larger.

Note. There is a related term, hyperfocal distance — the focus distance at which the depth of field (DOF) is maximized because its far limit extends to infinity. For every combination of focal length, f-number, and pixel size, there is a unique hyperfocal distance. The hyperfocal distance is not the same as the distance to practical infinity.

Now, if we look closely at Figures 8 and 9, we can draw some initial practical conclusions:

1. When observing distant objects, the camera sensor should be positioned in the focal plane.

2. When observing objects at a finite distance, the sensor has to be moved farther from the lens. In real lenses, this is achieved by moving either the entire lens or one of its internal elements farther from the sensor (and closer to the object). In the first case, the lens is often extended by turning it along its threaded housing.

3. As the object moves away, its angular size decreases. Hence, even very large objects can be captured by a small sensor when viewed from a distance.

Calculation for Object at Infinity

Let us consider some simplified relations for the perfect lens that projects an object located at practical infinity onto the sensor.

As mentioned above, for distant objects, it is often more convenient to switch to an angular measure: instead of the object height y and the distance to the object L, we use the angular size of the object ω:

Press enter or click to view image in full size
Figure 10 ‒ Image Formation at practical infinity
  • Knowing the object size y, the distance to the object L, and the focal length f′, we can calculate the linear image size y′.
  • Knowing the dimensions of the sensor’s sensitive area (using them in place of the image size y′) and the focal length f′, we can calculate the angular fields of view ω.
  • After calculating the linear image size y′ and knowing the pixel size of the sensor, we can determine how many pixels the image occupies on the sensor.

The last calculation is an important factor in computer vision tasks. Many neural networks require the image to cover at least a certain number of pixels to be reliably detected or recognized.

Example: Calculating angular fields of view

Task:

Find the fields of view at maximum zoom for the Computar M24Z1527PDC-MP lens used with a camera based on the PYTHON 2000 image sensor.

Solution:

The necessary data for solving such problems can be found in the lens and sensor datasheets.

Any rectangular sensor has three key dimensions (often listed in datasheets as optical area, sensitive area, etc.):

Press enter or click to view image in full size
Figure 11 ‒ Calculating the angular fields using the sensor size

The arctangents of the ratios of the dimensions a, b, and c to the focal length give the three angular fields of view: horizontal, vertical, and diagonal.

  1. Look up on the Internet the datasheet for the Computar M24Z1527PDC-MP lens and find its maximum focal length: 360 mm. Maximum zoom always means maximum focal length.
  2. Similarly, consult the datasheet for the PYTHON 2000 sensor and determine its pixel size: 4.8 µm (convert to mm: 0.0048 mm) and its resolution: 1920×1200.
  3. To determine a and b, multiply the sensor resolution by the pixel size. Calculate the dimensions of the sensor’s active area in mm: 1920×0.0048 by 1200×0.0048 = 9.216 × 5.76 mm.
  4. Use the Pythagorean theorem to find the sensor diagonal (see Figure 11): 10.87 mm.
  5. Calculate the diagonal field of view: arctan(10.87 / 360) = 1.729 degrees.
  6. Calculate the horizontal field of view: arctan(9.216 / 360) = 1.446 degrees.
  7. Calculate the vertical field of view: arctan(5.76 / 360) = 0.916 degrees.

This calculation assumes a perfect (distortion-free) lens and uses the nominal focal length. Real-world factors — such as lens distortion or slight deviations in focal length — introduce small errors. So the results are approximate and should be rounded to one decimal place.

Answer:

· Diagonal field of view: 1.7°

· Horizontal field of view: 1.4°

· Vertical field of view: 0.9°

Note. You cannot simply find just one angular field and then calculate the other two based on the sensor aspect ratio — the resulting values will be incorrect. Each of the three angular fields must be calculated independently via arctangents.

Important: Distortion

As mentioned above, the perfect lens model cannot be used for lenses with strong distortion (wide-angle and fisheye lenses). In such cases, you should either rely on the angular field from the datasheet or physically measure the actual angular fields.

Distortion correction is covered in a separate article provided as supplementary material for this course.

Example: Calculating observation distance from required pixel count

Task:

Find the distance at which a 5-meter-tall object, viewed through the Computar M24Z1527PDC-MP lens used with a PYTHON 2000 image sensor at maximum zoom, will cover an image height of 100 pixels.

Solution:

  1. Look up on the Internet the datasheet for the Computar M24Z1527PDC-MP lens and find its maximum focal length: 360 mm. Maximum zoom always means maximum focal length.
  2. Similarly, consult the datasheet for the PYTHON 2000 sensor and determine its pixel size: 4.8 µm.
  3. Calculate the image size on the sensor: y′ = 100 × 4.8 μm = 480 μm. Convert to millimeters: 0.48 mm.
  4. Use the thin lens formula (Figure 10), express the object distance, and calculate the result in millimeters:

Answer: 3750 meters.

Press enter or click to view image in full size
Figure 12 ‒ The same object, different pixel counts

Calculation for Object at Finite Distance

Sometimes it is necessary to focus a lens at a close distance. In optics, this case is called a finite distance. At a finite distance, an important difference appears compared to the case of objects at infinity: the image is formed not in the focal plane, but behind it:

Press enter or click to view image in full size
Figure 13 ‒ Image formation at a finite distance

When we examined objects at infinity, the segment z′ (the shift from the focal plane) was equal to zero.

Get Andrey Winter’s stories in your inbox

Join Medium for free to get updates from this writer.

When we considered objects at the hyperfocal distance, the segment z′ was so small that it could be ignored. It can also be ignored even when the object is closer than the start of the hyperfocal distance — but only if the distance is still large enough.

When we considered objects at a close distance, the segment z′ must be taken into account, because it becomes too large:

Figure 14 ‒ Dependence of segment z′ on the focusing distance for a 50 mm lens

The extension of segment z′ is most often achieved mechanically by:

  • in simple lenses — moving the entire lens along its thread
  • in more complex lenses — moving one or more lens elements along the optical axis, most often the first one

For finite-distance calculations, the following geometric-optics formulas are used:

Press enter or click to view image in full size
Figure 15 ‒ Formulas for finite-distance calculations

Knowing these formulas and the focal length of the lens allows calculating any required parameter.

These formulas are not used in real focusing. In practice, focusing is done visually. Instead, such calculations are useful for estimating how much the image plane shifts when using a standard lens (designed for infinity focus) at close range.

Important. If the pinhole camera model is used in code, a subtle but critical error may occur: the focal length of the actual lens is used as the focal lengths fₓ and fᵧ of the pinhole camera instead of replacing it with the calculated segment a′. This error leads to incorrect calculations and results when the distance to the observed object is too small. Remember the quadratic relationship and use the correct segment a′ for short distances.

Interesting fact. There is a terminological duality: when focusing lenses at a finite distance, people continue to say that the image is “in focus”. However, in strict optical terms, the focus, point F, is the point where rays parallel to the optical axis (meaning they come from infinity) converge. For objects at a finite distance, the image plane lies farther from the lens than the focal plane.

Example: Camera-shift calculation

Task:

You have a 20 mm C-mount lens and a camera. Calculate how far the camera must be moved from the lens to focus at a distance of 500 mm, and convert this distance into thread turns.

Solution:

  1. The required shift is the offset z′. Use the Newtonian thin lens formula: z′ = f′²/z
  2. Using an additional formula: z = a−f′ = 500−20 = 480 mm
  3. Final shift: z′ = f′²/(a−f′) = 2⁰²/480 = 0.8333 mm
  4. Look up C-mount thread parameters: pitch 32 threads per inch. Convert to millimeters: 25.4/32 = 0.79375 mm
  5. Rotation angle: one full turn (360°) shifts the sensor by 0.79375 mm, but we need 0.8333 mm
  6. Calculate the number of turns: 0.8333/0.79375 = 1.0498 ≈ 1.05 turns or 378°. A handier option: 360° + 18°

Answer:

The lens needs to be rotated by one full turn plus 18 degrees.

If the focusing distance is much larger than the focal length, segment z can be substituted directly by the object distance a instead of calculating a−f′.

Suppose the observation distance is large: not 500 mm, but 2000 mm. In this case, the difference between the exact and simplified calculations is small:

  • Exact: z′ = f′²/(a−f′) = 2⁰²/1980 = 0.202 mm
  • Simplified: z′ = f′²/a = 2⁰²/2000 = 0.200 mm

The difference between the two methods is smaller than the depth of field.

Which method should be chosen?

  • If the distance to the object is much larger than the focal length, you may use the simplified method.
  • If the values are comparable or you are unsure, it is better to use the full method.
  • If the object is at close range, the full method must be used.

Example: Camera-shift calculation

Task:

Determine the focal length for detecting defects on rolled metal sheets under the following conditions:

1. Distance from the lens to the sheet on the rolling mill: 500 mm

2. Sensor pixel size: 4.5 µm

3. Minimum defect size: 0.5 mm

4. Minimum number of pixels that the defect image must cover: 4

Press enter or click to view image in full size
Figure 16 ‒ Calculation of the focal length for the required magnification

Solution:

1. Find the minimum image size: y’ = 4 × 4.5 µm = 18 µm = 0.018 mm

2. Find the linear magnification of the lens: y’/y = 0.018 / 0.5 = 0.036×

3. From the property of similar triangles, y’/y = a’/a. Therefore: a’ = a × (y’/y) = 500 × 0.036 = 18 mm

4. Using the Gaussian lens formula, express f’ and calculate it: f’ = (a a’) / (a + a’) = (500 × 18) / (500 + 18) = 17.375 mm

5. Round the focal length up to the nearest available standard focal length: 18 mm. Rounding up is preferable because this ensures that the image will be larger than the minimum acceptable size, not smaller.

Answer:

The focal length should be at least 18 mm.

Note. In machine vision, the term resolution is sometimes used to describe the minimum number of pixels that an image feature must cover. For example: “The required defect resolution is at least 4 pixels.” This use of resolution should not be confused with optical resolution, which describes the ability of a lens to distinguish fine details. Although these two concepts are often described using similar terminology, they represent fundamentally different properties. The fourth article in the course covers optical resolution and resolving power.

Key Lens Parameters

Among the many optical characteristics, the following are of primary interest for machine vision applications:

1. Focal length

2. F-number (Aperture)

3. Angular field of view

4. Resolving power

Let us examine each one in detail.

Press enter or click to view image in full size
Figure 17 ‒ Three core parameters of a perfect lens

Focal Length

Focal length affects the following parameters:

1. Magnification — the longer the focal length, the larger the image.

2. Angular field of view (FOV) — the longer the focal length, the smaller the angular field.

3. Depth of field (DOF) — the longer the focal length, the smaller the depth of field.

Sometimes the datasheets of cheap zoom lenses do not specify the minimum and maximum focal lengths. Instead, they provide a parameter called optical zoom. This indicates the ratio between the maximum and minimum focal lengths. For example, a zoom lens with f′ = 10–100 mm will be listed as optical zoom: 10×.

Note. The digital zoom parameter is unrelated to optics. It is image scaling, with the available range determined by the manufacturer.

F-number

The f-number is related to the aperture stop (the term used in optics for the lens aperture, to distinguish it from other types of stops). A detailed discussion of the aperture stop and its effect on the image can be found in the third article, so only basic information is provided below.

The aperture stop controls the amount of light passing through the lens. Reducing its diameter decreases the light transmission, making the image darker.

The F-number is the ratio of the focal length to the diameter of the entrance pupil of the lens, f′/D. The entrance pupil is the image of the aperture stop as viewed through the preceding lens elements:

Press enter or click to view image in full size
Figure 19 ‒ The aperture stop and its entrance pupil

The aperture stop is most commonly implemented in camera lenses as a mechanical iris diaphragm. Close the iris diaphragm halfway and look into the lens. The aperture image you see through the lens elements is the entrance pupil (as shown in Figure 19).

The size and position of the entrance pupil are determined by the lens elements placed in front of the aperture stop; the lens elements behind the aperture stop do not affect the entrance pupil.

Remember: The diameter of the entrance pupil is neither the diameter of the front element nor the diameter of the aperture stop itself. It is the diameter of the aperture stop’s image when viewed from the front of the lens.

If there is no iris diaphragm, the aperture stop is the lens cell that appears smallest when looking into the lens from the front:

Figure 19 ‒ The entrance pupil of an M12 lens. Note the difference between the entrance pupil and the front lens element

F-numbers are marked on the aperture control ring of a lens. If the lens has no adjustable aperture, a single fixed f-number is marked on the lens body.

The f-number, defined as the ratio of the focal length to the entrance pupil diameter, describes the lens’s ability to collect light. It can be visualized as a cone of light whose base is the entrance pupil and whose height is the focal length. Sometimes the f-number is informally called lens speed.

Image illuminance is determined by the ratio of the light transmitted through the entrance pupil to the image area over which it is distributed:

  • The larger the entrance pupil diameter, the more light the lens collects.
  • The longer the focal length, the larger (and therefore darker) the image.
Press enter or click to view image in full size
Figure 20 ‒ Image illuminance as a function of focal length

Combining these two factors, we can see: the higher the f-number (the more the aperture is stopped down), the darker the image. F-numbers are compared by their denominators: F/4 is darker than F/2.

Note. In some optical literature, the reciprocal quantity, the relative aperture, is used: D/f′, where D is normalized to 1 (for example, 1:2 or 1:2.4). Example: a lens marking reads: F4/200. This means: focal length 200 mm, f-number F4, relative aperture 1:4.

Interesting fact. As is easy to see, the relative aperture and the f-number actually describe the same thing. This distinction is primarily historical: the term relative aperture was traditionally used in German and Soviet optical schools, while f-number has been more common in English-speaking practice.

Example 1. Calculate the f-number for a lens element with a diameter of 50 mm and a focal length of 100 mm. For a single lens element, the entrance pupil is its diameter. The f-number is: F = f′/D = 100/50 = 2.

Example 2. The front of the lens is marked “F4/200.” This means that the lens has a focal length of 200 mm, an f-number of F4, and a relative aperture of 1:4.

In a lens with an adjustable aperture stop, changing the f-number means opening or closing the iris diaphragm. Adjusting the aperture performs three main functions:

1. Brightness control

2. Increasing sharpness

3. Changing depth of field

These parameters are mutually conflicting, as all three depend on the same aperture. Increasing one parameter simultaneously reduces another. All the effects of changing the aperture are described in detail in the third article of the course, “Apertures and Vignetting,” so now we will only look at them briefly as a base for future comprehension.

Interesting fact. If you need to understand what effect the aperture has on the image, you can read articles and watch videos by photographers. However, you should not memorize their explanations of how exactly the aperture produces these effects or what the underlying physics is — such explanations tend to contain errors.

Brightness control. Intuitively, the more the aperture is opened, the more photons pass through the lens and the brighter the image becomes. If there is a choice between software brightening and opening the aperture, the aperture should be preferred. Software brightening is an artificial improvement of the image, whereas opening the aperture is a natural increase in light flux and an improvement in the signal-to-noise ratio (SNR). Algorithm performance degrades significantly in low-light conditions.

Press enter or click to view image in full size
Figure 21 ‒ Image brightness as a function of f-number

Increasing sharpness. When the aperture stop closes, image sharpness increases, especially in the center of the image. This is caused by the reduction of aperture-dependent aberrations — spherical aberration and coma (details in the second article, “Aberrations”). However, if you continue closing the aperture, at some point sharpness begins to worsen again — diffraction starts to dominate (it will be explained in the fourth article, “Optical resolution”). This effect is well documented in photographic literature.

Press enter or click to view image in full size
Figure 22 ‒ Image sharpness as a function of f-number

Changing depth of field (DOF). The wider the aperture, the shallower the depth of field — the zone within which objects appear sharp, while objects closer or farther away appear blurred. This effect is commonly used in portrait photography: if the iris diaphragm is opened wide, the background behind the person becomes blurred.

Press enter or click to view image in full size
Figure 23 ‒ Depth of field as a function of f-number

Note. The aperture is the main way of controlling depth of field. However, there are other factors that affect depth of field, which are listed in a separate section.

Conclusion. Opening the aperture increases image brightness and contrast but reduces sharpness and depth of field. Stopping the aperture down increases sharpness and depth of field but makes the image darker.

Angular Field of View

The angular field of view is the angle in space that the lens projects onto the sensor.

Camera lenses are axisymmetric, so any lens has a circular field of view into which the rectangular sensor is inscribed. As a result, lens datasheets specify angular fields of view horizontally and vertically, and sometimes also diagonally. The values are always given for a particular sensor format:

Press enter or click to view image in full size
Figure 24 ‒ An excerpt from the zoom lens datasheet

The table above shows an excerpt from the datasheet of a zoom (variable-focal-length) lens. The lens is compatible with a 2/3″ vidicon-format sensor and also with smaller sensor formats: 1/1.8″ and 1/2″. For each sensor size, three angular fields of view are listed: D (diagonal), H (horizontal), and V (vertical). For each field of view, its maximum and minimum values in degrees are provided. Maximum field of view corresponds to minimum zoom, and vice versa.

Note. Sensor diagonals (1/2″, 2/3″, etc.) are measured in vidicon tube inches.
This special inch is not the standard imperial inch of 25.4 mm. One vidicon tube inch is approximately 2/3 of an imperial inch, or about 17 mm, and refers to the diameter of an old tube-shaped optical receiver called a vidicon.

Interesting fact. The vidicon tube inch is one of the very few remaining non-SI measurement units still in use, not tied to the SI system or to metrological standards. In the 21st century, the vidicon tube inch is almost like measuring distance in footsteps or in the range of an arrow. Nevertheless, due to industry inertia, it continues to be used.

If a lens is compatible with a certain sensor size, it is also compatible with any smaller sensor. But if you attempt to use a larger sensor, vignetting will appear at the edges of the image.

In some datasheets, the angular field of view is omitted and replaced by simply indicating the largest compatible sensor size. In this case, the actual field-of-view values in degrees may not be provided at all.

Resolving power

Resolving power is the ability of a lens to image two closely spaced points as separate. The higher the resolving power of a lens, the sharper the image it produces.

Information about resolving power is provided in datasheets in two ways:

  1. Maximum resolvable spatial frequency in the focal plane (in lines per millimeter)
  2. Modulation transfer function (MTF) chart
Press enter or click to view image in full size
Figure 25 ‒ Resolving power: number of line pairs per millimeter
Press enter or click to view image in full size
Figure 26 ‒ Resolving power: MTF charts

The fourth article in the course is entirely devoted to the resolving power of lenses and to how to read and interpret MTF charts.

Additional topic: Depth of field

Press enter or click to view image in full size
Figure 27 ‒ Depth of field

This parameter is not listed in datasheets because, in addition to the characteristics of the lens itself, depth of field varies with focusing distance and pixel size. However, for practical applications it is important to understand the parameters that affect depth of field in order to control it.

1. Focal length — the shorter the focal length, the greater the depth of field.

2. F-number — the more the aperture is stopped down, the greater the depth of field.

3. Pixel size — the smaller the pixel, the smaller the depth of field.

4. Focusing distance — the shorter the focusing distance, the shallower the depth of field (when focusing at a very close distance, the segment z′ becomes too large).

Lens selection

When selecting a lens for a specific application, the following parameters should be considered first:

1. Focal length

2. F-number

3. Maximum supported sensor size (determines the angular field)

4. Resolving power

5. Camera mount type (C-mount, CS-mount, M-mount, etc.) — a standardized combination of a mounting thread and a flange focal distance. The mount type on the lens and the camera must match, otherwise you will have to buy or make adapters.

Figure 28 ‒ C and CS mounts (S means short). They differ in their flange focal distance: 17.526 mm vs. 12.5 mm

Note. There is also the back focal distance (also called back focal length) — the distance from the last surface of the last lens element to the focal plane. Some lenses have a focal length shorter than the back focal distance.

The flange focal distance is measured from the metal, while the back focal length is measured from the glass.

Key Takeaways

  1. To obtain an image on a computer, both a lens and a camera are required.
  2. The lens focuses light and forms a flat image on the image sensor. The sensor is the light-sensitive element of the camera.
  3. For layout calculations, a lens can be approximated as the perfect lens, and the necessary parameters can be calculated using similar triangles.
  4. For distance observation, the image forms in the lens’s focal plane. For close-range observation, the image moves away from the focal plane and the lens, and the lens has to be refocused to a finite distance.
  5. Focal length and angular field of view are inversely proportional. The longer the focal length, the higher the magnification, but the narrower the field of view.
  6. The entrance pupil of a lens is neither the diameter of its first element nor the iris diaphragm diameter. It is the apparent diameter of the iris diaphragm as seen through the front of the lens.
  7. The f-number is the ratio of the lens’s focal length to the entrance pupil diameter.

The next article is Aberrations

This is the first article in the course on optics for computer vision developers.

Original Russian version is available at the link.

Translated by the author.

© linkedin.com/in/andrey-kurasov/

--

--