Focus stacking

Last updated
Series of images demonstrating a six-image focus bracket of a Tachinid fly. First two images illustrate typical DOF of a single image at f/10 while the third image is the composite of six images. Focus stacking Tachinid fly.jpg
Series of images demonstrating a six-image focus bracket of a Tachinid fly. First two images illustrate typical DOF of a single image at f/10 while the third image is the composite of six images.
Focus stacking (for extended depth of field) in bright field light microscopy. This example is of a diatom microfossil in diatomaceous earth. Three source images at different focus distances (top left) are combined with masks (top right) to obtain the contributions of their respective images to the final focus stacked image (bottom). Black is no contribution; white is full. FocusStack BrightFieldLightMicroscopy DiatomaceousEarth.jpg
Focus stacking (for extended depth of field) in bright field light microscopy. This example is of a diatom microfossil in diatomaceous earth. Three source images at different focus distances (top left) are combined with masks (top right) to obtain the contributions of their respective images to the final focus stacked image (bottom). Black is no contribution; white is full.

Focus stacking also called focal plane merging, z-stacking, [1] or focus blending is a digital image processing technique which combines multiple images taken at different focus distances to give a resulting image with a greater depth of field (DOF) than any of the individual source images. [2] [3] Focus stacking can be used in any situation where individual images have a very shallow depth of field; macro photography and optical microscopy are two typical examples. Focus stacking can also be useful in landscape photography.

Contents

Focus stacking offers flexibility: since it is a computational technique, images with several different depths of field can be generated in post-processing and compared for best artistic merit or scientific clarity. Focus stacking also allows generation of images physically impossible with normal imaging equipment; images with nonplanar focus regions can be generated. Alternative techniques for generating images with increased or flexible depth of field include wavefront coding, light-field cameras and tilt.

Technique

The starting point for focus stacking is a series of images captured at different focus distances; in each image different areas of the sample will be in focus. While none of these images has the sample entirely in focus they collectively contain all the data required to generate an image which has all parts of the sample in focus. In-focus regions of each image may be detected automatically, for example via edge detection or Fourier analysis, or selected manually. The in-focus patches are then blended together to generate the final image.

This processing is also called z-stacking, focal plane merging (or zedification in French). [4] [5]

In photography

Getting sufficient depth of field can be particularly challenging in macro photography, because depth of field is smaller (shallower) for objects nearer the camera, so if a small object fills the frame, it is often so close that its entire depth cannot be in focus at once. Depth of field is normally increased by stopping down aperture (using a larger f-number), but beyond a certain point, stopping down causes blurring due to diffraction, which counteracts the benefit of being in focus. It also reduces the luminosity of the image. Focus stacking allows the depth of field of images taken at the sharpest aperture to be effectively increased. The images at right illustrate the increase in DOF that can be achieved by combining multiple exposures.

Stacked image of the Curiosity Rover's first sampling hole in Mount Sharp. The hole is 1.6 cm (0.63 in) wide and 6.7 cm (2.6 in) deep. PIA18609 - First Sampling Hole in Mount Sharp .jpg
Stacked image of the Curiosity Rover's first sampling hole in Mount Sharp. The hole is 1.6 cm (0.63 in) wide and 6.7 cm (2.6 in) deep.

The Mars Science Laboratory mission has a device called Mars Hand Lens Imager (MAHLI), which can take photos that can later be focus stacked. [6]

In microscopy

In microscopy, high numerical apertures are desirable to capture as much light as possible from a small sample. A high numerical aperture (equivalent to a low f-number) gives a very shallow depth of field. Higher magnification objective lenses generally have shallower depth of field; a 100× objective lens with a numerical aperture of around 1.4 has a depth of field of approximately 1 μm. When observing a sample directly, the limitations of the shallow depth of field are easy to circumvent by focusing up and down through the sample; to effectively present microscopy data of a complex 3D structure in 2D, focus stacking is a very useful technique.

Atomic resolution scanning transmission electron microscopy encounters similar difficulties, where specimen features are much larger than the depth of field. By taking a through-focal series, the depth of focus can be reconstructed to create a single image entirely in focus. [7]

Software/application

