OpenCV: Grayscale image displayed in greenish color [duplicate]

筅森魡賤 提交于 2019-12-12 10:34:10

问题


I am doing my first steps using OpenCV (version 3.3.0 from opencv-python package on Mac OS). Using OpenCV inside jupyter notebook and displaying a greyscale image through matplotlibresults in a greenish image instead of a greyscale one.

%matplotlib inline

import cv2 as cv
import numpy as np

import matplotlib.pyplot as plt

plt.rcParams['figure.figsize'] = (8.0, 8.0)

img = cv.imread('IMG_20171212_222022.jpg', cv.IMREAD_GRAYSCALE)

plt.imshow(img)

Do you know where this comes from? Is this a bug or desired behavior?

来源:https://stackoverflow.com/questions/47782311/opencv-grayscale-image-displayed-in-greenish-color

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!