Docsity

Understanding Camera Technology: Optics, Image Capture, and Manipulation in Smartphones, Lecture notes of Physics

Toggle sidebar
bg1
Page ! of !1 10
Abbreviations: CCD; Charge Coupled Device, CMOS; Complementary
Metal Oxide Semiconductor, (D)SLR; (Digital) Single Lens Reflex, OIS;
Optical Image Stabilisation, ADC; Analog-to-Digital Converter, CFM;
Colour Filter Mosaic, JPEG; Joint Photographic Experts Group (file), RGB;
Red Green Blue (sensors, etc)
I. INTRODUCTION
This article, “How a Camera on a Mobile Phone
Works”, describes how the camera on a modern
smartphone operates in order to capture an image and
how the mobile phone processes, stores and optimises
this image. Three separate sections explore the
functions of a cameraphone, following the order in
which the smartphone captures, processes, optimises,
manipulates and stores an image.
The first of these sections is titled ‘Optics’ and deals
with the function of lenses in capturing an image,
including the effects of varying focal lengths and the
power of lenses as well as the focussing mechanisms
used by most modern smartphone cameras. The second,
‘Capturing An Image’, explains auto-focus, factors
involved in capturing an image and the function of
sensors in reading and interpreting an image. The third
and final section, ‘Image Manipulation & Storage’,
briefly discusses techniques used in changing the
appearance of this image as well as the methods used in
compressing images to maximise the number of images
that can be stored at a time.
Section One Optics II
The lenses used in the cameras of mobile phones are
very similar to those used in SLRs and DSLRs. A
convex lens causes parallel light rays to converge to a
single point, known as the focal point, to form an image
through the process of refraction. The distance from the
lens to the focal point is known as the ‘focal length’.
The more powerful the lens, the shorter the focal length
is and so the closer the image appears [Eq. 1].
The image formed through a lens [Fig. 1] appears
upside down as the rays of light
pass through the lens to the opposite side.
Convex Lens
How Does a Camera on a Mobile Phone
Work?
Edward Sheppard, S5 - Physics, JAS & RJS King Edward VI School Southampton
Abstract — This article attempts to explain how a mobile phone camera works. This includes
the physics of its lenses and sensor technology. It also briefly explains how images can be
manipulated and stored by camera hardware. The article simplifies the main differences
between larger DSLRs or compact cameras and cameraphones in capturing images.
Fig 1. Ray Diagram of a Convex Lens
P=1
f
Eq. 1
19th November 2018
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Understanding Camera Technology: Optics, Image Capture, and Manipulation in Smartphones and more Lecture notes Physics in PDF only on Docsity!

Abbreviations: CCD; Charge Coupled Device, CMOS; Complementary Metal Oxide Semiconductor, (D)SLR; (Digital) Single Lens Reflex, OIS; Optical Image Stabilisation, ADC; Analog-to-Digital Converter, CFM; Colour Filter Mosaic, JPEG; Joint Photographic Experts Group (file), RGB; Red Green Blue (sensors, etc) I. INTRODUCTION This article, “How a Camera on a Mobile Phone Works”, describes how the camera on a modern smartphone operates in order to capture an image and how the mobile phone processes, stores and optimises this image. Three separate sections explore the functions of a cameraphone, following the order in which the smartphone captures, processes, optimises, manipulates and stores an image. The first of these sections is titled ‘Optics’ and deals with the function of lenses in capturing an image, including the effects of varying focal lengths and the power of lenses as well as the focussing mechanisms used by most modern smartphone cameras. The second, ‘Capturing An Image’, explains auto-focus, factors involved in capturing an image and the function of sensors in reading and interpreting an image. The third and final section, ‘Image Manipulation & Storage’, briefly discusses techniques used in changing the appearance of this image as well as the methods used in compressing images to maximise the number of images that can be stored at a time.

Section One Optics II

