plt(import matplotlib.pyplot as plt)读入格式为RGB
CV 读入格式为BGR
所以在使用plt显示图片的时候,若想要正常显示,首先需要
import cv2
import matplotlib.pyplot as plt
img = cv2.imread("")
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
plt.imshow(img)
plt(import matplotlib.pyplot as plt)读入格式为RGB
CV 读入格式为BGR
所以在使用plt显示图片的时候,若想要正常显示,首先需要
import cv2
import matplotlib.pyplot as plt
img = cv2.imread("")
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
plt.imshow(img)