Focus stacking explained

Focus stackingalso called focal plane merging, z-stacking,[1] or focus blendingis 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.

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 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.

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, CS6AdobeDesktopWindows, 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 FisherDesktopWindows, Mac OS X, LinuxProprietary
CamRangerCamRangerDesktop / MobileiOS, Android, Mac OS X, WindowsProprietary
Chasys Draw IESJohn Paul ChachaDesktopWindowsProprietary
CombineZAlan HadleyDesktopWindowsGPL
CUVI Vision & Imaging LibraryTunaCodeDesktop / EmbeddedWindows, LinuxProprietary
Enfuse (combined with align_image_stack or similar)Andrew Mihal and hugin development teamDesktopMultiplatformGPL
FocusFusionDelphiToolsDesktopWindowsProprietary
Focus StackerAlexander Boltnev, Olga KacherDesktopMac OS XProprietary
Focus Stacking Online[10] Focus Stacking OnlineWeb applicationAllProprietary
Shutter Stream Product Photography SoftwareIconasysDesktopWindows, Mac OS XProprietary
Helicon FocusDanylo 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 DumaDesktopLinuxGPL
Mathematica via ImageFocusCombine[12] Wolfram ResearchDesktop / WebWindows, Mac OS X, LinuxProprietary, 15-day trial
PicolayHeribert CypionkaDesktopWindowsFreeware
QuickPHOTO with Deep Focus extensionPromicraDesktopWindowsProprietary, 30-day trial
Zerene StackerRik LittlefieldDesktopWindows, Mac OS X, LinuxProprietary, 30-day trial

Gallery

Diagrams

See also

References

External links

Notes and References

  1. Web site: Malin Space Science Systems - Mars Science Laboratory (MSL) Mars Hand Lens Imager (MAHLI) Instrument Description . Msss.com . 2012-12-10.
  2. Book: Johnson, Dave . 2008 . How to Do Everything: Digital Camera . limited . 5th . McGraw-Hill Osborne Media . 336 . 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. Web site: Afficher le sujet - Proposition d'un terme français pour "focus stacking" • Le Naturaliste . Lenaturaliste.net . fr . 2012-10-05.
  5. Web site: Malin Space Science Systems - Mars Science Laboratory (MSL) Mars Hand Lens Imager (MAHLI) Instrument Description . Msss.com . 2012-10-05.
  6. Web site: MSL Science Corner: Mars Hand Lens Imager (MAHLI) . https://web.archive.org/web/20090320124731/http://msl-scicorner.jpl.nasa.gov/Instruments/MAHLI/ . dead . 2009-03-20 . MSL-SciCorner.JPL.NASA.gov . 2012-10-05.
  7. 10.1017/S1431927610094171 . Extended Depth of Field for High-Resolution Scanning Transmission Electron Microscopy . 2010 . Hovden . Robert . Xin . Huolin L. . Muller . David A. . Microscopy and Microanalysis . 17 . 75–80 . 21122192 . 1. 1010.4500 . 2011MiMic..17...75H . 17082879 .
  8. Web site: Focus Stacking Made Easy with Photoshop . Envato Tuts+ . 2013-03-14 . 2023-04-17.
  9. Web site: Avizo User Guide, Module "Image Stack Projection". 2018-03-30.
  10. Web site: Focus stacking online - free online focus stacking application. FocusStackingOnline.com . 2020-08-02.
  11. Web site: GUI to Combine Photos to Get Deeper DOF or HDR. SourceForge.net . 27 November 2016 . 2017-10-19.
  12. Web site: ImageFocusCombine. 2021-09-11.