使用cv2.resize时出错(图片,(64,64))

时间:2018-03-14 15:29:55

标签: cv2 resize-image

使用下面给出的代码调整多个图像的大小

i=0

labels=[]

train_data = [] 

for img in (glob.glob(folder_path)):

   test_image = cv2.imread(img)

   labels.append(img[58:-4])

   test_image = cv2.resize(test_image, ( (272,272)))

   train_data.append(test_image)

   cv2.imwrite('C:/Users/HIMANSHU/Documents/Python Scripts/input/material_resize/'+labels[i]+'.jpeg',train_data[i])
   i=i+1

我收到以下错误:

  

文件"",第7行,in       test_image = cv2.resize(test_image,((272,272)))

     

错误:   C:\ bld \ opencv_1510966172919 \ work \ opencv-3.3.0 \ modules \ imgproc \ src \ imgwarp.cpp:3483:错误:(-215)ssize.width> 0&& ssize.height> 0在功能上   CV ::调整大小

0 个答案:

没有答案