Focus stacking software
NamePrimary authorApplication typePlatformLicense
Adobe Photoshop [8] CS4, CS5, CS6 Adobe DesktopWindows, Mac OS XProprietary
Affinity Photo 'Focus Merge'SerifDesktopWindows, Mac OS XProprietary
Aphelion with Multifocus extensionADCISDesktopWindowsProprietary, 30-day trial
Amira / Avizo 'Image Stack Projection' [9] Thermo Fisher DesktopWindows, Mac OS X, LinuxProprietary
CamRangerCamRangerDesktop / MobileiOS, Android, Mac OS X, WindowsProprietary
Chasys Draw IES John Paul ChachaDesktopWindowsProprietary
CombineZ Alan HadleyDesktopWindows GPL
CUVI Vision & Imaging Library TunaCodeDesktop / EmbeddedWindows, LinuxProprietary
Enfuse (combined with align_image_stack or similar)Andrew Mihal and hugin development teamDesktopMultiplatform GPL
FocusFusion DelphiToolsDesktopWindowsProprietary
Focus StackerAlexander Boltnev, Olga KacherDesktopMac OS XProprietary
Focus Stacking Online [10] Focus Stacking OnlineWeb applicationAllProprietary
Shutter Stream Product Photography SoftwareIconasysDesktopWindows, Mac OS XProprietary
Helicon Focus Danylo KozubDesktopWindows, Mac OS XProprietary, 30-day trial
ImageJ with Extended Depth of Field PluginAlex Prudencio, Jesse Berent, Daniel SageDesktopUnix, Linux, Windows, Mac OS 9 and Mac OS XPublic domain
MacroFusion [11] Dariusz DumaDesktopLinux GPL
Mathematica via ImageFocusCombine [12] Wolfram Research Desktop / WebWindows, Mac OS X, LinuxProprietary, 15-day trial
Picolay Heribert CypionkaDesktopWindowsFreeware
QuickPHOTO with Deep Focus extensionPromicraDesktopWindowsProprietary, 30-day trial
Zerene Stacker Rik LittlefieldDesktopWindows, Mac OS X, LinuxProprietary, 30-day trial

Pictures

Videos

Diagrams

See also

Related Research Articles

<span class="mw-page-title-main">Depth of field</span> Distance between the nearest and the furthest objects that are in focus in an image

The depth of field (DOF) is the distance between the nearest and the furthest objects that are in acceptably sharp focus in an image captured with a camera. See also the closely related depth of focus.

<span class="mw-page-title-main">Aperture</span> Hole or opening through which light travels

In optics, the aperture of an optical system is a hole or an opening that primarily limits light propagated through the system. More specifically, the entrance pupil as the front side image of the aperture and focal length of an optical system determine the cone angle of a bundle of rays that comes to a focus in the image plane.

<span class="mw-page-title-main">Bokeh</span> Aesthetic quality of blur in the out-of-focus parts of an image

In photography, bokeh is the aesthetic quality of the blur produced in out-of-focus parts of an image, whether foreground or background or both. It is created by using a wide aperture lens.

<span class="mw-page-title-main">Cinematography</span> Art of motion picture photography

Cinematography is the art of motion picture photography.

In photography, bracketing is the general technique of taking several shots of the same subject using different camera settings, typically with the aim of combining the images in postprocessing. Bracketing is useful and often recommended in situations that make it difficult to obtain a satisfactory image with a single shot, especially when a small variation in exposure parameters has a comparatively large effect on the resulting image. Given the time it takes to accomplish multiple shots, it is typically, but not always, used for static subjects. Autobracketing is a feature of many modern cameras. When set, it will automatically take several bracketed shots, rather than the photographer altering the settings by hand between each shot.

<span class="mw-page-title-main">Macro photography</span> Photography genre and techniques of extreme close-up pictures

Macro photography is extreme close-up photography, usually of very small subjects and living organisms like insects, in which the size of the subject in the photograph is greater than life-size . By the original definition, a macro photograph is one in which the size of the subject on the negative or image sensor is life-size or greater. In some senses, however, it refers to a finished photograph of a subject that is greater than life-size.

The science of photography is the use of chemistry and physics in all aspects of photography. This applies to the camera, its lenses, physical operation of the camera, electronic camera internals, and the process of developing film in order to take and develop pictures properly.

<span class="mw-page-title-main">Light field camera</span> Type of camera that can also capture the direction of travel of light rays

A light field camera, also known as a plenoptic camera, is a camera that captures information about the light field emanating from a scene; that is, the intensity of light in a scene, and also the precise direction that the light rays are traveling in space. This contrasts with conventional cameras, which record only light intensity at various wavelengths.

The following are common definitions related to the machine vision field.

The following outline is provided as an overview of and topical guide to photography:

<span class="mw-page-title-main">Tilted plane focus</span> Camera focus technique

Tilted plane photography is a method of employing focus as a descriptive, narrative or symbolic artistic device. It is distinct from the more simple uses of selective focus which highlight or emphasise a single point in an image, create an atmospheric bokeh, or miniaturise an obliquely-viewed landscape. In this method the photographer is consciously using the camera to focus on several points in the image at once while de-focussing others, thus making conceptual connections between these points.

Köhler illumination is a method of specimen illumination used for transmitted and reflected light optical microscopy. Köhler illumination acts to generate an even illumination of the sample and ensures that an image of the illumination source is not visible in the resulting image. Köhler illumination is the predominant technique for sample illumination in modern scientific light microscopy. It requires additional optical elements which are more expensive and may not be present in more basic light microscopes.

<span class="mw-page-title-main">35 mm equivalent focal length</span> Camera setup

