Reading images in python

前端 未结 9 1987
北海茫月
北海茫月 2021-02-03 19:59

I am trying to read a png image in python. The imread function in scipy is being deprecated and they recommend using imageio

9条回答
  •  后悔当初
    2021-02-03 20:11

    With matplotlib you can use (as shown in the matplotlib documentation)

    import matplotlib.pyplot as plt
    import matplotlib.image as mpimg
    
    img=mpimg.imread('image_name.png')
    

    And plot the image if you want

    imgplot = plt.imshow(img)
    

提交回复
热议问题