opencv-python

2022-01-07  本文已影响0人  lk_erzanml

安装的时候一定要注意,安装和python对应的版本https://www.lfd.uci.edu/~gohlke/pythonlibs/#wordcloud
下载whl,然后pip install .whl文件

import numpy as np
import cv2 as cv

img = cv.imread('u=4198287529,2774471735&fm=193&f=GIF.jpeg',0) #read photo
cv.namedWindow('photo_title',cv.WINDOW_NORMAL)
cv.imshow('photo_title',img)
cv.waitKey(0)
cv.destroyAllWindows()
import numpy as np
import cv2 as cv

img = cv.imread('u=4198287529,2774471735&fm=193&f=GIF.jpeg',0) #read photo
cv.namedWindow('photo_title',cv.WINDOW_NORMAL)
cv.imshow('photo_title',img)
k = cv.waitKey(0)
if k == 27:         # 等待ESC退出
    cv.destroyAllWindows()
elif k == ord('s'): # 等待关键字,保存和退出
    cv.imwrite('messigray.png',img)
    cv.destroyAllWindows()
import numpy as np
import cv2 as cv
# 创建黑色的图像
img = np.zeros((512,512,3), np.uint8)
# 绘制一条厚度为5的蓝色对角线
cv.line(img,(0,0),(511,511),(255,0,0),5)
cv.imshow('photo_title',img)
cv.waitKey(0)
cv.destroyAllWindows()
上一篇下一篇

猜你喜欢

热点阅读