# -*- coding: Latin-1 -*- # Programme d'affichage d'une image avec MatPlotLib et Scipy # Dominique Lefebvre pour TangenteX.com # 5 janvier 2016 # # importation des librairies from scipy import misc import matplotlib.pyplot as plt # ouverture du fichier image ImageFile = 'e:\PhysNumWeb1\images\hawkeye.jpg' try: img = misc.imread(ImageFile) except: print 'Erreur sur ouverture du fichier ' + ImageFile sys.exit(1) # affichage des caractéristiques de l'image print img.shape # affichage de l'image plt.imshow(img) plt.axis('off') plt.show()