import matplotlib 
import matplotlib.pyplot as plt
%matplotlib inline

im=plt.imread('../lena.jpg', pyplot.cm.gray)
plt.imshow(im)

imread()中,第一个参数当然是图像路径和名称,第二个参数设置的是灰度图显示.默认是彩色图,或者把灰度图通过colormap转成彩色图显示.具体可以见下面链接里的,

Colormaps选项,可以设置你选者那种colormap方式其实。

matplotlib的使用详细可以参考这里

http://www.labri.fr/perso/nrougier/teaching/matplotlib/

http://wiki.scipy.org/Cookbook/Matplotlib/Show_colormaps

 

相关文章:

  • 2021-10-20
  • 2021-12-05
  • 2021-10-12
  • 2021-11-01
  • 2021-12-14
  • 2021-05-31
  • 2022-12-23
  • 2021-11-28
猜你喜欢
  • 2022-12-23
  • 2021-12-05
  • 2021-11-28
  • 2021-10-05
  • 2021-09-03
  • 2022-12-23
相关资源
相似解决方案