How can I add these images which I have converted to a (95,95) array into an array that gives me the number of images I have (in my case 10) and the dimensions of those images (95,95)? My desired output would be an array <10,95,95>.
This is my code so far, thank you! code:
import cv2
import os
from matplotlib import pyplot as plt
# https://www.ocr2edit.com/convert-to-txt
x_train = "C:/Users/cuevas26/ae/crater_images_test"
categories = ["crater"]
#for category in categories:
path = x_train
for img in os.listdir(path):
img_array = cv2.imread(os.path.join(path, img), cv2.IMREAD_GRAYSCALE)
imgs = cv2.resize(img_array, (95, 95))
plt.imshow(imgs, cmap="gray")
plt.show()
print(type(imgs))
print(imgs.shape)