基本信息
源码名称:python 多张图片黑底白字转白底黑字
源码大小:0.67KB
文件格式:.py
开发语言:Python
更新时间:2020-03-20
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍

需要 pip install sheen

原图:

转换后:




 

nn = 1
str_name1 = 'cut'
str_name3 = '.png'
rootdir = r'C:\Users\Administrator\Downloads\Downloads'
for parent, dirnames, filenames in os.walk(rootdir):
    for filename in filenames:
        print('parent is :'   parent)
        print('filename is :'   filename)
        currentPath = os.path.join(parent, filename)
        print('THe full filename is:'   currentPath)
        image=cv2.imread(currentPath)
        image2=cv2.bitwise_not(image)
        dizhi = r'C:\Users\Administrator\Downloads\a'
        dizhi = dizhi   str_name1   str(nn)   str_name3
        cv2.imwrite(dizhi, image2)
        nn  = 1