python-office
python-office copied to clipboard
AttributeError: 'NoneType' object has no attribute 'shape'
import poimage
def removesy(input_image,output_image): # 支持jpg、png等所有图片格式 poimage.del_watermark(input_image=input_image,output_image=output_image)
if name == "main":
input_image="C:/Users/zhangtao/Desktop/1/1.png"
output_image="C:/Users/zhangtao/Desktop/1/1.0.png"
removesy(input_image,output_image)
你可以选择将这两个路径都改成全英文的路径便可解决。或者将poimge库的del_watermark方法下的cv2.imread()和cv2.imread()改成cv2.imdecode()。