res = cv2.resize(res, dsize=(64, 64), interpolation=cv2.INTER_CUBIC)
import cv2
src = cv2.imread('D:/cv2-resize-image-original.png', cv2.IMREAD_UNCHANGED)
#percent by which the image is resized
scale_percent = 50
#calculate the 50 percent of original dimensions
width = int(src.shape[1] * scale_percent / 100)
height = int(src.shape[0] * scale_percent / 100)
# dsize
dsize = (width, height)
# resize image
output = cv2.resize(src, dsize)
cv2.imwrite('D:/cv2-resize-image-50.png',output)
原因: None- 空图像 - 显示 ssize.empty()
# 我的是数组维度[1,1,h,w] 用a = np.squeeze(a) https://blog.csdn.net/ResumeProject/article/details/125446333
https://stackoverflow.com/questions/67737650/cv2-error-opencv4-5-2-resize-cpp4051-error-215assertion-failed-ssize
https://www.w3bai.com/en-US/jquery/jquery_dimensions.html
https://pythonexamples.org/python-opencv-cv2-resize-image/