def binarisation1(src_image):
if len(src_image.shape) == 3:
image = (src_image.sum(axis=2) / 3).astype('ubyte')
else:
image = src_image
block_size = 35
binary = threshold_adaptive(image, block_size, offset=20)
binary = binary.astype('ubyte')
return binary
评论列表
文章目录