opencv膨胀cv2.dilate

import cv2
import numpy as np
img = cv2.imread('1.jpg',0)

#用numpy生成卷积核
kernel = np.ones((5,5),np.uint8)
dilate = cv2.dilate(img,kernel,iterations = 1)

cv2.imshow('dilate',dilate)
cv2.waitKey(0)
cv2.destroyAllWindows()

你可能感兴趣的:(总结,python-opencv,python,opencv)