opencv 不能在函数中调整图像大小吗

问题遇到的现象和发生背景

遍历照片文件时,缩放图像成统一大小出现错误

问题相关代码,请勿粘贴截图

PIC_PATH = "D:\photo" # 照片文件夹地址
width, height = 1000, 1000 # 缩放比例

pic_path = os.listdir(PIC_PATH) # 所有照片的文件列表
same_pic_index = [] # 相同图像的索引列表
imgs = [] # 缩放后的图像对象列表
has_same = set() # 相同图像的集合
count = len(pic_path) # 照片数量

if count == 0:
print("没有图像!")
sys.exit(0)

for pic_name in pic_path: # 遍历照片文件
name = PIC_PATH + pic_name # 拼接完整文件名
img = cv2.imread(pic_name) # 创建文件的图像
img = cv2.resize(img, (width, height)) # 缩放成统一大小
imgs.append(img) # 按文件顺序保存图像对象

运行结果及报错内容

(-215) ssize.width > 0 && ssize.height > 0 in function cv::resize

我的解答思路和尝试过的方法

这个是可以自定义的。

resizeWindow("学校风景", 1958, 1080);    //窗口名字,宽度,长度