Skip to content

Commit f354189

Browse files
authored
Create blog06-image01.py
1 parent 43761bb commit f354189

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

blog06-resize/blog06-image01.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#encoding:utf-8
2+
import cv2
3+
import numpy as np
4+
5+
#读取图片
6+
src = cv2.imread('scenery.png')
7+
8+
#图像缩放
9+
result = cv2.resize(src, (200,100))
10+
print result.shape
11+
12+
#显示图像
13+
cv2.imshow("src", src)
14+
cv2.imshow("result", result)
15+
16+
#等待显示
17+
cv2.waitKey(0)
18+
cv2.destroyAllWindows()

0 commit comments

Comments
 (0)