当我编写此调整图像大小以进行增强的代码时。它给了我错误。在这里它告诉我调整图像大小的错误
np.random.seed(1000)
randomDim = 100
dirs = os.listdir("preprocessed_images/")
inputX=np.zeros((len(dirs),28,28))
inputXP=np.zeros((len(dirs),256,256,3))
for i in range(0,len(dirs)):
imgg=cv2.imread("preprocessed_images/"+str(i+1)+'.png')
resizedImage=cv2.resize(imgg,(28,28))
inputX[i,:,:]=resizedImage[:,:,0]
inputXP[i,:,:]=cv2.resize(imgg,(256,256))
inputX=inputX.astype(np.float32)
IT给出了如下错误,如下所示
File "<ipython-input-3-8e93e7d5d6dc>", line 27, in <module>
resizedImage=cv2.resize(imgg,(28,28)) enter code here
error: OpenCV(3.4.1) C:\Miniconda3\conda-bld\opencv-
suite_1533128839831\work\modules\imgproc\src\resize.cpp:4044: error: (-215) ssize.width > 0 &&
ssize.height > 0 in function cv::resize
请看这个问题并解决这个问题