File Exchange

image thumbnail

Extended depth-of-field

version (5.51 MB) by Said Pertuz
Generate low-noise extended depth-of-field image from focus sequence


Updated 27 Jan 2016

View License

This function generates an extended depth-of-field image (also referred to as all-in-focus image) from a focus sequence using the noise-robust selective all-in-focus algorithm [1]. Input images may be grayscale or color. For color images, the algorithm is applied to each color plane independently. For a demo, just type 'fstackdemo' at the matlab prompt.
[1] Pertuz et. al. "Generation of all-in-focus images by noise-robust selective fusion of limited depth-of-field
images" IEEE Trans. Image Process, 22(3):1242 - 1251, 2013.

Cite As

Said Pertuz (2020). Extended depth-of-field (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (6)

Takuji Fukumoto

Robert Klose

Ilya Belevich

Said Pertuz

The focus parameter can be either a set of values corresponding to the focus distance of each image or a dummy variable with sequential number (e.g., [1,2,3,...])

harjatin baweja

Thank you for this implementation. I had a quick question. If I just have the focal lengths at which images were collected. Can I still use the 'focus' parameter ?

David Niles


- Updated sample data and function description

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: Focus Measure, Shape from focus