You are on page 1of 16

Basic Optics

2003 The Imaging Source Europe GmbH


All rights reserved

http://www.1394imaging.com/

Version: December 2003

Be honest: do you really know how to calculate the focal length of a lens? If so, you are an exception to
the rule and can stop reading here !! For the rest of you, here is a second chance.

Back to square one


"Piece of broken glass starts forest fire" a common headline during the summer. But how could this
have happened? Due to the enormous distance between the Earth and the Sun, the Sun only appears as
a tiny point emitting parallel rays of light (figure 1a) Should these parallel rays pass through a lens (or a
piece of glass, which has similar characteristics) the rays would meet behind the lens at what is called
the focal point.
But what happens if our point of light is so near to the lens that we can not assume to have parallel rays
of light? They cross each other behind the focal point (figure 1b). If we take a look at the image of our
point of light at the focal points position we will see a unclear blurred spot.
And so the question arises- "what is focusing?". Focusing is to increase the distance between the focal
plane and the lens until the focal plane and the junction of the rays overlap each other (figure 1c).
Thus, for single points of light the situation is quite simple. But what happens to the image of screws,
PCBs or plates of steel?

From points of light to images


A point of light does not necessarily originate directly from the sun, candles or lamps, it can also result
from a reflection. Consider the surface of a reflective object as an ensemble of an infinite number of
points of light. Now look at the arrow shown in Fig. 1d. The arrow head and it's tail form two points. If
we trace the rays reflected from these two points to the lens, the image of the arrow appears inverted.
All of the remaining (infinite) points of light are treated in the same way.

From single to compound lenses


Surely, playing with fire is one of the less desirable applications of lenses. In the context of optical
measurement we use lenses to represent an object on an image sensor (for instance a CCD chip). The
image created in this way (Fig. 1d) is the basis for various measurements, for example: size, position
and surface quality.
However, this image is no longer produced by using a single lens but by a group of lenses termed "a
compound lens". The quality of such compound lenses is much higher than that of single lens. For
everyday use we can just consider the compound lens to be the Ideal single lens.
So, how do we choose the right lens? The most basic feature is the relationship between the size of the
image and that of the object:

Magnification =

Size of image
Size of object

For example; the length of a screw is 5cm and the resulting image should be 5 mm, the magnification is
therefore 0.1. If, however, the screw size is only 0.5 mm and is to be represented by an image of 5 mm,
the magnification is 10.
As Fig. 1d shows that magnification also depends on the working distance. The more distant the object
the smaller the image. Thus, the use of the parameter magnification only makes sense if we know the
working distance at the same time. You say this is too impractical? Okay - then we need a parameter
which describes a lens more clearly. The solution is evident from our everyday life. It is the

Focal length
Focal point

(a)

Distance
almost

Sun

Point of light

Focal point

(b)

Focal point

(c)

Focal point

Image

(d)
Object

Focal plane
Working
distance

Back focal
distance

Fig. 1: From points of light to images

Focal length =

Working distance * Size of image


Size of object + Size of image

Do vacation shots and optical measurement have something in common?


To be honest, very little. But the shooting of vacation snaps and optically measuring a plate of steel are
both based on the same optical laws. Let us assume an image sensor with the same dimensions of a 35
mm film that has a height of 24 mm and a width of 36 mm. Our aim is to capture a 1000 m width of a
beach at a distance of 500 m, for this we need the following focal length:
Focal length =

500 000mm * 36mm


= 18mm
1 000 000mm + 36mm

We exchange the 35 mm film for a typical CCD chip measuring 4.8 * 6.4 mm, the focal length is now
considerably lower:
Focal length =

500 000mm * 6.4mm


= 3.2mm
1 000 000mm + 6.4mm

There is no beach without a Bay Watch kid !! Should we want to capture him completely on a 35 mm film
at a distance of 500 m and a height of 2 m, we would require a
Focal length =

500 000mm * 24mm


= 5 929mm
2 000mm + 24mm

Such focal lengths are not usually found in basic camera equipment. Whether we like it or not we would
have to move closer to the person. At a distance of 10 m we can fill the image on a 35 mm film with a
more or less "normal" focal length of 120 mm.
Nature-lovers often struggle when taking photographs of their subjects which are usually very close
rather than at a distance. If for instance, we approach an insect which has a height of 10 mm from a 30
cm distance, we can capture it on a 35 mm film with a focal length of
Focal length =

300mm * 24mm
= 212mm
10mm + 24mm

But have you ever tried to focus the same object using a normal 200 lens at a distance of 30 cm ?
Forget it !

The myth of extension rings and tubes


