1.开运算和腐蚀-膨胀是相同的,同理闭运算也是。
#一个开运算和腐蚀-膨胀的效果是相同的在这里进行对比
eroded = cv2.erode(img,kernel)
dilated = cv2.dilate(eroded,kernel)
cv2.imshow('Eroded-Swell Image',dilated)
open = cv2.morphologyEx(img,cv2.MORPH_OPEN,kernel)
cv2.imshow('Open Image',open)
参考链接:
https://blog.csdn.net/sunny2038/article/details/9137759
https://blog.csdn.net/wsp_1138886114/article/details/82917661