Code covered by the BSD License  

Highlights from
Focus Measure

4.9 | 14 ratings Rate this file 132 Downloads (last 30 days) File Size: 5.32 KB File ID: #27314 Version: 1.3
image thumbnail

Focus Measure


Said Pertuz (view profile)

  • 1 file
  • 4.92857


20 Apr 2010 (Updated )

A function to measure the relative degree of focus of an image.

| Watch this File

File Information

This function measures the relative degree of focus of an image. Several up-to-date focus measuring algorithms have been implemented and the function supports uint8 or double images. If you find this function useful, please cite:

S. Pertuz et al., Analysis of focus measure operators for shape-from-focus. Pattern Recognition (2012), http:/

You can find implementation details in the referenced paper. For additional information, please visit:

Required Products Image Processing Toolbox
MATLAB release MATLAB 7.7 (R2008b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (15)
17 Nov 2015 Jesse

Jesse (view profile) seems to have gone away.

Comment only
05 Oct 2015 Misha

Misha (view profile)

11 Aug 2015 Ahmed

Ahmed (view profile)

Thanks very much :)

29 Jan 2015 Nicole Roamans

How do you choose WSize=15 and sig=N/2.5 in 'GDER'? If anyone can help I would appreciate it.
Thank you for providing your code.

24 Jul 2014 George Aprilis

Very helpful, allows you to try quickly many different methods and see what suits your case.
There is for sure a small bug in SFIL case, between 270 and 315 degrees, R(:,:,7) appears twice instead of R(:,:,7) and R(:,:,8)

22 Jul 2014 Rishabh Battulwar  
10 Jul 2014 MTJ1990  
26 Jan 2014 Engin

Engin (view profile)

It seems like some of the metrics (options) needs Wavelet Toolbox (if there is something like this?), because a lot of functions for WAVS, WAVV and WAVR are missing.

Moreover, it is not exactly clear if an image should be of type uint8 or double or what - however results of some metrics depends on datatype of image.

29 Jul 2013 Karthik MSwamy

Quite a useful tool to measure various focus measures.

29 Nov 2012 Rob

Rob (view profile)

I was wondering how you got the plot.

07 Oct 2011 Bosheng  
05 Aug 2011 Nek Valous  
18 Feb 2011 Jonathan

Great tool, exactly what I was looking for!

Note that the ACMO method as written also requires the Fixed-Point Toolbox. I just commented out the isdouble() check, and make sure my images are uint8 before passing them in.

03 Sep 2010 Dave Holden

Very useful

07 Jun 2010 Mohamed Shams  
27 Nov 2012 1.3

- The function no longer requires the floating-point toolbox.

Contact us