I am trying to display an RGB image using matplotlib. This is the code:
# import libraries
import numpy as np
import cv2
from matplotlib import pyplot as plt
# use opencv to load the image
image = cv2.imread("path/to/file/image.jpg", 1)
# convert it to numpy array
pixels = np.array(image)
And then, when I try to visualize the image with:
plt.imshow(pixels)
plt.show()
It returns a picture that is all blue. I don't understand why, since the image is a normal colored image. I tried with multiple images, and the problem persists. Moreover, with my laptop at work I didn't get any problem.