Some technical things are considerably overrated. This is particularly true for extension rings and tubes
which are are simply inserted between the lens and the camera to increase the back focal length (Fig.
1d). But what advantage does this have? The closer a point of light is to the lens the more distant behind
the lens the rays cross each other. Thus, the back focal length has to become longer and longer to yield
a sharp image (Fig. 1b and 1d). Common lenses modify the back focal length by the use of a helical
mount which moves the single lens in the lens housing. This movement of the lens obviously has
mechanical limits. One of these limits determines the maximum back focal length and therefore the least
possible object distance (also called MOD = minimum object distance). Should we need to get closer to
the desired object we simply have to increase the MOD by adding extension rings or tubes.
This is actually quite a simple effect although it is amazingly surrounded by bizarre myths, such as an
alledged increase - or according to another belief a decrease in field-depth. All of this is nonsense! Let us
concentrate on some practical details which are important to everyday usage as, for example, the
question

Why C-mount lenses?


In olden times films were taken by pick-up tube cameras. The external diameter of such a tube was 1/2",
2/3" or 1" while the light sensitive area at the front side of the tube was accordingly smaller. Fig. 2
shows their dimensions. These remain the basis for todays dominating CCD chips.
The mounting lens of the pick-up tube camera is called C-mount (C as in Cinema). Here, we are talking
about a 1" thread which offers a simple, compact and robust basis for interchangeable lenses. The CSmount version only differs from this in the so-called flange focal distance (Fig. 3).
The different dimensions of pick-up tubes and CCDs are reflected in the various formats of the lenses.
This is unfortunate as it falsely leads to the belief that for example: a 1/3" CCD would require a 1/3"
lens.

Everything revolves around the image circle


White walls may be a little boring, but are suitable now and again for some thought-provoking
experiments. Imagine pointing a lens at such a wall. What would the image be? A bright round spot
which is just as boring as the wall (experts call this an "image circle"). In the case of a 1/3" lens its
image circle is slightly larger than the diagonal of a 1/3" CCD. Thus, our bright spot covers our 1/3 CCD
completely. Had we used a 1/2" CCD instead of the 1/3 CCD the bright spot would not have covered the
CCD and its corners would remain dark. To sum up: The format of the lens has to be larger than or
equal to the format of the CCD.

1/4"

4
m 2,4 mm
m
3,2 mm

1/3"

3,6 mm

4,8 mm

1/2"

4,8 mm
C/CS-mount thread
1", 32 threads/inch (UN-2A)

6,4 mm

2/3"

11

Flange focal distance:


C = 17.5
CS = 12.5

CCD

6,6 mm

8,8 mm
C/CS ring

Fig. 3: The C-mount thread.


m

16

1"

9,6 mm

12,8 mm

Fig. 2: CCD formats

Unfortunately, lenses are not perfect and are prone to flaws which mainly occur around the rims. Thus, it
is advisable to choose a lens format which is as large as possible. The second possible measure is just as
simple. We prevent the rays of light going through the outer parts of the lens and therefore no defects
can arise. Our tool for this is the iris.

An "indepth view"
An iris does not only decrease lens flaws, it also affects the sharpness. But what actually is "sharp"? In
Fig. 4a two points of light A and B create two images A' and B'. The back focal length (as previously
shown in Fig. 1d) is set so that the image A' is exactly at the CCD. Now that is sharp!!
Point B is closer to the lens and therefore
image B' lies behind A'. Due to this, the
image of B is an unclear spot on the CCD. The
experts term this as a "blurred spot".

CCD

(a)
A

.. . }

A'

Blur spot

B'

Iris

(b)
A

.
B

Abb. 4: What is sharp?

..

A'

B'

Reduced
blur spot

The above conclusion about what is sharp


would mean it is impossible to focus a threedimensional object. Only one sectional view
of the object would actually be in focus whilst
the rest of the object remained blurred. But
why doesnt this happen in practice? In
reality, our eyes do not register a small
blurred spot as being blurred. This tolerance
of our eyes is the basis for the effect called
"depth of field". In the case of a 35 mm film a
blurred spot smaller than 1/30 mm is
registered as "sharp". In the case of a CCD,
the size of the pixel can be defined as a

blurred spot. As a rule of thumb, the pixel size of a modern CCD is about 5 * 5 m.
In practice, it is rarely necessary to calculate depth of field exactly. Alas, just like the subject "extension
tube or ring" - depth of field is often a matter of belief rather than a matter of fact. Therefore, it is worth
having a closer look at depth of field formula in order to find the corelation:

Limits of depth of field =

