threshold_niblack(image, window_size=15, k=0.2)
A threshold T is calculated for every pixel in the image using the following formula:
T = m(x,y) - k * s(x,y)
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.
This algorithm is originally designed for text recognition.
The Bradley threshold is a particular case of the Niblack one, being equivalent to
>>> from skimage import data >>> image = data.page() >>> q = 1 >>> threshold_image = threshold_niblack(image, k=0) * q
for some value q
. By default, Bradley and Roth use q=1
.
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 parameter k in threshold formula.
Threshold mask. All pixels with an intensity higher than this value are assumed to be foreground.
Applies Niblack local threshold to an array.
>>> from skimage import dataSee :
... image = data.page()
... threshold_image = threshold_niblack(image, window_size=7, k=0.1)
The following pages refer to to this document either explicitly or contain code examples using this.
skimage.filters.thresholding.threshold_niblack
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