📌  相关文章
📜  来自 opencv 的图像以蓝色显示 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:49.281000             🧑  作者: Mango

代码示例1
# matplotlib interprets images in RGB format, but OpenCV uses BGR format

# so to convert the image so that it's properly loaded, convert it before loading

img = cv2.imread('filename.ext')        # this is read in BGR format
rgb_img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)        # this converts it into RGB

plt.imshow(rgb_img)
plt.show()