File Exchange

## Sauvola local image thresholding

version 1.4.0.0 (6.33 KB) by
Sauvola binarization method is well suited for ill illuminated or stained documents.

Updated 08 May 2013

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. - http://www.mediateam.oulu.fi/publications/pdf/24.pdf

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 - http://www.dfki.uni-kl.de/~shafait/papers/Shafait-efficient-binarization-SPIE08.pdf

A paper evaluating binarization methods:

P. Stathis, E. Kavallieratou and N. Papamarkos - An Evaluation Technique for Binarization Algorithms, Journal of Universal Computer Science, 2008, - http://www.papamarkos.gr/uploaded-files/An%20Evaluation%20Technique%20for%20Binarization%20Algorithms.pdf

### Cite As

Jan Motl (2021). Sauvola local image thresholding (https://www.mathworks.com/matlabcentral/fileexchange/40266-sauvola-local-image-thresholding), MATLAB Central File Exchange. Retrieved .

Jorge Rivé

Thank you for sharing this.
I get totally white image (I can send you the image, but don't know how to append it to this)....what could be going wrong?

Shel

Thanks.
A question, ... why the output does not change by changing the neighborhood or thresholding?

Jan Motl

@mohamed abu eita: I tested the code in MATLAB 2015a on OS X 10.11 and it still works.

Jan Motl

@Sara: ImageJ uses a circular local window, instead of a rectangular one. See:
https://github.com/fiji/Auto_Threshold/blob/master/src/main/java/fiji/threshold/Auto_Local_Threshold.java

SATISH KUMAR

Good Work

wahyudi setiawan

Peyman Obeidy

Thank you for this, nicely done.

LYNN

Thank you so much!
It helps me a lot!

Tu Nguyen Anh

Gabor

Thank you so much!
Great work. It's very appreciated.

mohamed abu eita

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

sara

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

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

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