第一步:在python27文件夹下建立一个mytool文件夹,然后创建showpicture.py
#coding:utf-8
'''
python showpicture.py --image *.png
'''
from PIL import Image
from pylab import *
from PCV.tools import imtools
import argparse
import cv2
ap = argparse.ArgumentParser()
ap.add_argument("-i","--image",required=True,help="Path to the image")
args = vars(ap.parse_args())
from matplotlib.font_manager import FontProperties
font = FontProperties(fname=r"C:/Windows/Fonts/msyh.ttc", size=14)
#im = array(Image.open('C:/pytm/pic/ceshi.jpg').convert('L'))
im1 = array(Image.open(args["image"]))
subplot()
axis('off')
title(u'Picture', fontproperties=font)
imshow(im1)
show()