linux ubuntu16.04 opencv 读取,显示,保存图片

import numpy as np
import cv2
img=cv2.imread(r'./tu/a.jpg')
cv2.imshow('image',img)
k=cv2.waitKey(0)&0xFF
if k==27:
   cv2.destroyAllWindows()
elif k==ord('s'):
   cv2.imwrite('a1.jpg',img)
   cv2.destroyAllWindows()


import numpy as np
import cv2
from matplotlib import pyplot as plt

img=cv2.imread(r'./tu/a.jpg')
plt.imshow(img,cmap='gray',interpolation ='bicubic')
plt.xticks([]),plt.yticks([])
plt.show()

展开阅读全文

没有更多推荐了,返回首页