Niblack and Sauvola Thresholding
Niblack and Sauvola thresholds are local thresholding techniques that are useful for images where the background is not uniform, especially for text recognition [1], [2]. Instead of calculating a single global threshold for the entire image, several thresholds are calculated for every pixel by using specific formulae that take into account the mean and standard deviation of the local neighborhood (defined by a window centered around the pixel).
Here, we binarize an image using these algorithms compare it to a common global
thresholding technique. Parameter window_size determines the size of the
window that contains the surrounding pixels.
