Does the F/2.0 phone camera match the F/2.0 DSLR’s optical resolution?

Summary: Most cellphone cameras today come with “large aperture” lens such as F/2.0 or F/2.2. Since the optical resolution of a “perfect” lens (a lens devoid of any aberration) is inversely proportional to the F/# (the relation is shown in equation 1), one may assume that a F/2.0 cellphone camera lens should be able to resolve fine details on an object as well as a F/2.0 DSLR lens.

\Delta_r = \frac{1}{1.22 \lambda F/\#}         (1)

where, F/\# = f/D , f is the focal length, and D is the aperture diameter of the lens.

cellPhoneLensVsDSLRLensw

The above image shows two lenses of same F/#, and also of equal normalized focal length. The one on the left is a lens whose 35 mm focal length is about 28 mm (with complete camera module, including the image sensor) from a cellphone, and the lens on the right is a 28 mm DSLR lens.

The optical resolution of a lens determines how close two line-objects or point-objects be placed before the objects cannot be distinguished from each other when viewing through the lens. The minimum resolvable separation, \Delta_s, is the inverse of \Delta_r. The larger the value of \Delta_r (usually measured in line-pairs-per-mm), the better is the resolving ability of the lens. So if the f-number, F/\#, of a cellphone lens matches the F/\# of a DSLR lens, then the equation (1) seems to suggest that they have the same optical resolution! However, as it is shown in the following paragraphs, the ability to resolve fine details of a F/2.0 DSLR lens is in fact much better than a F/2.0 cellphone camera lens. Concretely, if the focal length and the aperture diameter of the cellphone lens is 1/k (k>1) times the respective parameters of the DSLR lens, then the  F/\# of the two systems are equal but the resolving ability of the cellphone lens is 1/k times that of the DSLR lens. For example, a 50 mm, F/2.0 lens (D = 25 mm), which is a first order approximation of a 50 mm DSLR lens, can resolve details as fine as 54 microns focused at a distance of 2 meters. Whereas a 5 mm, F/2.0 lens (D = 2.5 mm), a close approximation of a typical cellphone camera lens, can resolve details only up to about 540 microns focused at the same distance. This is essentially a manifestation of the difference in magnifications (or angular resolution) of the lenses.

Please read the rest of the article for details. 

One must be aware that equation (1) represents the lateral resolution measured on the image plane of the camera. In order to compare resolutions of these two lenses in terms of the ability to resolve fine details on a scene, we must either compare their angular resolutions or compare their lateral resolutions on the object plane (as opposed to image plane) that is in focus. The angular resolution is a better option for comparison since it is independent of the image and object distances. However, the lateral resolution, defined as the minimum separable distance, is more tangible (IMHO) than the resolution stated in terms of angles. Hence, I will use the lateral resolution for comparison in this article.

Without any loss of generality, we may consider the cellphone lens to be a “scaled” version a DSLR lens. Scaling the original lens will change the focal length and the aperture diameter, but keep the F/\# constant. The scaling factor, k, is the ratio of the DSLR camera (original camera) focal length to the cellphone camera (scaled system) focal length, i.e. k = f_{original} / f_{scaled} . It is also equal to the ratio of the aperture diameters, i.e. k = D_{original} / D_{scaled} . With this framework, we can now ask the question:

How does lens scaling affect optical resolution?

Before proceeding any further, I must state that here we are interested in the aberration-free optical resolution, also known as diffraction-limited resolution. Let’s now consider the following figure. The object plane is on the left-hand-side of the lens, and the image plane is on the right-hand-side of the lens. The original lens (for example, a DSLR lens) is scaled to produce the cellphone lens such that the F/\# (= f/D) , and the resulting lateral resolution on the image plane as predicted by equation (1) are same for both lenses.

Schematic

Following is a very simple derivation of the relations that we are interested in.

Derivation

For very large object distances, the image plane distances for both lenses approaches their respective focal lengths and k' approaches the scaling factor k defined as the ratio of the original (DSLR) lens focal length to the scaled lens (cellphone camera) focal length, i.e. k = f_{original} / f_{scaled} . 

I have implemented the above equations using Python to play with actual numbers. Here is the code (please feel free to re-use it as you may like).

[Please note that sometimes wordpress fails to embed the code. If you don’t see the Python code below, you can view/download it directly from the gist]

# -*- coding: utf-8 -*-
"""
File: simpleLensScaling.py
Purpose : Calculate two-point resolution using Rayleigh criterion and
study the effect of lens scaling on Rayleigh resolution.
Assumption: First order optical analysis, specifically they are:
1. The system is diffraction limited (aberrations are not considered)
2. The aperture is circular
3. A simple single lens system is considered, thus
a. the entrance pupil diameter = exit pupil diameter = aperture diameter
b. apply simple lens equation to find distance and magnification relationships
Created on Thu Aug 01 14:18:27 2013
Author: Indranil Sinharoy
License : MIT License
"""
from __future__ import division, print_function
from math import atan, pi
class camera(object):
"""a camera class"""
def __init__(self, lens=None, sensor=None):
self.lens = lens
self.sensor = sensor
self.fov_width = -1.0
self.fov_height = -1.0
def setObjDist(self, distance):
"""set the distance of the camera from the object plane in mm"""
self.lens.setObjDist(distance)
def calculateFOV(self):
"""returns the field-of-view of the camera"""
if self.lens and self.sensor:
img_w = self.sensor.width
img_h = self.sensor.height
img_z = self.lens.getImgDist()
self.fov_width = 2.0*atan((img_w/2.0)/img_z)*180.0/pi
self.fov_height = 2.0*atan((img_h/2.0)/img_z)*180.0/pi
return (self.fov_width, self.fov_height)
else:
print("Can't calculate FOV. Attach a lens and sensor to the camera")
return
class lens(object):
"""lens class, described by focal length, `f` mm, and aperture diameter, `D` mm.
The aperture is assumed to be circular.
"""
def __init__(self, f, D):
self.f = f # focal length in mm
self.D = D # aperture diameter in mm
self.Fnum = f/D # F/#
self.z_o = None # object distance in mm
self.latMag = None # lateral magnification
self.effFnum = None # effective F/#
def setObjDist(self,z_o):
"""sets the object distance z_o (mm)"""
self.z_o = z_o # set an object distance
self.z_i = self.getImgDist(z_o) # image distance for the set object distance
self.latMag = self.z_i/self.z_o # calculate lateral magnification
self.effFnum = self.z_i/self.D # calculate effective F/#
def getImgDist(self, zo=None):
"""returns the image distance for a particular object distance `zo` (which
might be different from `z_o`, the set object distance). If `zo=None`, then
the returned image distance is for the set object distance. If the object
distance has not been set, then the object distance is assumed to be infinity
and the image distance is equal to the focal length.
"""
if zo:
zi= self.f*zo/(zo-self.f)
elif not zo and self.z_o:
zi= self.f*self.z_o/(self.z_o-self.f)
elif not zo and not self.z_o:
zi = self.f
return zi
def getMinResolvSepImgPlane(self,lamda=550e-6):
"""returns the minimum resolvable separation of the geometrical image points
The default wavelength is 550 nm or 550e-6 mm
"""
deltaSi = 1.22*lamda*self.effFnum
return deltaSi
def getMinResolvSepObjPlane(self,lamda=550e-6):
"""returns the minimum resolvable separation of the geometrical image points
The default wavelength is 550 nm or 550e-6 mm
"""
deltaSo = self.getMinResolvSepImgPlane(lamda)/self.latMag
return deltaSo
def getLatRayleighResImgPlane(self,lamda=550e-6):
"""returns the lateral resolution in the image plane"""
deltaRi = 1.0/self.getMinResolvSepImgPlane(lamda)
return deltaRi
def getLatRayleighResObjPlane(self,lamda=550e-6):
"""returns the lateral resolution in the object plane"""
deltaRo = 1.0/self.getMinResolvSepObjPlane(lamda)
return deltaRo
def scaleLens(self,factor=0.5):
"""returns a scaled lens object"""
return lens(self.f*factor, self.D*factor)
class sensor(object):
"""a very simple sensor class"""
def __init__(self, width=36.0, height=24.0):
self.width = width
self.height = height
def scaleSensor(self, factor=0.5):
"""scale the dimensions of the sensor by the given factor and return
a new sensor object"""
return sensor(self.width*factor, self.height*factor)
if __name__ == "__main__":
print("Study the effect of Lens Scaling on Diffraction limited resolution:")
# Test the camera class
object_distance = 2000.0 # Object distance = 2 meters
lensA = lens(50.0, 25.0) # lensA, focal length=50mm, aperture diameter = 25 mm
sensorA = sensor(36.0, 24.0)
cameraA = camera(lensA, sensorA)
cameraA.setObjDist(object_distance)
print("Lens A: f = %1.4g, D = %1.4g, F/# = %1.4g, eff F/# = %1.4g" %
(lensA.f, lensA.D, lensA.Fnum, lensA.effFnum))
print("Lens A: minimum resolvable separation on image plane = %1.5g microns" %
(lensA.getMinResolvSepImgPlane()*1000.0))
print("Lens A: minimum resolvable separation on the object plane = %1.5g microns" %
(lensA.getMinResolvSepObjPlane()*1000.0))
print("Camera A: field of view (degrees): horizontal = %1.4g, vertical = %1.4g" %
(cameraA.calculateFOV()[0], cameraA.calculateFOV()[1]))
print("\nCreate a scaled camera B")
# scale lens by a factor of 1/10 and place the scaled lens at the same distance
lensB = lensA.scaleLens(1.0/10)
lensB.setObjDist(object_distance)
sensorB = sensorA.scaleSensor(1.0/10)
cameraB = camera(lensB, sensorB)
print("Lens B: f = %1.4g, D = %1.4g, F/# = %1.4g, eff F/# = %1.4g" %
(lensB.f, lensB.D, lensB.Fnum, lensB.effFnum))
print("Lens B: minimum resolvable separation on image plane = %1.5g microns" %
(lensB.getMinResolvSepImgPlane()*1000.0))
print("Lens B: minimum resolvable separation on the object plane = %1.5g microns" %
(lensB.getMinResolvSepObjPlane()*1000.0))
print("Camera B: field of view (degrees): horizontal = %1.4g, vertical = %1.4g" %
(cameraB.calculateFOV()[0], cameraB.calculateFOV()[1]))

Executing the above code will give the following output. (Here, Camera A is an example of a DSLR camera/lens, and Camera B is a scaled version of Camera A with k=10, representing a typical cellphone camera)

Study the effect of Lens Scaling on Diffraction limited resolution:
Lens A: f = 50, D = 25, F/# = 2, eff F/# = 2.051
Lens A: minimum resolvable separation on image plane = 1.3764 microns
Lens A: minimum resolvable separation on the object plane = 53.68 microns
Camera A: field of view (degrees): horizontal = 38.68, vertical = 26.34

Create a scaled camera B
Lens B: f = 5, D = 2.5, F/# = 2, eff F/# = 2.005
Lens B: minimum resolvable separation on image plane = 1.3454 microns
Lens B: minimum resolvable separation on the object plane = 536.8 microns
Camera B: field of view (degrees): horizontal = 39.51, vertical = 26.93

In the above example, Camera A (with Lens A) and Camera B (with Lens B) have the same the F/# = 2.0. However, Camera A can resolve fine details with minimum separation of 53.68 microns while Camera B can only resolve fine structures up to 536.8 microns.

Conclusion:

In my opinion a cellphone camera can never replace a DSLR camera if the image quality and resolution is of any importance!

NOTES:

  1. The aberration-free optical resolution considered in this article is just one of the many parameters that determine image quality. No lens is perfect. Hence a complete comparison can only happen when aberrations are considered. In addition, we should also compare the pixel resolution and sensor noise for a complete picture. That, I hope, will be a topic for another day.
  2. If anyone is interested in understanding the scaling effects on aberrations and space-bandwidth product, there is a nice little paper by Adolf W. Lohmann, called “Scaling laws for lens systems” for reference.
  3. The expression for the angular resolution is obtained by multiplying equation (1) by Z_i. The resulting expression is proportional to the ratio of the aperture diameter and the wavelength. For more on angular resolution please see the wikipedia entry on angular resolution.
Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s