区别 image.shape[0],image.shape[1],image.shape[2]

区别 image.shape[0],image.shape[1],image.shape[2]

image.shape[0], 图片垂直尺寸

image.shape[1], 图片水平尺寸

image.shape[2], 图片通道

python的img.shape函数 - 走看看 (zoukankan.com)

img = cv2.imread(img_path,-1)

print(img.shape) #参数-1为按原通道读入,不写的话默认读入三通道图片,例如(112,112,3)

print(img.shape[0])#读入的时图片的高度height

print(img.shape[1])#读入的时图片的宽度weight

posted @ 2022-03-01 13:00  _海阔天空  阅读(1244)  评论(0)    收藏  举报