I am trying to crop an image in RGB and I have a problem with building these images. I get all the images from a specific folder using this function:
def get_images(path, image_type):
image_list = []
for filename in glob.glob(path + '/*'+ image_type):
im=misc.imread(filename, mode='RGB')
image_list.append(im)
return image_list
This function creates a 4d array (30, 1536, 2048, 3), and I'm sure that the first value represents the number of images, the second and third represent dimensions, and the third represent RGB values.
After I got all the images, I saved them as a numpy array
image_list = get_images('C:\HDR\images', '.jpg')
temp = np.array(image_list)
After that, I tried using simple slicing to get specific colors from these images:
red_images = temp[:,:,:,0]
green_images = temp[:,:,:,1]
blue_images = temp[:,:,:,2]
When I print out the values, everything seems beautiful.
print(temp[11,125,311,:])
print(red_images[11,125,311])
print(green_images[11,125,311])
print(blue_images[11,125,311])
And I get the following:
[105 97 76]
105
97
76
, , . matplotlib.pyplot.imshow , :

, :
plt.imshow(temp[29,:,:,0])
, :
plt.imshow(temp[29,:,:,2])
:

. ?