Working distance
Working distance - Focal length
1 Blur spot * Iris *
Focal length2

Let us assume we would like to inspect the quality of bolts during the production process using a
megapixel camera DFK 31F03. The diameter of each bolt is 10 mm and the working distance from the
camera is 100 mm. As the DFK 31F03 is equipped with a 1/3" CCD (see Fig. 3) we require a focal length
of

Focal length =

100mm * 3.6mm
= 26.5mm
10mm + 3.6mm

to portray the bolt completely. We could of course use a 25mm off-the-shelf C-mount lens. Assuming a
blurred spot of 5 m we would then have a sharp image in the following area:

100mm
= 99.92mm
100mm - 25mm
1 + 0.005mm * 1.4 *
25mm2
100mm
Far limit of the depth of field =
= 100.08mm
100mm - 25mm
1 0.005mm * 1.4 *
25mm2

Near limit of the depth of field =

Should we require the image to be sharper there is only one thing for it - close the iris.
Let us try an iris of 4

100mm
= 99.76mm
100mm - 25mm
1 + 0.005mm * 4 *
25mm2
100mm
Far limit of the depth of field =
= 100.24mm
100mm - 25mm
1 0.005mm * 4 *
25mm2

Near limit of the depth of field =

Although the F-stop has been increased by a factor of 3 the improvement is nothing significant. This is
caused by the strong influence of the focal length. Should we use a 12 mm lens (and thus halve the focal
length) things would look better:

100mm
= 98.79mm
100mm - 12mm
1 + 0.005mm * 4 *
12mm2
100mm
Far limit of the depth of field =
= 101.23mm
100mm - 12mm
1 0.005mm * 4 *
12mm2

Near limit of the depth of field =

But unfortunately, the image of the bolts would only cover half of the CCD chip. Should the image still
not be acceptable the only adjustment that can be made is to reduce the iris further. This would then
need to be compensated with more light and/or by lengthening the exposure time of the camera.
In conclusion; depth of field is reliant upon 3 parameters:

Blur spot: The smaller the blur spot, the smaller the depth of field.
Iris: The smaller the F-stop (the more "open" the iris), the smaller the depth of field.
6

Focal length: The larger (!) the focal length, the smaller the depth of field. The relationship is
quadratic. Thus, even a small increase of the focal length leads to a considerable decrease of the depth
of field.
As previously mentioned - there are various beliefs regarding depth of field. An especially popular
assumption, is that special forms of lenses (as for instance the so-called telecentric lenses) have a
"better depth of field". But actually, depth of field is dependant upon the following three parameters; blur
spot, iris and focal length.

There is still plenty more to come


For example, about the field of view, close-up lenses, macro lenses, telecentric lenses and above all,
about the amazing fact that images which are slightly out of focus lead to more precise measuring
results. We intend to elaborate on these topics from time to time and to inform you accordingly per
email..............until then, have lots of fun and success.
By the way!! do not forget that we are available to answer any further queries you may have, feel free to
contact us at any time.

Lenses

Selection and setup

In the following we offer some general advice on how to select and setup C and CS mount lenses.
Please find detailed information in the white paper Basic optics.
Please note:
It is the responsibility of an on-site engineer to select and apply lenses in the context of real
applications.
All calculation methods are based on the "thin lens" (an ideal lens). The differences to commercial lenses are negligible in practice. Wide-angle lenses, however, may vary considerably from
the ideal.

Content
Step 1: Calculating the focal length........................................................................2
Examples from various application areas...............................................................3
Step 2: Selecting a lens. .........................................................................................4
Step 3: How to deal with very small working distances........................................5
Step 4: Setup...........................................................................................................6
Special case: Wide-angle lenses............................................................................7
Typical mistakes. .....................................................................................................8
Fixing blurred images..............................................................................................9

EUROPEAN HEADQUARTERS
The Imaging Source Europe GmbH
Sommerstrasse 36,
D-28215 Bremen,
Germany
US HEADQUARTERS
The Imaging Source, LLC
7257 Pineville-Matthews Road,
Charlotte, NC 28226

www.theimagingsource.com/en

All product and company names in this document may be trademarks and tradenames of their respective owners
and are hereby acknowledged.
The Imaging Source Europe GmbH cannot and does not take any responsibility or liability for any information contained in this document. The source code presented in this document is exclusively used for didactic purposes. The
Imaging Source does not assume any kind of warranty expressed or implied, resulting from the use of the content of
this document or the source code.
The Imaging Source Company reserves the right to make changes in specifications, function or design at any time
and without prior notice.
Last update: October 2006
Copyright 2005 The Imaging Source Europe GmbH
All rights reserved. Reprint, also in parts, only allowed with permission of The Imaging Source Europe GmbH.
All weights and dimensions are approximate.

