四连通和八连通域
label, num = measure.label(mask_img, neighbors=8, background=0, return_num=True)
参考:
[1] https://blog.csdn.net/weixin_39976081/article/details/112069671
[2] https://scikit-image.org/docs/dev/api/skimage.measure.html#skimage.measure.label
[3] https://blog.csdn.net/longshaonihaoa/article/details/106305748