opencv python 腐蚀

import cv2 #opencv读取的格式是BGR
import matplotlib.pyplot as plt
import numpy as np 
img=cv2.imread('d:\picture\dige.png')

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()```

你可能感兴趣的:(OPENCV)