The lenses used in the cameras of mobile phones are very similar to those used in SLRs and DSLRs. A convex lens causes parallel light rays to converge to a single point, known as the focal point, to form an image through the process of refraction. The distance from the lens to the focal point is known as the ‘focal length’. The more powerful the lens, the shorter the focal length is and so the closer the image appears [Eq. 1]. The image formed through a lens [Fig. 1] appears upside down as the rays of light pass through the lens to the opposite side. Convex Lens

How Does a Camera on a Mobile Phone

Work?

Edward Sheppard, S5 - Physics, JAS & RJS King Edward VI School Southampton Abstract — This article attempts to explain how a mobile phone camera works. This includes the physics of its lenses and sensor technology. It also briefly explains how images can be manipulated and stored by camera hardware. The article simplifies the main differences between larger DSLRs or compact cameras and cameraphones in capturing images. Fig 1. Ray Diagram of a Convex Lens

P =

f

Eq. 1 P = Power of a lens f = Focal length (note: ‘f’ is also used for wave frequency) 19 th^ November 2018

However, a convex lens alone is not enough to cause light to converge precisely onto this focal point. This is because the light that enters through the centre of a single convex lens focusses at a slightly different distance to light that passes through the edge of the lens, i.e. they have different focal lengths. The result is called ‘Spherical Aberration’ and causes a blurry image. A similar effect, known as ‘Chromatic Aberration’, occurs amongst different wavelengths, and therefore colours, of light. Red light has a comparatively long wavelength and so has a larger focal length than blue light, which has a smaller wavelength. This leads to colours in the image appearing to shift [Fig. 2]. To correct Spherical Aberration, a concave lens is added behind the convex lens. The direction in which spherical aberration occurs in a concave lens is opposite to the direction it occurs in a convex lens. This causes light at the edges of the convex lens to refract slightly less and so the focal points of separate light rays move closer together so that the image appears in focus. Chromatic aberration can also be corrected with the combination of at least two lenses with different refractive indexes. This works because a material with a higher refractive index causes a slower wave speed. v = λf Eq. 2 shows that the greater the refractive index, the slower light travels in the material. However, the velocity of light in a material, v 2 , and therefore its refractive index, n, varies depending on the wavelength of the light, λ [Eq. 3]. Hence lenses have different refractive indexes for different wavelengths of light [Eq. 4]. An ‘achromatic lens’, in which a minimum of two materials with varying dispersion are added together to form a compound lens, can be used to minimise chromatic aberration. An achromatic doublet, made of crown glass and flint glass [Fig. 3] can be used to reduce the amount of chromatic aberration over a range of wavelengths. In mobile phones, high quality plastics of varying density are often used. The positive power of the crown lens element is slightly larger than the opposite negative power of the flint lens element. Therefore, a weak positive lens is formed that brings different wavelengths of light to a common focus. The angle of refraction for green light is increased by the crown glass, which has relatively low dispersion and is a convex/converging lens (to ‘bend’ light towards the focal plane). Then the overall effect of refraction is slightly reduced by the flint glass, which has relatively high dispersion and is a concave/diverging lens, so that the green light focusses closer to the focal point of red light. The same effect occurs for blue light but because it has a smaller wavelength than green light, the overall effect of refraction is reduced more [Eq. 4]. This causes the focal length of the blue light to become longer, Fig 2. Chromatic Aberration n = v 1 v 2 n = refractive index v 1 = speed of light in a vacuum v 2 = speed of light in material n = λ 1 λ v = wave speed λ = wavelength in material (or vacuum [eq. 2]) f = wave frequency n = refractive index λ 1 = wavelength in a vacuum Eq. 4 Eq. 3 Fig 3. Chromatic Correction With an Achromatic Doublet Eq. 2

