import os
import cv2
import numpy as np
from google.colab.patches import cv2_imshow
from PIL import Image
train_path_positive = "/content/Dataset_P5/Train/Positive"
positive_patches = []
for filename in os.listdir(train_path_positive):
image = cv2.imread(train_path_positive + "/" +filename,0)
image = cv2.resize(image, (500,500))
print(image.shape)
positive_patches.append(image)
positive_patches_array = np.array(positive_patches)
我有 15 张 jpg 格式的图片
当我尝试打印形状时,我得到(15,)
并且我试图输入这些图片并将其存储在数组中,格式为(15, 500,500)