方法一:opencv
import cv2
img = cv2.imread("/home/cqh2/faceData/LFW/Abdel_Madi_Shabneh/Abdel_Madi_Shabneh_0001.jpg")
print(img)
cv2.imshow("Image", img)
cv2.waitKey (0)
cv2.destroyAllWindows()
from scipy.misc import imread
%matplotlib inline
import matplotlib.pyplot as plt # plt 用于显示图片
path = "/home/cqh2/faceData/LFW/Abdel_Nasser_Assidi/Abdel_Nasser_Assidi_0001.jpg"
image = imread(path)
print(image)
plt.imshow(image) # 显示图片
%matplotlib inline
import matplotlib.pyplot as plt # plt 用于显示图片
import matplotlib.image as mpimg # mpimg 用于读取图片
path = "/home/cqh2/faceData/LFW/Abdel_Madi_Shabneh/Abdel_Madi_Shabneh_0001.jpg"
image = mpimg.imread(path)
plt.imshow(image)
print(image)
from PIL import Image
path = "/home/cqh2/faceData/LFW/Abdel_Madi_Shabneh/Abdel_Madi_Shabneh_0001.jpg"
im = Image.open(path)
im.show()
print(im)