cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\imgproc\src\segmentation.cpp:161:
问题描述在运用分水岭分割的时候,发现该常见错误kernel=np.ones((3,3),np.uint8)sure_bg=cv.dilate(waterimg,kernel,iterations=3)#确定背景dist=cv.distanceTransform(waterimg,cv.DIST_L2,3)#距离变换ret,sure_fg=cv.threshold(dist,dist.max()*0