修改图片尺寸

 1 import cv2 as cv
 2 img = cv.imread('C:/Users/87823/Desktop/Aaron_Ecke.jpg')
 3 print('原来图片的形状:',img.shape)
 4 #resize_img = cv.resize(img,dsize=(150,200))
 5 resize_img = cv.resize(img,dsize=(300,200))
 6 print('现在图片的形状:',resize_img.shape)
 7 cv.imshow('resize_img',resize_img)
 8 while True:
 9     if ord('q') == cv.waitKey(0):
10         break
11 cv.destroyAllWindows()

 

posted @ 2020-05-20 15:35  小他_W  阅读(194)  评论(0编辑  收藏  举报