赞
踩
《OpenCV系列教程》
项目位置:OpenCV-Sample
代码位置:5-ImageResize.py
import cv2
img = cv2.imread('./res/aero3.jpg')
print(img.shape[:2])
height, width = img.shape[:2]
reSize1 = cv2.resize(img, (2*width, 2*height), interpolation=cv2.INTER_CUBIC)
reSize2 = cv2.resize(img, (int(width/2), int(height/2)), interpolation=cv2.INTER_CUBIC)
cv2.imshow('reSize1', reSize1)
cv2.imshow('reSize2', reSize2)
cv2.waitKey()
cv2.destroyAllWindows()
interpolation参数说明:
interpolation 选项 | 所用的插值方法 |
---|
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。