imutils中resize的width和height关系
介绍
imutils中resize,我们一般就传入两个参数,一个需要修改大小的图像,一个weight或者是height,是根据的长宽比一起修改的。
当参数只有width
import cv2 as cv
import imutils
img=cv.imread('./pictures/01.jpg')#size(1445,1071,3)
print(img.shape)
for width in (400,300,200):
img=imutils.resize(img,width=width)
cv.imshow('img', img)
print(img.shape)
cv.waitKey(0