Archives

D F N

Depth of Field

range in working distance for which the image is (acceptably) focused.

Image: Depth Of Field

Depth Of Field

DOF =  Far PointNear Point

The largest depth of field (namely infinity) we get when we focus the lens to the so called hyperfocal distance. The focus extends from H/2 to infinity.

see also Bokeh


far point

Most distant point on the optical axis with an image of “acceptable sharpness”

FarPoint= \frac{(FocalLength^2 \cdot ObjectDistance)}{(FocalLength^2 - F\#  \cdot CoC \cdot (ObjectDistance-FocalLength))}

Where CoC is the Circle of Confusion (the largest accepted Airy-disk) in Millimeter.

Alternatively, we can express the FarPoint using the magnification M :

FarPoint = \frac{(FocalLength^2 \cdot (M + 1))}{(FocalLength \cdot M - F\# \cdot CoC )}

If we use for example a 1/2.5″ 5 Aptina Megapixel greyscale Sensor mit 2.2\mu pixel pitch, we can use the pixel diagonal as CoC for crisp images, say CoC = 2.2\mu \cdot \sqrt{2} = 3.1 \mu = 0.0031mm
A 5 Mega lens with f=7.2mm focal length and F-stop F2.4, focused to an object distance of 100mm then has a far point of
FarPoint = \frac{((7.2mm)^2 \cdot 100mm)}{((7.2mm)^2 - 2.4 \cdot 0.0031mm \cdot (100mm-7.2mm))} = 101.35mm
und einen Nahpunkt von
NearPoint = \frac{((7.2mm)^2 \cdot 100mm)}{((7.2mm)^2 + 2.4 \cdot 0.0031mm \cdot (100mm-7.2mm))} = 98.69mm
and thus DOF = FarPoint - NearPoint = 2.66mm
If instead we use a 5 Megapixel greyscale Sony Sensor with 3.45\mu pixel pitch, we can choose as CoC the diagonal of the pixel for crisp images, say CoC = 3.45 \cdot \sqrt{2} = 4.86 \mu = 0.00486mm
A 5 Mega lens with f=7.2mm focal length and F-stop F2.4, focussed to 100mm then results in
FarPoint = \frac{((7.2mm)^2 \cdot 100mm)}{((7.2mm)^2 - 2.4 \cdot 0.00486mm \cdot (100mm-7.2mm))} = 102.13mm
und einen Nahpunkt von
NearPoint = \frac{((7.2mm)^2 \cdot 100mm)}{((7.2mm)^2 + 2.4 \cdot 0.00486 \cdot (100-7.2))} = 97.95
thus we get DOF = FarPoint - NearPoint = 4.18mm
If we use a color sensor instead we can use CoC=2 \cdot PixelSize for crisp images. For the two sensors above we then get:
DOF_{5 Mega Aptina} = 101.93mm - 98.14mm = 3.78mm
DOF_{5 Mega Sony} = 103.06mm - 97.11mm = 5.93mm
To increase the DOF we can increase the Pixel Size, but we either lose resolution, or (at the same pixel count) the magnification changes)
If you change the focal length of a lens in a way, that (with the same sensor) you get the same FOV (then from a different distance) this results in the same DOF !!!
see also https://www.optowiki.info/blog/can-i-increase-the-dof-by-changing-the-focal-length/
When a lens is focussed to the hyperfocal distance H, the far point is at \infty and the near point is at \frac{H}{2}.
The DOF is \infty then, thus focussing to the hyperfocal distance results in the largest possible DOF.

near point

closest point on optical axis with an image that has „acceptable sharpness“

NearPoint = \frac{(FocalLength^2 \cdot ObjectDistance)}{(FocalLength^2 + F\# \cdot CoC \cdot (ObjectDistance - FocalLength))}

Where CoC is the Circle of Confusion (the largest accepted Airy-disk) in Millimeter.

Alternatively, we can express the NearPoint using the magnification M :

NearPoint = \frac{(FocalLength^2 \cdot (M + 1))}{(FocalLength \cdot M + F\# \cdot CoC )}

If we use for example a 1/2.5″ 5 Aptina Megapixel greyscale Sensor mit 2.2\mu pixel pitch, we can use the pixel diagonal as CoC for crisp images, say CoC = 2.2\mu \cdot \sqrt{2} = 3.1 \mu = 0.0031mm
A 5 Mega lens with f=7.2mm focal length and F-stop F2.4, focused to an object distance of 100mm then has a far point of
FarPoint = \frac{((7.2mm)^2 \cdot 100mm)}{((7.2mm)^2 - 2.4 \cdot 0.0031mm \cdot (100mm-7.2mm))} = 101.35mm
und einen Nahpunkt von
NearPoint = \frac{((7.2mm)^2 \cdot 100mm)}{((7.2mm)^2 + 2.4 \cdot 0.0031mm \cdot (100mm-7.2mm))} = 98.69mm
and thus DOF = FarPoint - NearPoint = 2.66mm
If instead we use a 5 Megapixel greyscale Sony Sensor with 3.45\mu pixel pitch, we can choose as CoC the diagonal of the pixel for crisp images, say CoC = 3.45 \cdot \sqrt{2} = 4.86 \mu = 0.00486mm
A 5 Mega lens with f=7.2mm focal length and F-stop F2.4, focussed to 100mm then results in
FarPoint = \frac{((7.2mm)^2 \cdot 100mm)}{((7.2mm)^2 - 2.4 \cdot 0.00486mm \cdot (100mm-7.2mm))} = 102.13mm
and a nearpoint of
NearPoint = \frac{((7.2mm)^2 \cdot 100mm)}{((7.2mm)^2 + 2.4 \cdot 0.00486 \cdot (100-7.2))} = 97.95
thus we get DOF = FarPoint - NearPoint = 4.18mm
If we use a color sensor instead we can use CoC=2 \cdot PixelSize for crisp images. For the two sensors above we then get:
DOF_{5 Mega Aptina} = 101.93mm - 98.14mm = 3.78mm
DOF_{5 Mega Sony} = 103.06mm - 97.11mm = 5.93mm
To increase the DOF we can increase the Pixel Size, but we either lose resolution, or (at the same pixel count) the magnification changes)
If you change the focal length of a lens in a way, that (with the same sensor) you get the same FOV (then from a different distance) this results in the same DOF !!!
see also https://www.optowiki.info/blog/can-i-increase-the-dof-by-changing-the-focal-length/
To increase the DOF we can keep the working distance and the pixel size while reducing the sensor size, but then we lose resolution (because less of the same size pixels fit on the now smaller sensor)
When a lens is focussed to the hyperfocal distance H, the far point is at \infty and the near point is at \frac{H}{2}.
The DOF is \infty then, thus focussing to the hyperfocal distance results in the largest possible DOF.

Yet another way to express the Near-Point is to use the Hyperfocal distance H :
H = \frac{f^2}{F \cdot CoC} + f

If the lens is then focused to some object distance OD, this OD can be expressed as fraction of H :

OD = \frac{H}{x}

or

x = \frac{H}{OD}

Then the near point is
NearPoint = \frac{H}{x+1},

the far point is
FarPoint = \frac{H}{x-1}

and the Depth of field is
DOF = FarPoint - NearPoint = \frac{H}{x-1} - \frac{H}{x+1}

When we set the object distance OD to the hyperfocal distance H, we get:
OD = H
Therefore from
x = \frac{H}{OD}
we get
x = 1.
This means however, that
FarPoint = \frac{H}{x-1} = \infty
and therefore,
DOF = FarPoint - NearPoint = \infty - H/2 = \infty
For a lens with f=12mm, F#=2.8 and a CoC of 3.1um we get
H = \frac{12^2}{2.8 \cdot 0.0031} + 12 = 16602mm

For OD = 200mm we get
x =  \frac{H}{OD} =   \frac{16602}{200} = 83.01mm
So, with
FarPoint = \frac{H}{x-1} = \frac{16602mm}{83.01mm-1mm} = 202.44
and
NearPoint = \frac{H}{x+1} - \frac{16602mm}{83.01mm+1mm} = 197.62
we get
DOF = FarPoint - NearPoint = 202.44 - 197.62 = 4.82mm

For OD = 100mm we get
x =  \frac{H}{OD} =   \frac{16602}{100} = 166mm
So, with
FarPoint = \frac{H}{x-1} = \frac{16602mm}{166mm-1mm} = 100.62
and
NearPoint = \frac{H}{x+1} - \frac{16602mm}{166mm+1mm} = 99.41
we get
DOF = FarPoint - NearPoint = 100.62 - 99.41 = 1.21mm

Therefore by decreasing the OD by factor 2, the DOF decreased by factor 4.

When the magnification increases by factor 2, the DOF decreases by factor 4

or, equivalent :

When the object distance decreases by factor 2, the DOF decreases by factor 4