Skip to content

Commit 2094b62

Browse files
authored
Add files via upload
1 parent 4797aac commit 2094b62

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#encoding:utf-8
2+
#By:Eastmount CSDN 2021-07-30
3+
import cv2
4+
import numpy as np
5+
6+
#读取图片
7+
src = cv2.imread('test06.png', cv2.IMREAD_UNCHANGED)
8+
9+
#设置卷积核
10+
kernel = np.ones((10,10), np.uint8)
11+
12+
#图像顶帽运算
13+
result = cv2.morphologyEx(src, cv2.MORPH_TOPHAT, kernel)
14+
15+
#显示图像
16+
cv2.imshow("src", src)
17+
cv2.imshow("result", result)
18+
19+
#等待显示
20+
cv2.waitKey(0)
21+
cv2.destroyAllWindows()
22+

0 commit comments

Comments
 (0)