TECHNICAL INFORMATION

Basics of machine vision

Which lens should I use to capture
this image?

4-7-1, Asahigaoka, Hino, Tokyo 191-0065, Japan
URL: https://www.toshiba.co.jp/en/

January 2022

Information contained in this document is subject to change without prior notice.
If you have any questions, please fill out our inquiries form in our web site.
We shall be exempted from taking responsibility and held harmless for damage or losses incurred by the user.
Company name, product name or logo are trademark or registered trademark of each company or organization.

DAA02984ATECHNICAL INFORMATION

Contents
1. Introduction .............................................................................................................. 2
2. Field of view and camera’s optical system .................................................................. 2
2.1. What is the field of view? What is the difference between the field of view and the angle ofview? ..................................................................................................................... 2
2.2. Lens equation ......................................................................................................... 5
3. Lens selection examples ........................................................................................... 6
3.1. Questions ............................................................................................................... 6
3.2. Camera sensor size .................................................................................................. 7
3.3. Calculating the field of view and the optical magnification ............................................. 7
I.
Questions .................................................................................................... 7
II.
Camera’s orientation .................................................................................. 7
III.
Field of view and optical magnification (transverse magnification).................... 7
IV.
Camera-to-object distances ........................................................................ 8
V. Calculating the focal length and the image size to select lenses .......................... 8

1
Copyright © 2022 Toshiba Teli Corporation, All rights reserved.

DAA02984ATECHNICAL INFORMATION
1. Introduction
Machine vision requires a photographic lens to project an image of an object onto acamera’s image sensor.
Its selection method is described in our product brochures and on our website as well as incommercially available books and trade journals.
However, we receive many questions about the relationship between a field of view (FoV,
i.e., the area of the inspection captured on the camera’s image sensor) and a camera’s
optical system although it can be calculated very easily.
This white paper gives several examples to plainly describe how to select a camera lens thatsatisfies your FoV requirement.

2. Field of view and camera’s optical system
First, let us discuss the field of view and a camera’s optical system, which are the basics inselecting a camera lens.

2.1. What is the field of view? What is the difference between the field of view andthe angle of view?
The field of view (FoV) is the extent of a physical scene that is captured by a camera’s
optical system. Suppose, for example, that the whole area of A4-size paper fills theentire screen. Then, the A4 size is the field of view.
The role of a camera lens is to focus an image of an object onto an image sensor.
A flux of light that is transmitted from a lens and travels to the sensor plane forms acone shape. The cross-section of this cone is called an image circle. The image of an
object can be captured when the image circle is adequately projected onto the sensor
plane. Typically, a sensor is rectangular or square. Therefore, an image projected by alens is cut off in the shape of a rectangle of a certain size (called the image size). Since
the aspect ratio of a sensor (i.e., the ratio of the width to the height of a sensor) is not
fixed, the field of view depends on a camera’s sensor. Specifically, it can be calculated
from the lens equation.
Figure 1 illustrates an image circle, a sensor’s image size, and a field of view.

2
Copyright © 2022 Toshiba Teli Corporation, All rights reserved.

DAA02984ATECHNICAL INFORMATION

Figure 1. Image circle, image size, and field of view
Camera- Image circle: Lens specification- Image size: Sensor specification
Field of view

Image size

Diagonal: D

Shooting lens

Image plane
Object side

Image plane

Vertical:V

Image side
Horizontal: H

The angle of view (AoV) is similar to but different from the field of view. The field ofview is represented as an extent of a physical scene captured by a camera whereas theangle of view is represented as an angular extent of an image captured by a camera.
The object size is not determined by the angle of view alone. Since machine vision isused to capture a specific object located at a finite distance, it is more convenient to
use the field of view. The angle of view is used for photography scenarios requiring an
infinity or undefined focus distance such as landscape photography. However, the term
“angle of view” is customarily used interchangeably with the term “field of view” (forexample, in TV programs). It is therefore necessary to discern which is meant based oncontext.
Half the angle of view is used especially for optical calculation.
Figure 2 illustrates the field of view and the angle of view.

3
Copyright © 2022 Toshiba Teli Corporation, All rights reserved.

DAA02984ATECHNICAL INFORMATION

Figure 2. Field of view versus angle of view
Field of view

Angle of view(Horizontal angle of view)
Shooting lens
Image size

Object side

Image side

