美文网首页
opencv python版-lesson 11

opencv python版-lesson 11

作者: writ | 来源:发表于2019-10-13 19:38 被阅读0次

    缩放,平移,旋转.仿射变换,透视变换

    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()
    

    相关文章

      网友评论

          本文标题:opencv python版-lesson 11

          本文链接:https://www.haomeiwen.com/subject/utekmctx.html