The primary downside to contrast-detection auto-focus is that the lens goes past the focal point before returning to optimum focus, resulting in reasonably slow focussing speeds. This is because the phone does not know where the highest level of contrast is until it scans beyond this point. This results in the image briefly becoming blurry before re-focussing. Further, low-light conditions can cause issues with contrast detection and moving objects cannot be tracked. Phase-detection auto-focus is a more modern method used in newer flagship smartphones. Phase-detection auto-focus involves comparing light from two apertures on opposite sides of the lens. At the point of optimum focus, the intensity profiles of the two light rays will align. This method allows the system to precisely determine how much the image distance needs to be adjusted, without shifting the lens in and out of focus. As a result, phase-detection auto-focus is much faster than contrast-detection autofocus. Samsung claims that the Samsung Galaxy S5, and subsequent models, can focus an image in less than 0.3 seconds using phase- detection auto-focus [Fig. 6]. Although this method is faster than contrast-detection auto-focus, and continuous tracking is possible, it still works poorly in low-light conditions as it relies on being able to analyse light entering the lenses. The third, and least common, focussing method doesn’t rely on the analysis of light utilised by contrast- and phase-detection auto-focus (methods that are termed ‘passive-autofocus’). Instead, laser auto-focus (termed ‘active auto-focus’) involves the phone emitting its own beam of infrared light towards the object. The time for the light to be reflected [Eq. 5], and hence the distance from the phone to the object [Eq. 6], can then be calculated. ! ! Laser auto-focus is exceptionally fast (the LG G4 takes 0.276 seconds to focus an image according to LG) and works well in low-light conditions. This is because it doesn’t rely on light coming from the object. The major downside to this system is its inability to focus on objects a long way away because the reflections are too weak. As a result, phones with laser-focus technology also utilise either contrast-detection or phase-detection auto-focus. There are several key factors that affect how an image is captured. They include focal length, aperture, shutter speed and ISO (camera sensitivity). These elements work together to vary exposure, magnification, depth of field, focus and a few other more minor factors. Focal length controls how ‘zoomed in’ (or out) shots will be. A longer focal length will result in a more ‘zoomed in’ image whereas a shorter focal length will result in a ‘wide’ image. The focal length of a thin lens can be found with the object distance, u, and the image distance, v [Eq. 7]. The object distance is always negative as the object is to the ‘left’ of the lens. d = vt u = d 2 Fig 6. Phase-Detection Auto-Focus Eq. 5 Eq. 6 d = distance travelled by laser beam v = speed of light t = time to receive reflected beam u = object distance Eq. 7 f = focal length u = object distance v = image distance 1 f = 1 u

1 v

