如果你的文件用的都是utf-8格式,那就把open(img1,'r') 改成open(img1,'r',encoding='utf-8') 试试
open(img1,'r')
open(img1,'r',encoding='utf-8')