案例 Fu Xianjun. All Rights Reserved.
显示原图
import cv2
import numpy as np
img = cv2.imread('j.bmp')
cv2.imshow('img', img)
cv2.waitKey(0)
cv2.destroyAllWindows()
进行腐蚀操作
kernel = np.ones((3,3),np.uint8)
erosion = cv2.erode(img,kernel,iterations = 1)
cv2.imshow('erosion', erosion)
cv2.waitKey(0)
cv2.destroyAllWindows()