In photography, the 35 mm equivalent focal length is a measure of the angle of view for a particular combination of a camera lens and film or image sensor size. The term is popular because in the early years of digital photography, most photographers experienced with interchangeable lenses were most familiar with the 35 mm film format.

<span class="mw-page-title-main">Optical sectioning</span> Imaging of focal planes within a thick sample

Optical sectioning is the process by which a suitably designed microscope can produce clear images of focal planes deep within a thick sample. This is used to reduce the need for thin sectioning using instruments such as the microtome. Many different techniques for optical sectioning are used and several microscopy techniques are specifically designed to improve the quality of optical sectioning.

<span class="mw-page-title-main">Exposure fusion</span>

In image processing, computer graphics, and photography, exposure fusion is a technique for blending multiple exposures of the same scene (bracketing) into a single image. As in high dynamic range imaging, the goal is to capture a scene with a higher dynamic range than the camera is capable of capturing with a single exposure.

<span class="mw-page-title-main">Mars Hand Lens Imager</span>

Mars Hand Lens Imager (MAHLI) is one of seventeen cameras on the Curiosity rover on the Mars Science Laboratory mission.

<span class="mw-page-title-main">Pentax Q</span> Camera model

The Pentax Q is a mirrorless interchangeable-lens camera introduced by Pentax on June 23, 2011.

<span class="mw-page-title-main">Brenizer method</span> Photographic technique

The Brenizer method, sometimes referred to as bokeh panorama or bokehrama, is a photographic technique characterized by the creation of a digital image exhibiting a shallow depth of field in tandem with a wide angle of view. Created by use of panoramic stitching techniques applied to portraiture, it was popularized by photographer Ryan Brenizer.

Epsilon photography is a form of computational photography wherein multiple images are captured with slightly varying camera parameters such as aperture, exposure, focus, film speed and viewpoint for the purpose of enhanced post-capture flexibility. The term was coined by Prof. Ramesh Raskar. The technique has been developed as an alternative to light field photography that requires no specialized equipment. Examples of epsilon photography include focal stack photography, High dynamic range (HDR) photography, lucky imaging, multi-image panorama stitching and confocal stereo. The common thread for all the aforementioned imaging techniques is that multiple images are captured in order to produce a composite image of higher quality, such as richer color information, wider-field of view, more accurate depth map, less noise/blur and greater resolution.

<span class="mw-page-title-main">Light scanning photomacrography</span>

Light Scanning Photomacrography (LSP), also known as Scanning Light Photomacrography (SLP) or Deep-Field Photomacrography, is a photographic film technique that allows for high magnification light imaging with exceptional depth of field (DOF). This method overcomes the limitations of conventional macro photography, which typically only keeps a portion of the subject in acceptable focus at high magnifications.

References

  1. "Malin Space Science Systems - Mars Science Laboratory (MSL) Mars Hand Lens Imager (MAHLI) Instrument Description". Msss.com. Retrieved 2012-12-10.
  2. Johnson, Dave (2008). How to Do Everything: Digital Camera (5th ed.). McGraw-Hill Osborne Media. p.  336. ISBN   978-0-07-149580-6. There are a number of programs that allow you to get the equivalent of infinite depth of field in your photos, with sharp focus from the foreground all the way back to the rear. How is this possible? By taking multiple photos of the same scene and stacking them afterwards into a composite that features only the sharpest bits of each image. One of the best is Helicon Focus.
  3. Ray 2002, 231–232
  4. "Afficher le sujet - Proposition d'un terme français pour "focus stacking" • Le Naturaliste". Lenaturaliste.net (in French). Retrieved 2012-10-05.
  5. "Malin Space Science Systems - Mars Science Laboratory (MSL) Mars Hand Lens Imager (MAHLI) Instrument Description". Msss.com. Retrieved 2012-10-05.
  6. "MSL Science Corner: Mars Hand Lens Imager (MAHLI)". MSL-SciCorner.JPL.NASA.gov. Archived from the original on 2009-03-20. Retrieved 2012-10-05.
  7. Hovden, Robert; Xin, Huolin L.; Muller, David A. (2010). "Extended Depth of Field for High-Resolution Scanning Transmission Electron Microscopy". Microscopy and Microanalysis. 17 (1): 75–80. arXiv: 1010.4500 . Bibcode:2011MiMic..17...75H. doi:10.1017/S1431927610094171. PMID   21122192. S2CID   17082879.
  8. "Focus Stacking Made Easy with Photoshop". Envato Tuts+. 2013-03-14. Retrieved 2023-04-17.
  9. "Avizo User Guide, Module "Image Stack Projection"" (PDF). 2018-03-30.
  10. "Focus stacking online - free online focus stacking application". FocusStackingOnline.com. Retrieved 2020-08-02.
  11. "GUI to Combine Photos to Get Deeper DOF or HDR". SourceForge.net. 27 November 2016. Retrieved 2017-10-19.
  12. "ImageFocusCombine" . Retrieved 2021-09-11.