def otsu_thresholding(im_float):
"""
apply otsu thresholding on the whole slide
im_float = input image as float type
return otsued image with gray, otsu threshold value
"""
print("threshold_otsu\n")
threshold_global_Otsu = threshold_otsu(im_float)
#thresholding
im_bool= (im_float > threshold_global_Otsu)
im_int = im_bool.astype(float)
print im_int*255
return im_int*255, threshold_global_Otsu
评论列表
文章目录