import cv2
import os
# 原来的图片路径
data_path = "E:/ZhaowkSVN/image-retrieval-jsdd/new_images/yuan/"
# 保存图片路径
result_path = "E:/ZhaowkSVN/image-retrieval-jsdd/new_images/yuan2/"
filenames = os.listdir(data_path)
print(data_path)
for filename in filenames:
print(filename)
# 读取图像
image = cv2.imread(data_path + filename)
# 改变图片尺寸
res = cv2.resize(image, (1920, 1080), interpolation=cv2.INTER_CUBIC)
# 保存图片
cv2.imwrite(result_path + filename, res)