opencv python版-lesson 11
2019-10-13 本文已影响0人
writ
缩放,平移,旋转.仿射变换,透视变换
import numpy as np
import cv2
img=cv2.imread('test.jpg')
# res=cv2.resize(img,None,fx=2,fy=2,interpolation=cv2.INTER_CUBIC)
height,width=img.shape[:2]
res=cv2.resize(img,(2*width,2*width),interpolation=cv2.INTER_CUBIC)
print('i love opencv')
while(1):
cv2.imshow('res',res)
cv2.imshow('img',img)
if cv2.waitKey(1)&0xFF==27:
break
cv2.destroyAllWindows()