Opencv 入门读写图片
import cv2
img=cv2.imread(“D:\Python\OpenCV\OpenCV\test.png”,-1)#读取指定路径的图片
cv2.imshow(“test”,img)
cv2.waitKey()
cv2.destroyAllWindows()
cv2.imwrite(“D:\Python\OpenCV\OpenCV\test1.png”,img)#在指定路径保存图片
Opencv 入门读写图片
import cv2
img=cv2.imread(“D:\Python\OpenCV\OpenCV\test.png”,-1)#读取指定路径的图片
cv2.imshow(“test”,img)
cv2.waitKey()
cv2.destroyAllWindows()
cv2.imwrite(“D:\Python\OpenCV\OpenCV\test1.png”,img)#在指定路径保存图片