open-cv

调整图像大小


#一般使用
import cv2
src = cv2.imread("/home/yon/Desktop/netease/pic1x1.png")
cv2.imshow("ss",src)
cv2.waitKey(10)
-1
cv2.destroyAllWindows()


###调整大小
cv2.destroyAllWindows()
resized = cv2.resize(src,(640, 200), interpolation = cv2.INTER_CUBIC)
cv2.imshow("sss", resized)
cv2.waitKey(10)
-1
cv2.destroyAllWindows()

##存储调整后的图片
resized = cv2.resize(src,(640, 200), interpolation = cv2.INTER_CUBIC)
cv2.imwrite("/home/yon/Desktop/netease/1111.png", resized)
True


###结果:图片有些失真,会有模糊不清
原文地址:https://www.cnblogs.com/g2thend/p/12392411.html