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

前端 未结 12 1318
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 04:50

    image=myCamera.getImage().crop(xx,xx,xx,xx).scale(xx,xx).greyscale()
    

    You can use greyscale() directly for the transformation.

提交回复
热议问题