Thursday, 13 November 2014

Forensics - Focus Anatomy

From Bokeh to Airy Disks

Focus is a complex area within the science of Optics.  However at the heart of it are some fairly simple concepts which we will draw on here.

Two strands of Optics 

Light has the characteristics of both particles and waves and their relationship is still not totally understood.  Geometrical Optics focuses on the more straightforward, particle nature of light and allows for a simpler, though less exacting analysis of optical phenomena.  Physical Optics includes the more complex, wave properties of light including interference, diffraction and polarisation.  

If we consider the focus of a discrete point of light by a lens, an Airy Disk represents the best focus possible by a lens for that finite point of light.  Presenting an Airy disk graphically its distribution is close to but is not quite Gaussian in shape.  This is an example that demonstrates both the particle and wave nature of light.  As the link shows, an Airy disk has a prominent, circular centre, fading towards the edge, which fits a Gaussian pattern. But outside that are radiating concentric rings of dark and light bands.  Much like the penumbrae circling a shadow (HERE). these radiating bands (caused by diffraction - a wave property of light) are generally too faint to see, so a point of light focused by a lens normally appears to have a simple, circular shape, clearest at the centre and fuzzier towards the rim.  If we leave aside the radiating rings which are rarely visible anyway, the centre disk of an ideally focused point can be represented graphically very closely as a Gaussian distribution around the centre point.

Focus Anatomy

Defocus simply means out of focus.  When correctly focused, light waves from an in focus point on the subject will sharply converge at a point on the sensor (referred to as the film plane).  If the object is Inside Focus it means the light has converged at a point between the lens and sensor.  The waves meet, then diverge again before they arrive at the sensor defocused.  Outside Focus means that the light waves have a trajectory that would see them converge beyond the sensor (film plane) so they hit the sensor before they ever meet and are therefore again defocused at the film plane.  In an ideal lens, inside and outside defocused images will look very similar - if they seem different it could indicate a lens aberration.

Note in the image above there are various points on the image referred to by letters V, P and F.  These are referred to as Cardinal Points and are an essential part of Geometrical Optics, or more specifically Gaussian Optics.  These can be used to work out lens focal length, approximate distance to the subject and so on.

Depth of Field is the range of distances from the lens that appear to be in simultaneous focus in an image.  Depth of field can be adjusted by changing the size of the aperture in the lens through which light passes on it's way to the sensor. A wide open aperture produces a narrow depth of field while a narrower aperture produces a wider depth of field.  The trade off with a narrower aperture is that less light gets through the lens so the exposure time must be lengthened to compensate.

Aperture itself actually plays a fundamental role in the search for the ideal focus point (Airy disc) because the shape of the disk created by a point of light is related to the shape of the aperture.  A hexagonal aperture will produce hexagonal shaped points of light on the image.  While this may not be very noticeable in bird images it is a particularly important point for those interested in sharp focus at fine points of light (eg. in astronomy).  Defocus enhances aberrations such as this.  Those who have photographed using mirror lenses will be familiar with the donut shapes evident in out of focus regions of photographs.  This is due to lens aperture.

Bokeh is the aesthetic quality of blur.  Most people would consider "good bokeh" to be an image which shows smooth transition between sharp and defocused (out of focus) parts of an image and where the defocused parts of the image do not distract from the main subject.  "Bad bokeh" would include off-putting defocus such as halo-shaped patterns from mirror lenses or other oddly-shaped or distracting anomalies. While the aperture is a common cause of bad bokeh, different lens types and aberrations within lenses all contribute to a less than perfect image. For more on all of these elements see this nice posting HERE.

Defocus Layering

When we consider defocus we have to consider the relative position and distance of objects in an image.  Objects which are closer to the camera obscure objects which are behind them.  If we are focused on a closer object, those in the background will defocus without impacting on the foreground object.  If however we focus on a background object, the foreground object will defocus, and in doing so the foreground has the potential to spoil the background image as illustrated below.

Note however that if the foreground object is small enough, and defocussed fully, it will effectively dissolve out of shot.  No doubt there will always he some residual impact and this shouldn't be forgotten, but the impact left by a fully dissolved, defocused object is often nearly impossible to detect.  This is why so many film-makers use this cool technique in movie-making.  It has a magical property to it.

I find it useful to consider this effect in terms of layering.  For those familiar with layers in Adobe Photoshop and other imaging packages layers work like pages in a book.  The top page gets priority and masks what is below it.  This is how defocus works also.  Defocused objects can only affect those objects behind them in an image.

Image Formation and Subsequent Analysis

Having obtained a pin sharp focus on the film plane, captured by an expensive lens, it may be frustrating to discover that the first thing the camera processor does is blurs and distorts the image during a process called Demosaicing.  I have explored this process in more detail HERE.  After demosiacing a digital image is created which consists of discrete pixels that are each considerably larger than the smallest point originally resolved by the lens onto the film plane.  Regardless of the quality of the lens and exactness of the focus disk obtained by the lens, the final image is now resolved in the form of tiny square pixels which have been created following a fairly high degree of processing and interpolation.  Faced with the realisation that digital image formation and focus is already far from perfect, it shouldn't be too much of a stretch to conclude that a Gaussian analysis of focus in digital images should be a reasonably acceptable compromise.

Eliminating Defocus Forever

A relatively new technology called Light Field Photography is set to revolutionise this whole medium.  If it becomes the norm, in future there may be no need to consider defocus at all as part of digital image analysis and quality.  An image obtained by a light field camera has a life of it's own.  The most recent camera from the manufacturer Lytro is reviewed objectively HERE.  If you are not familiar with this exciting new technology, I recommend you check it out.

For my sci-fi take on where this is all headed check out my 'just-for-fun' camera to end all cameras posting HERE.

No comments:

Post a Comment