Various types of lenses are available for typical interchangeable-lens cameras (ILCs)
such as standard and wide-angle lenses.
There are various definitions of “standard lens” such as a lens that reproduces a field ofview close to the naked eye, but it would be correct to say that a standard lens is a lenswith a focal length about equal to the diagonal size of a sensor.
For example, in the case of a camera with an image size of 1/2-inches (an 8-mm
diagonal), lenses with a focal length of about 8 mm are regarded as standard lenses. In
the case of a 2/3-inch camera (with a 11-mm diagonal), lenses with a focal length ofabout 11 mm are regarded as standard lenses. These lenses provide an angle of viewof about 53°. Generally, lenses with angle of view of 45° to 60° are called standard
lenses.
A lens that lets you take photographs with a wider view (i.e., a lens with a wider-angleview) than the standard lens is called a wide-angle lens. A wide-angle lens is used formachine vision applications that need to capture a wide area at a close distance. Lenses
with a shorter focal length (i.e., short-focus lenses) provide a wider angle of view.
Figure 3 illustrates standard and wide-angle lenses.

4
Copyright © 2022 Toshiba Teli Corporation, All rights reserved.

DAA02984ATECHNICAL INFORMATION

Figure 3. Standard lens versus wide-angle lensWide-angle lenses

Standards lenses

Half
the AoV

ObjectObjectHalf
the AoV
Wide-angle
lensStandard
lens

Image
plane

Image
plane

2.2. Lens equation
Figure 4 shows a geometric relationship between an object and its image formed by an
optical lens. It is simplified for the sake of clarity.
Figure 4. Lens imaging relationship

A :
B :
a :
b :
x :
x’ :
f :
f1 :
f2 :
θ :

Height of an object from the optical axis
Height of an image from the optical axis (called image height)
Distance from the center of a lens (principal point H) to an object
Distance from the center of a lens (principal point H) to an image
Distance from the front focal point (f 1) to an object (object distance)
Distance from the rear focal point (f 2) to an image (generally called lens extension)
Focal length
Front focal point
Rear focal point
Half the angle of view (angle of view = 2×θ )The focal length (f) is a constant that represents one of the major characteristics of alens. You need to calculate the focal length to select an appropriate lens according to
your shooting requirements.

5
Copyright © 2022 Toshiba Teli Corporation, All rights reserved.

DAA02984ATECHNICAL INFORMATION
Newton’s lens formula represents the relationship among the focal length (f), object
distance (x), and lens extension (x’):
𝑥 ∙ 𝑥 ′= 𝑓 2
With machine vision, the object size (i.e., the field of view) is predetermined. It istherefore convenient to use optical magnification that is determined by the field of viewand the sensor size when selecting a lens. There are transverse (also called lateral or
linear) magnification (β) and longitudinal magnification (α). Here, transverse
magnification is used.
Transverse magnification (β) refers to the ratio of image height (B) to object height (A):𝛽=𝐵
𝐴

The following equation represents the relationship between the object distance (x) andthe lens extension (x’):
𝑥=𝑓𝛽𝑥′ = 𝑓 ∙ 𝛽This equation can be rewritten as follows to calculate the focal length (f) of a lens fromthe field of view (A), sensor size (B), and object distance (x):𝑓 =𝛽∙𝑥 =

3.

𝐵
∙𝑥
𝐴

Lens selection examples

3.1. Questions
Here, we will explain in detail how to select a shooting lens. To make it easier tounderstand, we have prepared the following three examples.
Question 1: Shooting an object 1 m square from a distance of 5 m
Question 2: Shooting an A4-size object from a distance of 50 cm
Question 3: Shooting a postcard (about the A6 size) from a distance of 250 mm
Question 1

Question 1, 2

Field of view; 1 m square

Field of view;(1) A4

Camera-toobject
distance;(2) postcard(1) 50 cm(2) 250 mm

Camera-to-object
distance; 5 m

6Copyright © 2022 Toshiba Teli Corporation, All rights reserved.

DAA02984ATECHNICAL INFORMATION
3.2. Camera sensor size
To select a lens, you need to choose which camera to use first.
Here, let us assume that you will be using the BU040M, Teli’s small CMOS USB3
camera.
Table 1 shows the optical specifications of the BU040M.
Table 1. Optical specifications of Teli’s BU040M USB3 camera
Cameramodel
BU040M

Sensor model
IMX287LLR

Sensor size

Image size

Resolution

型

mm

H

V

H

V

1/2.9

6.2

720

540

4.968

3.726

(mm)

Of the camera specifications, pay attention to the sensor size to choose a lens.
The image size is expressed as the diagonal size of a sensor. Although Table 1 shows
the diagonal size in mm, it is also often given in inches (“). If you choose a lens with animage circle larger than the image size of the sensor, the periphery of the image is not
cut off. To select an appropriate lens according to the field of view, you need to know
the sensor size.
Although the sensor size should be shown in product brochures or specifications
because of its need, it is not often listed perhaps because of a lack of space. If so,
calculate the sensor size by multiplying the pixel pitch (or the pixel size) of the sensor
by the horizontal or vertical resolution. For example, Table 1 does not show the pixel
pitch of the BU040M. However, since it has a pixel pitch of 0.0069 mm and a verticalresolution of 540 pixels, its height can be calculated as follows:
Sensor height = 0.0069×540 = 3.726 mm

