OPENCV获取图片宽度和高度

img1 = cv2.imread('face.jpg',0) # queryImage
img2 = cv2.imread('2.jpg',0) # trainImage
##width
print(img1.shape[1])
#height
print(img1.shape[0])