error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'解决办法

当代码为
img1=img[y1:y2, x1:x2]
img1 = cv2.resize(img1, (64, 128), interpolation=cv2.INTER_CUBIC)
cv2.imwrite(“C:\Study\SSD_detection\SSD-Tensorflow-master\gallery\image” + str(random.random()) + “.jpg”, img1)
时出现了该错误,我的解决办法是把img1=img[y1:y2, x1:x2]改为
img1=img[x1:x2, y1:y2],程序就正常运行了

你可能感兴趣的:(error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'解决办法)