solver.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:random 作者: s3gm3nt4ti0nf4ult 项目源码 文件源码
def main():
    x_min, x_max = det_size()
    list_of_points = []
    line = []
    lines = []
    with open('data.txt', 'r') as f:
        for l in f.readlines():
            x, y = (int(l.split(',')[0][1:])),(int(l.split(',')[1][:-2]))
            list_of_points.append((x,y))

    for i in range(x_max):
        line = []
        for j in range(x_max):
            if (j,i) in list_of_points:
                line.append(255)
            else:
                line.append(0)

        lines.append(line)

    y = np.array([np.array(xi) for xi in lines])
    plt.imshow(y,cmap='Greys', interpolation='none')
    name = 'qrdecode.png'
    mir_name = name[:-4]+'_mirr.png'
    plt.axis('off')
    plt.savefig(name)
    #plt.show()
    im = Image.open(name)
    im = ImageOps.mirror(im)
    #im.show()
    im.save(mir_name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号