Difference between plt.show and cv2.imshow?

后端 未结 2 1645
梦如初夏
梦如初夏 2020-12-16 12:12

Why is there a difference in the output image when calling the same image using plt.show & cv2.imshow()?

Here is my code:



        
2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-16 12:46

    Because OpenCV stores images in BGR order instead of RGB.

    Try plt.imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))

    See here for an example.

提交回复
热议问题