'Inserting element on numpy array
path = glob.glob('Foto/*.jpg')
x = 0
for i in path:
matrix = cv2.imread(i)
gray = cv2.cvtColor(matrix, cv2.COLOR_BGR2GRAY)
img_mat = np.array([np.array(gray)]).astype(float)
print(img_mat.shape)
I have about 50 files in 'Foto/' Folder with the resolution of 100x120, so the img_mat.shape should be (50, 100, 120) but why is it only showing (1, 100, 120)??
ps. sorry if my english is bad
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
