读入格式区别
plt读入格式为RGB
CV 读入格式为BGR
import cv2
import matplotlib.pyplot as plt
img = cv2.imread('lena.jpg') #img bgr
b, g, r = cv2.split(img)
img2 = cv2.merge([r, g, b])# img2 rgb
plt.subplot(121);
plt.imshow(img)
plt.subplot(122);
plt.imshow(img2)
plt.show()
cv2.imshow('img_bgr image', img)
cv2.imshow('img2_rgb image', img2)
cv2.waitKey(0)
cv2.destroyAllWindows()