File Exchange

image thumbnail

Sauvola local image thresholding

version 1.4 (6.33 KB) by

Sauvola binarization method is well suited for ill illuminated or stained documents.



View License

The implemented Sauvola method uses integral images for fast computation of the threshold function.

The Sauvola method is described in:

J. Sauvola and M. Pietikainen, Adaptive document image binarization, Pattern Recognition 33, 2000. -

The modification which uses integral images providing a 20-fold speedup (according to the paper) is described in this paper:

F. Shafait, D. Keysers, and T. M. Breuel, Efficient implementation of local adaptive thresholding techniques using integral images, Document Recognition and Retrieval XV, 2008 -

A paper evaluating binarization methods:

P. Stathis, E. Kavallieratou and N. Papamarkos - An Evaluation Technique for Binarization Algorithms, Journal of Universal Computer Science, 2008, -

Comments and Ratings (9)

Peyman Obeidy

Thank you for this, nicely done.

Divakar Badal


LYNN (view profile)

Thank you so much!
It helps me a lot!

Tu Nguyen Anh


Gabor (view profile)

Thank you so much!
All your set of adaptive thresholding scripts is amazing.
Great work. It's very appreciated.

Hi i want to run this code on matlab 2015 but not run


sara (view profile)

I have ImageJ software which has a adaptive thresholding tools and sauvola's method, But I didnt get the same results!

can anyone please tell me why the results is different??


sara (view profile)

I do appreciated you for what you have done, your codes are great, thanks a lot and again.



Link corrected


Improved parameter checking.





MATLAB Release
MATLAB 6.5 (R13)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today