1.opencv基本操作
import cv2
path = "G:/test2/1.jpg"
# path代表路径,0表示灰度图,1表示彩色图
img = cv2.imread(path,1) # 路径放在里面读取
#读进来什么形式<class 'numpy.ndarray'>
print(type(img))
# 读取图片的存储形式[H-W][高-宽]
print(img.shape)
#存储类型
img1 =cv2.imread("G:/test2/3.jpg",1)
print(img1.shape)
cv2.imshow('11',img1)
cv2.waitKey(0)
输出:
D:\Anaconda3\envs\tensorflow\python.exe G:/labelme_json.py
<class 'numpy.ndarray'>
(480, 640, 3)
(480, 640, 3)
Process finished with exit code 0