3.3. Calculating the field of view and the optical magnification
I.

Questions
Let us see the questions shown in Section 3.1 again:
Question 1: Shooting an object 1 m square from a distance of 5 m
Question 2: Shooting an A4-size object from a distance of 50 cm
Question 3: Shooting a postcard (about the A6 size) from a distance of 250 mm

II.

Camera’s orientation
Generally, the height (vertical resolution) of a sensor is smaller than its width(horizontal resolution). It is therefore practical to make a calculation using the sensor
height so that the field of view will not be cut off. Here, let us suppose that thecamera is positioned horizontally to shoot A4- and A6-size objects in portrait
orientation so that their full height fits in the height of the sensor.

III. Field of view and optical magnification (transverse magnification)
Calculate the optical magnification (transverse magnification, β) from the field ofview (height of the object) and the height of the sensor. The fields of view of theobjects are as follows:7
Copyright © 2022 Toshiba Teli Corporation, All rights reserved.

DAA02984ATECHNICAL INFORMATION
Question 1: The field of view is 1,000 mm since the object is 1 m square.
Question 2: The field of view is 297 mm since the A4-size object is shot in portrait
orientation.
Question 3: The field of view is 148 mm (which is equal to the height of the A6size) since the postcard is shot in portrait orientation.
Look at Figure 4. In this figure, half the field of view is equal to the object height (A),and the half the image height is B. Here, the height of the object is 2A, and theheight of the sensor is 2B.
Therefore, in the case of Question 1, the transverse magnification (β) can becalculated as follows:𝛽=

𝐵 2 ∙ 𝐵 3.726=== 0.003726 ×
𝐴 2 ∙ 𝐴 1000

where “x” indicates the optical magnification.
For Question 2 and Question 3, the transverse magnification (β) can be obtained in
the same manner. Table 2 shows the calculation results.

IV. Camera-to-object distances
The camera-to-object distances are as follows. Generally, the unit of measure used
for the camera-to-object distance is mm.
Question 1: 5 m = 5,000 mm
Question 2: 50 cm = 500 mm
Question 3: 250 mm
Figure 4 shows two distances, a and x. a is the distance from the center of the lens(principal point, H) to the object whereas x is the distance from the front focal point(f 1) to the object. Since we have not calculated the focal length of the lens yet, let
us assume x=a.
Hence, in the case of Question 1, the camera-to-object distance (x) is:𝑥 = 5,000 mm
Calculate the camera-to-object distance for Question 2 and Question 3 in the samemanner. Table 2 shows the calculation results.

V. Calculating the focal length and the image size to select lenses
At Steps III and IV, the transverse magnification (β) and the camera-to-object
distance (x) were obtained. So, it is now easy to calculate the focal length of thelens.
In the case of Question 1, the focal length (f) is calculated as follows:𝑓 = 𝛽 ∙ 𝑥 = 0.003726 ∙ 5,000 = 18.63 mm
Therefore, a lens with a focal length of 18.63 mm meets the requirement set forth in
the question. However, the focal length of commercially available machine visionlenses (such as C-mount lenses) is limited. So, select a lens with a focal length equal
to or slightly smaller than the calculation result from the product series that meetsthe image size of the camera.

8
Copyright © 2022 Toshiba Teli Corporation, All rights reserved.

DAA02984ATECHNICAL INFORMATION
Since the BU040M has a 1/2.9-inch image size (6.2-mm diagonal), you can use any
lenses with the same mount and an image circle larger than 1/2 inches. (With 1/3inch lenses, the periphery of an image might be cut off.)
When you look for C-mount lenses with a focal length smaller than the calculation
result (18.63 mm), you will find that lenses with a focal length of 16 mm areavailable from lens manufacturers, from which you can select one.
Table 2 shows the calculation results for each question. Table 3 shows the focal
lengths of typical C-mount lenses.

Table 2. Calculation results

Question

Question 1

Question 2

Question 3

Object size

1 m square

A4

Postcard

2*A

1,000

297

148

β

0.003726

0.012545

0.025176

x

5,000

500

250

Focal length (mm)

f

18.63

6.27

6.29

Lens selected (mm)

f

16

6

6

Vertical FoV (mm)Transverse
magnification (×)
Camera-to-object
distance (mm)Table 3 Focal lengths of typical C-mount lenses

焦点距離 (mm)FoV / AoV
Optical transverse
magnification

f

6

8

Lower magnification
Wider FoV

12

16

25

35

50

75

Higher magnification
Narrower FoVThis white paper has described the procedure for selecting a lens suitable for a given
field of view. You can follow this procedure to select the optimum lens for yourapplication.
Here, we have discussed how to select a lens based on the focal length. Other lens
specifications include the f number indicating the aperture opening. Also pay
attention to the f number when selecting a lens.

9
Copyright © 2022 Toshiba Teli Corporation, All rights reserved.

DAA02984A