我正在使用matplotlib的imread函数从文件系统读取图像。然而,当它显示这些图像时,会改变jpg图像的颜色。[Python 3.5,Anaconda3 4.3,matplotlib2.0]
# reading 5 color images of size 32x32
imgs_path = 'test_images'
test_imgs = np.empty((5,32,32,3), dtype=float)
img_names = os.listdir('test_images'+'/')
for i, img_name in enumerate(img_names):
#reading in an image
image = mpimg.imread(imgs_path+'/'+img_name)
test_imgs[i] = image
#Visualize new raw images
plt.figure(figsize=(12, 7.5))
for i in range(5):
plt.subplot(11, 4, i+1)
plt.imshow(test_imgs[i])
plt.title(i)
plt.axis('off')
plt.show()
它给所有图像添加了一种蓝绿色的色调。我做错了什么吗?