Lenses - Selection and setup

Step 1: Calculating the focal length

The focal length is a lens' pivotal parameter. To represent an object completely on the CCD chip,
we calculate the focal length for the object height and width. The smaller value is our lenses focal
length.

Focal lengthof the width =

Working distance * CCDwidth


Object width + CCDwidth
Working distance * CCD height
Object height + CCD height

CCD height

Object height

Focal lenght of the height =

Working distance

CCD
format

CCD
height

CCD
width

1/4"

2,4

3,2

1/3"

3,6

4,8

1/2"

4,8

6,4

2/3"

6,6

8,8

1"

9,6

12,8

[mm]

Lenses - Selection and setup

[mm]

Examples from various application areas

Barcode recognition:
Object width = 30 mm
Working distance = 300 mm
CCD format = 1/4" (CCD width = 3.2 mm)
Focal length of the width =

300 * 3.2
= 28.9 mm
30 + 3.2

Fruit sorting:
Object height = 200 mm
Working distance = 1000 mm
CCD format = 1/3" (CCD height = 3.6 mm)
Focal length of the height =

1000 * 3.6
= 17.7mm
200 + 3.6

Eye inspection:
Object width = 50 mm
Working distance = 350 mm
CCD format = 1/2" (CCD width = 6.4 mm)
Focal length of the width =

350 * 6.4
= 39.7mm
50 + 6.4

Number plate recognition:


Object width = 600 mm
Working distance = 10000 mm
CCD format = 1/4" (CCD width = 3.2 mm)
Focal length of the width =

10000 * 3.2
= 53 mm
600 + 3.2

Lenses - Selection and setup

Step 2: Selecting a lens

To adjust the focal lengths for the above examples, zoom lenses would be necessary. These lenses, however, have considerable disadvantages
(weight, size, price, etc.). Therefore, usually fixed
focus lenses are used.
To take advantage of quality offered by The
Imaging Source cameras, we recommend the
use of Pentax and Computar MegaPixel series
lenses (see table on the right).

Product code

Format

Focal length

H0514-MP

1/2"

M0814-MP

2/3"

H1214-M(KP)

1/2"

12

C1614-M(KP)

2/3"

16

C2514-M(KP)

2/3"

25

C3516-M(KP)

2/3"

35

C5028-M(KP)

2/3"

50

[mm]

To represent the object completely on the CCD chip we select a lens whose focal length is lower
than the calculated one. That means for our above examples:
Barcode recognition: C2514-M(KP)
Fruit sorting: C1614-M(KP)
Eye inspection: C3516-M(KP)
Number plate recognition: C5028-M(KP)
Please note: The lenses format has to be larger than or equal to the CCD chip's format (cf. Typical
mistakes).

Lenses - Selection and setup

Step 3: How to deal with very small working distances


Especially in the case of small objects, the working distance may be smaller than the selected lenses
minimal working distance (MOD). In this case, we decrease the minimal working distance by putting
extension rings between the lens and the camera. We will see details at Step 4 (Setup). The following
example depicts the selection of an extension ring:
Inspection of a birthmark:
Object width = 5 mm
Working distance = 30 mm
CCD format = 1/4" (CCD width = 3.2 mm)
In this case the focal length is 14.7 mm and thus we select the H1214-M(KP). Its minimal object distance (MOD)
is 0.25 m and thus exceeds considerably the required
working distance of 3 cm. The table below indicates the
use of a 5 mm extension ring.

Ring/tube

Focal length:

Product code

Format

Focal length

MOD

H0514-MP

1/2"

0,1

M0814-MP

2/3"

0,1

H1214-M(KP)

1/2"

12

0,25

C1614-M(KP)

2/3"

16

0,25

C2514-M(KP)

2/3"

25

0,25

C3516-M(KP)

2/3"

35

0,35

C5028-M(KP)

2/3"

50

0,90

[mm]

12 mm

16 mm

25 mm

0.5

12 .. 31 cm

22 .. 54 cm

41 .. 129 cm

1.0

8 .. 15 cm

17 .. 28 cm

32 .. 66 cm

1.5

6 .. 10 cm

14 .. 20 cm

27 .. 45 cm

75 .. 175 cm

5.0

2 .. 3 cm

7 .. 8 cm

14 .. 16 cm

43 .. 59 cm

69 .. 125 cm

9 .. 10 cm

29 .. 34 cm

50 .. 69 cm

23 .. 25 cm

41 .. 50 cm

10.0
15.0

50 mm

