Ask Your Question

Revision history [back]

One of the best for thresholding the text paper for OCR is sauvola method.I have put the source code here.

One of the best for thresholding the text paper for OCR is sauvola method.I have put the source code here.

Edit:

pixel = ( pixel > mean * ( 1 + k * ( standard_deviation / r - 1 ) ) ) ? object : background

Parameter 1: is the k value. The default value is 0.5. Any other number than 0 will change the default value.

Parameter 2: is the r value. The default value is 128. Any other number than 0 will change the default value

Sauvola, J & Pietaksinen, M (2000), "Adaptive Document Image Binarization", Pattern Recognition 33(2): 225-236,