import cv2 image = cv2.imread("example.png") rows, cols, _ = image.shape for i in range(1, 101): # 计算缩放因子 scale = i / 100 # 对图像进行缩放 resized_image = cv2.resize(image, None, fx=scale, fy=scale, interpolation=cv2.INTER_LINEAR) cv2.imshow("Scaled", resized_image) cv2.waitKey(50) cv2.destroyAllWindows()