1.Python3+OpenCV中的shape命令获取图片的高度、宽度、深度
import cv2
fn="1.jpg"
img = cv2.imread(fn)
[height,width,pixels] = img.shape
print(height,width,pixels)
参考:https://blog.csdn.net/qq_15505637/article/details/78539240
2.Python3+OpenCV中的 cv2.resize(源文件,目标,变换方法)将图片变换为想要的尺寸
#如:要将一个图片变为32*32大小的
import cv2
image=cv2.imread('test.jpg')
res=cv2.resize(image,</