测试

作者: l猫宁一 | 来源:发表于2020-06-01 01:15 被阅读0次
    def draw_a_black_unit(p, x, y, ul):
        draw = ImageDraw.Draw(p)
        font = ImageFont.truetype("/Library/Fonts/Arial Unicode.ttf", 10, encoding="utf-8")
        colors = ["red","orange","green","blue","purple"]
        color = random.choice(colors)
        draw.text((x, y), '●', fill = color, font=font)
    

    nihao

    myqr https://space.bilibili.com/279911711
    

    你好

    def mask(mm, m):
        mps = get_mask_patterns(mm)
        scores = []
        for mp in mps:
            score = 0
            for i in range(len(mp)):
                for j in range(len(mp)):
                    mp[i][j] = mp[i][j] ^ m[i][j]
                    if mp[i][j] == 1:
                        score += 1
            scores.append(score)
        best = scores.index(min(scores))
    

    相关文章

      网友评论

          本文标题:测试

          本文链接:https://www.haomeiwen.com/subject/vgwdzhtx.html