Python-opencv的安装
2020-04-22 本文已影响0人
AI秘籍
1.安装
python下安装:pip install opencv-python
image.png
参考:
opencv官网:https://docs.opencv.org/4.2.0/d2/de6/tutorial_py_setup_in_ubuntu.html
image.png
2.读取显示保存
https://docs.opencv.org/4.2.0/dc/d2e/tutorial_py_image_display.html
import cv2 as cv
import numpy as np
img = cv.imread("0.png", 0) # 读取图片
cv.imshow('image', img) # 显示图片
cv.imwrite("test.jpg", img) # 保存图片
cv.waitKey()
cv.destoryAllWindows()
image.png
https://www.cnblogs.com/wbyixx/p/12210894.html