python的img.shape函数

img = cv2.imread(img_path,-1)

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

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

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

 

posted @ 2020-06-03 14:45  像阳光,像春天  阅读(33134)  评论(0编辑  收藏  举报