您的位置:首页 > 编程语言 > Python开发

python opencv 实现开闭运算

2017-12-08 17:33 435 查看
涉及到的函数为
erode
dilate
:

import cv2
import matplotlib.pyplot as plt
size = 11
kernel = np.ones((size, size), dtype=np.uint8)
img_erosion = cv2.erode(img, kernel, iterations=1)
img_dilation = cv2.dilate(img, kernel, iterations=1)
img_close = cv2.erode(cv2.dilate(img4, kernel), kernel)
plt.imshow(img_close)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: