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
