threshold_sauvola(image, window_size=15, k=0.2, r=None)
In the original method a threshold T is calculated for every pixel in the image using the following formula:
T = m(x,y) * (1 + k * ((s(x,y) / R) - 1))
where m(x,y) and s(x,y) are the mean and standard deviation of pixel (x,y) neighborhood defined by a rectangular window with size w times w centered around the pixel. k is a configurable parameter that weights the effect of standard deviation. R is the maximum standard deviation of a greyscale image.
This algorithm is originally designed for text recognition.
Input image.
Window size specified as a single odd integer (3, 5, 7, …), or an iterable of length image.ndim
containing only odd integers (e.g. (1, 5, 5)
).
Value of the positive parameter k.
Value of R, the dynamic range of standard deviation. If None, set to the half of the image dtype range.
Threshold mask. All pixels with an intensity higher than this value are assumed to be foreground.
Applies Sauvola local threshold to an array. Sauvola is a modification of Niblack technique.
>>> from skimage import dataSee :
... image = data.page()
... t_sauvola = threshold_sauvola(image, window_size=15, k=0.2)
... binary_image = image > t_sauvola
The following pages refer to to this document either explicitly or contain code examples using this.
skimage.filters.thresholding.threshold_sauvola
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them