Why is there a difference in the output image when calling the same image using plt.show
& cv2.imshow()
?
Here is my code:
Because OpenCV stores images in BGR order instead of RGB.
Try plt.imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))
See here for an example.
OpenCV - BGR and Matplotlib - RGB
OpenCV:
https://docs.opencv.org/2.4/doc/tutorials/introduction/display_image/display_image.html
Matplotlib:
https://matplotlib.org/api/_as_gen/matplotlib.pyplot.imshow.html