当前位置:网站首页>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);

边栏推荐
- Use of JMeter
- Qinglong panel -- finishing usable scripts
- LeetCode简单题之找到一个数字的 K 美丽值
- Implementation of replacement function of shell script
- Leetcode 187 Repeated DNA sequence (2022.07.06)
- Recursive method to construct binary tree from preorder and inorder traversal sequence
- 追风赶月莫停留,平芜尽处是春山
- 使用 Nocalhost 开发 Rainbond 上的微服务应用
- Recursive construction of maximum binary tree
- 柯基数据通过Rainbond完成云原生改造,实现离线持续交付客户
猜你喜欢
![[quick start of Digital IC Verification] 15. Basic syntax of SystemVerilog learning 2 (operators, type conversion, loops, task/function... Including practical exercises)](/img/e1/9a047ef13299b94b5314ee6865ba26.png)
[quick start of Digital IC Verification] 15. Basic syntax of SystemVerilog learning 2 (operators, type conversion, loops, task/function... Including practical exercises)

快解析内网穿透为文档加密行业保驾护航

What is the function of paralleling a capacitor on the feedback resistance of the operational amplifier circuit

JS cross browser parsing XML application

LeetCode简单题之字符串中最大的 3 位相同数字

OpenVSCode云端IDE加入Rainbond一体化开发体系

藏书馆App基于Rainbond实现云原生DevOps的实践

漏洞複現-Fastjson 反序列化

Yugu p1020 missile interception (binary search)

Codeforce c.strange test and acwing
随机推荐
【数字IC验证快速入门】13、SystemVerilog interface 和 program 学习
漏洞复现-easy_tornado
王爽 《汇编语言》之寄存器
运放电路的反馈电阻上并联一个电容是什么作用
解析创新教育体系中的创客教育
Codeforce c.strange test and acwing
青龙面板--整理能用脚本
Explore dry goods! Apifox construction ideas
调用 pytorch API完成线性回归
【无标题】
[quick start of Digital IC Verification] 15. Basic syntax of SystemVerilog learning 2 (operators, type conversion, loops, task/function... Including practical exercises)
Complete linear regression manually based on pytoch framework
【数字IC验证快速入门】14、SystemVerilog学习之基本语法1(数组、队列、结构体、枚举、字符串...内含实践练习)
Bugku CTF daily one question chessboard with only black chess
OpenVSCode云端IDE加入Rainbond一体化开发体系
Notes on PHP penetration test topics
Yugu p1020 missile interception (binary search)
Network learning (III) -- highly concurrent socket programming (epoll)
Dedecms collects content without writing rules
eBPF Cilium实战(1) - 基于团队的网络隔离