2016-12-01 142 views

回答

1

使用CV2 - 讀取更here

import cv2 
img = cv2.imread('path/to/img.jpg') 
resized = cv2.resize(img, (128, 128), cv2.INTER_LINEAR) 
print pic 

使用skimage - 閱讀更多here

import skimage.io as skio 
faces = skio.imread_collection('path/to/images/*.pgm',conserve_memory=True) # can load multiple images at once 

使用SciPy的 - 讀更多here

from scipy import misc 
pic = misc.imread('path/to/img.jpg') 
print pic 

繪製圖像

import matplotlib.pyplot as plt 
plt.imshow(faces[0],cmap=plt.cm.gray_r,interpolation="nearest") 
plt.show() 
+0

感謝您的回答,乾杯! –

相關問題