当前位置:网站首页>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);
边栏推荐
- 【数字IC验证快速入门】13、SystemVerilog interface 和 program 学习
- 云原生存储解决方案Rook-Ceph与Rainbond结合的实践
- 漏洞复现-Fastjson 反序列化
- Recursive method to construct binary tree from preorder and inorder traversal sequence
- LeetCode简单题之找到一个数字的 K 美丽值
- The element with setfieldsvalue set is obtained as undefined with GetFieldValue
- Minimum absolute difference of binary search tree (use medium order traversal as an ordered array)
- Notes on PHP penetration test topics
- Qinglong panel - today's headlines
- ZCMU--1396: 队列问题(2)
猜你喜欢
LeetCode简单题之字符串中最大的 3 位相同数字
【数字IC验证快速入门】14、SystemVerilog学习之基本语法1(数组、队列、结构体、枚举、字符串...内含实践练习)
追风赶月莫停留,平芜尽处是春山
复杂网络建模(一)
[quick start of Digital IC Verification] 15. Basic syntax of SystemVerilog learning 2 (operators, type conversion, loops, task/function... Including practical exercises)
buureservewp(2)
在Rainbond中一键部署高可用 EMQX 集群
Es FAQ summary
Bugku CTF daily one question chessboard with only black chess
Dedecms collects content without writing rules
随机推荐
让Livelink初始Pose与动捕演员一致
Use of JMeter
通俗易懂单点登录SSO
Qinglong panel -- finishing usable scripts
复杂网络建模(二)
Battery and motor technology have received great attention, but electric control technology is rarely mentioned?
船载雷达天线滑环的使用
eBPF Cilium实战(1) - 基于团队的网络隔离
The element with setfieldsvalue set is obtained as undefined with GetFieldValue
Don't stop chasing the wind and the moon. Spring mountain is at the end of Pingwu
JS quick start (I)
Register of assembly language by Wang Shuang
QT learning 26 integrated example of layout management
海信电视开启开发者模式
Vulnerability recurrence easy_ tornado
解读创客思维与数学课程的实际运用
青龙面板--花花阅读
漏洞複現-Fastjson 反序列化
Uniapp mobile terminal forced update function
Fast parsing intranet penetration escorts the document encryption industry