def threshold_niblack(image, window_size=15, k=0.2):
 (m, s) = _mean_std(image, window_size)
 return (m - (k * s))

def threshold_niblack ( image , window_size = 15 , k = 0.2 ) : ( m , s ) = _mean_std ( image , window_size ) return ( m - ( k * s ) )
applies niblack local threshold to an array .