Python: how cv2.imread() reads an image

Original image size: 768*576

img[0] is the first full column of the image ! img [575] 576 is an image of the entire column!

import cv2
img=cv2.imread('C:/Users/Admin/Desktop/xunlian/train/0.png')
print('img一共含有多少个矩阵:\n',len(img))
print('第576个矩阵是:\n',img[575])
print('第576个矩阵含有多少个向量:\n',len(img[575]))
print('读入的img图像矩阵:\n',img)

Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_45234219/article/details/114887380