Hello, I'm working on pre-processing my images and wanted to apply gray scaling. This is my code:
test_path = "C:\cvpr_emotic\mscoco\preprocessingtest\*.jpg"
images = [cv2.imread(image) for image in glob.glob(test_path)]
fig=plt.figure(figsize=(8, 4))
rows, cols = 2, 3
for j in range(0, cols*rows):
fig.add_subplot(rows, cols, j+1)
images[j] = cv2.cvtColor(images[j], cv2.COLOR_BGR2GRAY)
plt.imshow(images[j])
plt.axis('off')
plt.show()
Which result into the picture below. Anyone knows how to fix it? Converting the color to RGB, HSV, YUV etc works perfectly fine, it's just gray that doesn't work properly. Everything I've done to the images is in the code.