Aperture is a mechanism that controls how much light passes through the lens. Aperture controls depth of field (how much of the shot is in focus). A narrow aperture means that a lot of the image is focussed. Narrow apertures were used in some of the earliest cameraphones because they allowed the entire image to be in focus so that lenses didn’t need to move. The lower the ƒ-stop (which means aperture priority), the wider the aperture is. This is because the ƒ-stop is a ratio of the focal length divided by the aperture opening. For example, a lens with a 58mm focal length and an opening of 10mm will be listed as ƒ/5.8. This number tells us how much light reaches the sensor. However, the same aperture ratio on sensors of different sizes will not let in the same amount of light. The small sensor on the iPhone 6s, for example, has a diagonal measurement of about 8.3mm. If the aperture of the camera is ƒ/2.2, the depth of field would be equivalent to the depth of field of a full-frame camera with an ƒ-stop nearer ƒ/13. This means that the background is almost completely in focus. Some newer phones use software to artificially create a bokeh effect or even laser-detection auto-focus to blur the background of an image. Another major difference in the way phone cameras operate, compared to SLRs or DSLRs, is the shutter. The shutter speed is an important aspect in correctly exposing an image. A shutter speed that is too slow leads to blurry image whereas a shutter speed that is set too fast risks underexposing the image. Similar to aperture, the shutter speed is measure in ‘stops’ which mark a change in light hitting the sensor by 2x. This means that a 1/60th second exposure is one stop brighter than a 1/120th second exposure. Teen Cameraphones use an electronic shutter (sometimes referred to as an E-shutter) as a mechanical shutter would be too large for the tiny amount of space available for the cameras of smartphones. Shutter speed changes the exposure because the longer the shutter is open for (ie. the slower the shutter speed), the more light reaches the sensor. In order to capture fast-moving objects, such as birds or cars, a fast shutter speed is used in order to minimise blur in the image. A slow shutter speed is used to capture long-exposure images at night in order to allow more light in over a period of time. The issue with using slower shutter speeds is that it exaggerates the effects of the shake that results from hand-holding a camera. To limit the blur that occurs from this, some phones use optical image stabilisation (OIS). OIS is where the sensor or lenses are moved in certain ways to counteract unwanted movements. Tripods or monopods can also be used with DSLRs, particularly when taking long-exposure images, to minimise movement. Increasing camera sensitivity (ISO) amplifies the signal it records in order to make the picture brighter. This, however, increases shot noise. Shot noise, also known as Poisson Noise, appears as many multicoloured dots or grainy black and white errors on an image. This is because how bright an image appears is relative to the level of photons that hit the subject, and therefore the level of photons being recorded by the sensor. The lower the level of light that hits the subject, the more the sensor has to apply ‘gain’ (a measure of the increase in amplitude of the signal) to create a well exposed image. This leads to small variations in pixel readings being exaggerated and becoming much more visible. Fig 7. Optical Image Stabilisation for an iPhone Camera Fig 8. The Effect of Poisson Noise

Filters Sensor Filters

Section Three Image Manipulation & Storage

After an image has been formed by the sensor, the phone’s software processes and manipulates it in order to enhance the picture we see. Some image manipulation is done as standard by the phone in order to optimise images, however, images can be edited further by the phone’s user in order to increase or decrease contrast and exposure, detect and enhance edges and modify colours. Here we will focus on smoothing and edge detection. Digital images captured by smartphone cameras are made up of pixels, with the value of each pixel representing its colour. For this example, we will use a n 8-bit greyscale image. The 8-bits give us a total of 256 different values/tones of grey, ranging from 0-256. 0 represents white and 255 represents black, all the tones in-between these values represent different intensities of grey. Fig 12. Sensor - Expanded View Bayer Filter RGBW Bayer RGBE Filter CYYM Filter CYGM Filter X-Trans Filter A very common RGB (Red Green Blue) filter. With one blue and one red filter for every two green filters. Similar to a Bayer Filter except with white filter elements. Similar to both RGBW & Bayer Filter except with one of the green filters replace with ‘emerald’. One cyan, two yellow and one magenta filter element. Used by some Kodak cameras. One cyan, one yellow, one green and one magenta. Fujifilm RGB matrix filter (with a 6x pattern).

This image (above) includes an edge and some random noise. In order to smooth the image, two methods; mean smoothing and median smoothing, can be used. Mean smoothing attempts to reduce noise by taking a mean average of all the pixels surrounding each pixel and itself. This mean average level then replaces the previous value of the pixel. For example, the previous value 255 has been replaced with the mean average of the five surrounding 000 s, and itself, to equal 043. Mean Smoothing (above) The major downside to this method is that it has the affect of slightly blurring the image by making edges less prominent. An alternative method is median smoothing. Here, the median average of a pixel’s surrounding values is taken. In this example, 255 has been replaced with the median average of the five surrounding 000 s and itself. This average = 000 as this is the middle value of: 000, 000, 000 , 000 , 000, 255. Median Smoothing (above) Median smoothing is often the preferred method as it does not blur the image significantly. However, the consequence of this method is that some data may be still be lost from complicated images. Edge detection is the locating of edges in order to make them more prominent. This is often done as standard, to some extent, by smartphone software as most images benefit hugely from clearly defined edges. There are some cases, however, where complicated edges may be oversimplified by intense edge detection. The ‘Laplace rule’ is a method for detecting the positioning of edges in an image that involves multiplying a pixel’s value by four and then subtracting the values of the pixels above, below and on either side of it. A negative result is treated as 0.

