当前位置:网站首页>opencv学习笔记四——膨胀/腐蚀/开运算/闭运算
opencv学习笔记四——膨胀/腐蚀/开运算/闭运算
2022-07-07 05:19:00 【我是一个小稻米】
1. 腐蚀
作用: 去毛点
image1 = mpimg.imread('./11.png')
plt.imshow(image1);
kernel = np.ones((3, 3), np.uint8)
image2 = cv2.erode(image1, kernel, iterations = 1)
plt.imshow(image2)
2. 膨胀
将腐蚀的结果,作为膨胀的输入,可以将细小事物变粗大。
kernel = np.ones((3, 3), np.uint8)
image3 = cv2.dilate(image2, kernel, iterations = 1)
plt.imshow(image3)
3. 开运算
先腐蚀再膨胀
image = mpimg.imread('11.png')
kernel = np.ones((3,3), np.uint8)
image1 = cv2.morphologyEx(image, cv2.MORPH_OPEN, kernel)
plt.imshow(image1);
4. 闭运算
先膨胀再腐蚀
image = mpimg.imread('11.png')
kernel = np.ones((3,3), np.uint8)
image1 = cv2.morphologyEx(image, cv2.MORPH_CLOSE, kernel)
plt.imshow(image1);
边栏推荐
- 力扣(LeetCode)187. 重复的DNA序列(2022.07.06)
- Vulnerability recurrence easy_ tornado
- Linux Installation MySQL 8.0 configuration
- The element with setfieldsvalue set is obtained as undefined with GetFieldValue
- [quick start of Digital IC Verification] 15. Basic syntax of SystemVerilog learning 2 (operators, type conversion, loops, task/function... Including practical exercises)
- 海信电视开启开发者模式
- 王爽 《汇编语言》之寄存器
- Uniapp mobile terminal forced update function
- Quick analysis of Intranet penetration helps the foreign trade management industry cope with a variety of challenges
- 轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷
猜你喜欢
藏书馆App基于Rainbond实现云原生DevOps的实践
通俗易懂单点登录SSO
OpenVSCode云端IDE加入Rainbond一体化开发体系
2022 Inner Mongolia latest advanced fire facility operator simulation examination question bank and answers
【数字IC验证快速入门】12、SystemVerilog TestBench(SVTB)入门
央视太暖心了,手把手教你写HR最喜欢的简历
Main window in QT learning 27 application
[quick start of Digital IC Verification] 17. Basic grammar of SystemVerilog learning 4 (randomization)
轻松上手Fluentd,结合 Rainbond 插件市场,日志收集更快捷
Register of assembly language by Wang Shuang
随机推荐
Pytorch(六) —— 模型调优tricks
Quick analysis of Intranet penetration helps the foreign trade management industry cope with a variety of challenges
青龙面板--花花阅读
[quick start of Digital IC Verification] 15. Basic syntax of SystemVerilog learning 2 (operators, type conversion, loops, task/function... Including practical exercises)
快解析内网穿透助力外贸管理行业应对多种挑战
Complex network modeling (II)
LeetCode简单题之字符串中最大的 3 位相同数字
Roulette chart 2 - writing of roulette chart code
Empire CMS collection Empire template program general
Niu Mei's mathematical problem --- combinatorial number
Openjudge noi 2.1 1752: chicken and rabbit in the same cage
[untitled]
Leetcode simple question: find the K beauty value of a number
Unityhub cracking & unity cracking
Vulnerability recurrence easy_ tornado
Implementation of replacement function of shell script
The largest 3 same digits in the string of leetcode simple question
在Rainbond中实现数据库结构自动化升级
uniapp 移动端强制更新功能
使用 Nocalhost 开发 Rainbond 上的微服务应用