1 Star 0 Fork 10

O(∩_∩)O哈哈~ / opencv_tutorial

forked from frank / opencv_tutorial 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
test10_morphology.py 377 Bytes
一键复制 编辑 原始数据 按行查看 历史
frank 提交于 2021-10-02 10:56 . first commit
import cv2
import numpy as np
gray = cv2.imread("opencv_logo.jpg", cv2.IMREAD_GRAYSCALE)
_, binary = cv2.threshold(gray, 200, 255, cv2.THRESH_BINARY_INV)
kernel = np.ones((5, 5), np.uint8)
erosion = cv2.erode(binary, kernel)
dilation = cv2.dilate(binary, kernel)
cv2.imshow("binary", binary)
cv2.imshow("erosion", erosion)
cv2.imshow("dilation", dilation)
cv2.waitKey()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fengshenmeng/opencv_tutorial.git
git@gitee.com:fengshenmeng/opencv_tutorial.git
fengshenmeng
opencv_tutorial
opencv_tutorial
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891