Bibliography

  1. Android Authority, 2017, Chris Thomas & Gary Sims [https://www.androidauthority.com/ smartphone-cameras-explained-767029/]
  2. CanonAsia, 2016 [https://www.youtube.com/watch? v=EL9J3Km6wxI]
  3. Wikipedia [https://en.wikipedia.org/wiki/ Chromatic_aberration] & [https://en.wikipedia.org/ wiki/Achromatic_lens]
  4. Hrishikesh Kamat, 2016 [https://www.quora.com/ How-do-I-make-an-Android-smartphone-camera- autofocus-continuously-even-if-it-doesnt-support-it]
  5. Ken Lo, 2015 [https://community.giffgaff.com/t5/ Blog/How-Does-Auto-Focus-Work-On-Your- Smartphone/ba-p/16633200] & [https:// kenstechtips.com]
  6. Howstuffworks.com, Karim Nice, Tracy V.Wilson, Gerald Gurevich, [https:// electronics.howstuffworks.com/cameras- photography/digital/digital-camera2.htm]
  7. EngineersGarage, Preeti Jain [https:// www.engineersgarage.com/articles/what-is-cmos- sensor]
  8. Wikipedia [https://en.wikipedia.org/wiki/ Color_filter_array]
  9. IPCS, 2018 [https://ipcsautomation.com/blog-post/ image-sensor-in-cctv-camera/]
  10. Wikibooks, 2017 [https://en.wikibooks.org/wiki/A- level_Physics_(Advancing_Physics)/ Digital_Processing] - incl. image manipulation diagrams
  11. BBC Bitesize, 2017 [https://www.bbc.com/bitesize/ articles/z2tgr82]
  12. Techradar, 2009, PC Plus [https:// www.techradar.com/uk/news/computing/all-you- need-to-know-about-jpeg-compression-586268] Images
  13. Ray Diagram of a Convex Lens [https://cnx.org/ contents/[email protected]:klJq_an9@1/Converging- lenses] 2. Chromatic Aberration [https:// www.researchgate.net/figure/Longitudinal- chromatic-aberration-is-due-to-wavelength- dependent-differences-in_fig6_325525930] 3. Chromatic Correction with an Achromatic Doublet [https://en.wikipedia.org/wiki/File:Lens6b-en.svg] 4. Apple Patent Illustrating the Lenses in an iPhone [https://patents.google.com/patent/US9244253B2/ en] 5. Contrast-Detection Auto-Focus [https:// community.giffgaff.com/t5/Blog/How-Does-Auto- Focus-Work-On-Your-Smartphone/ba-p/16633200] 6. Phase-Detection Auto-focus [https:// community.giffgaff.com/t5/Blog/How-Does-Auto- Focus-Work-On-Your-Smartphone/ba-p/16633200] 7. Optical Image Stabilisation for an iPhone Camera [https://gigaom.com/2014/01/10/apple-patent- details-optical-image-stabilization-for-iphone- cameras/] 8. The Effect of Poisson Noise [https:// stackoverflow.com/questions/15117923/image- poisson-noise-on-image-in-double-precision-shot- noise] 9. Camera Sensor Sizes & Examples [https:// funlifecrisis.com/best-camera-for-social-media/ sensor-size-chart/] 10. CCD vs CMOS Sensor [https://ipcsautomation.com/ blog-post/image-sensor-in-cctv-camera/] 11. Sensor Cross-Section [https:// www.engineersgarage.com/articles/what-is-cmos- sensor] 12. Sensor - Expanded View [http:// av.jpn.support.panasonic.com/support/global/cs/dsc/ knowhow/knowhow27.html]

IV. REFERENCES