分水岭算法
基于距离的分水岭分割流程
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/f82e8501ebb7835b305e260f9c346149.png)
import cv2 as cv
import numpy as np
def watershed_demo(image):
blurred = cv.pyrMeanShiftFiltering(image, 10, 100)
gray = cv.cvtColor(blurred, cv.COLOR_BGR2GRAY)
ret, binary = cv.threshold(gray, 0, 255, cv.THRESH_BINARY | cv.THRESH_OTSU)</