[m]

75 mm

20.0

35 .. 41 cm

25.0

30 .. 35 cm

Lenses - Selection and setup

Step 4: Setup

Extension rings

CS Mount

C Mount

Please note: The Imaging Source exclusively manu


factures CS mount cameras. Each of the cameras is
shipped with a 5 mm extension ring.

Product code

Mount

Format

Focal length

MOD

H0514-MP

1/2"

0,1

M0814-MP

2/3"

0,1

H1214-M(KP)

1/2"

12

0.25

C1614-M(KP)

2/3"

16

0.25

C2514-M(KP)

2/3"

25

0.25

C3516-M(KP)

2/3"

35

0.35

C5028-M(KP)

2/3"

50

0.90

[mm]

CS Mount

If Step 3 (How to deal with very small working distances) should have turned out to require an additional
extension ring, simply put it between the camera and
the lens (like a grommet).

C Mount

CS Mount

If you, on the other hand, would like to attach a C


mount lens to a CS mount camera previously simply
screw a 5 mm extension ring into the camera.

C Mount

C Mount

In the field of digital image processing, we have a


standardized lens mount with two variants: C mount
and CS mount. This leads to four combinations (see
image on the right), one of which does not work:
CS mount lenses can not be used with C mount
cameras.

5 mm

CS Mount

optional

[m]

Lenses - Selection and setup

Special case: Wide-angle lenses

Very large objects and/or small working distances often force us to use lenses with very small focal
lengths. The following example depicts the selection of such wide-angle lenses:

Waste sorting:
Object width = 700 mm
Working distance = 500 mm
CCD format = 1/4" (CCD width = 3.2 mm)
In this case the focal length is 2.3 mm and thus one of
the lowest commercially available. Therefore, we use the
Computar T 2314 FICS-3 (see table below).

Computar wide-angle lenses are


used for applications which require
the lowest focal lengths.
Please note: These lenses are only
available as CS mount versions and
therefore can not be used with C
mount cameras (see Step 4: Setup).

Product code

Mount

Format

Focal length

MOD

T 2314 FICS-3

CS

1/3"

2.3

0.2

T 0412 FICS-3

CS

1/3"

0.2

[mm]

[m]

Please note: The optical quality of wide-angle lenses falls short of the quality of "normal" lenses.
This may be a crucial point in the context of visualization purposes and/or customer presentations
since a bad image quality often rubs off on the complete system.

Lenses - Selection and setup

Typical mistakes
The bewildering variety of optical components, as well as "historical legacy issues" originating from
the world of picture tubes, lead to different mistakes when selecting these components. In the
following you will find the three most basic misunderstandings:

Incorrect: The lens format and the camera format have to be identical.
Correct: The lens format should preferably be larger than the CCD format since optical flaws
appear at the rim of the lens.

Incorrect: If the lens format is larger than the CCD format it has to have a larger/smaller focal
length.
Correct: The focal length exclusively depends on the CCD format, the working distance and the
object size (please see Step 1: Calculating the focal length).

Incorrect: Extension rings increase/decrease the depth of field.


Correct: Extension rings decrease the minimal working distance (please see Step 3: How to deal
with very small working distances).

Lenses - Selection and setup

Fixing blurred images


There are two basic reasons for blurred images:
The lens quality is lower than the quality of modern CCD chips. The Pentax M Series recommended in this white paper (please see Step 2: Selecting a lens) has been especially designed
to work with modern CCD chips. Wide-angle lenses, however, have weaknesses due to their
construction (please see Special case: Wide-angle lenses).
The lens setup is incorrectly arranged. This usually leads to extremely blurred images. In such
cases please proceed as follows:

CS Mount

Please check whether a 5 mm extension ring has been


screwed between the camera and the lens. The Imaging
Source exclusively manufactures CS mount cameras.
Each of the cameras is shipped with a 5 mm extension
ring.

C Mount

C Mount lens / CS Mount camera:

5 mm
Extension ring

CS Mount

If you have accidentally screwed a 5 mm extension ring


between the camera and the lens, you will only be able
to focus on close objects.

CS Mount

CS Mount lens / CS Mount camera:

"Sticking" extension rings:

"Sticking"
extension rings

C Mount

This configuration only allows to focus on very close


objects. If this is not your aim, then you have to use a CS
mount camera. The Imaging Source exclusively manufactures CS mount cameras.

CS Mount

CS Mount lens / C Mount camera:

If you previously have used the camera or the lens with


a thin extension ring, it often "sticks" to either of them.
In such cases you are not able to focus to infinity for no
apparent reason.

Lenses - Selection and setup

You might also like