Skip to content

Commit b532b2b

Browse files
authored
Add files via upload
1 parent 501b1fb commit b532b2b

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

blog34-based-opencv/blog34_15.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# -*- coding:utf-8 -*-
2+
import cv2
3+
import numpy as np
4+
5+
#创建黑色图像
6+
img = np.zeros((256,256,3), np.uint8)
7+
8+
#绘制文字
9+
font = cv2.FONT_HERSHEY_SIMPLEX
10+
cv2.putText(img, 'I love Python!!!',
11+
(10, 100), font, 0.6, (255, 255, 0), 2)
12+
13+
#显示图像
14+
cv2.imshow("polylines", img)
15+
16+
#等待显示
17+
cv2.waitKey(0)
18+
cv2.destroyAllWindows()

0 commit comments

Comments
 (0)