I want to crop RGB images such that the upper half part of the image is removed. After cropping I want to concatenate the image to a numpy array (here images). But I get the following error ValueError: all the input array dimensions except for the concatenation axis must match exactly. I tried multiple things but I don't seem to have luck with any of my attempts.
My code looks like
images = np.zeros((1, 32, 64, 3))
image = get_image() # has shape 1, 64, 64, 3
# removing the first coordinate didn't change the error.
images = np.concatenate([images, image[:, 32:63, :, :]], axis=0)
EDIT: The following modifications in image[:, 32:63, :, :] did not resolve the problem
a) [:, 32:63, :, :] -> [32:63, :, :]
b) [:, 32:63, :, :] -> [:][32:63][:][:]