How can I convert an RGB image into grayscale in Python?

前端 未结 12 1295
Happy的楠姐
Happy的楠姐 2020-11-22 04:43

I\'m trying to use matplotlib to read in an RGB image and convert it to grayscale.

In matlab I use this:

img = rgb2gray(imread(\'image.p         


        
12条回答
  •  借酒劲吻你
    2020-11-22 05:05

    If you're using NumPy/SciPy already you may as well use:

    scipy.ndimage.imread(file_name, mode='L')

提交回复
热议问题