# 调整大小
import os
import cv2
# 读取图像
img = cv2.imread(os.path.join('.', 'dogs.jpg'))
resize_img = cv2.resize(img,(640,480))
# 打印图像大小
print(img.shape)
cv2.imshow('img', img)
cv2.imshow('resize_img', resize_img)
cv2.waitkey(0)
# 调整大小
import os
import cv2
# 读取图像
img = cv2.imread(os.path.join('.', 'dogs.jpg'))
resize_img = cv2.resize(img,(640,480))
# 打印图像大小
print(img.shape)
cv2.imshow('img', img)
cv2.imshow('resize_img', resize_img)
cv2.waitkey(0)