myqr.py 文件源码

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

项目:QR-Replace 作者: Metruption 项目源码 文件源码
def insertQR(image, data):
    '''
    @params:
        image is the image that we'll be messing with
        data is what will be encoded in the QR code
    inserts a QR code into the image at the specified bounds
    the new qr code should fit the bounds and seem natural (like it was the original imge)
    '''
    qr_gen = qrcode.QRCode(
        version = None,
        box_size = 4,
        border = 0
    );
    qr_gen.add_data(data)
    qr_gen.make(fit=True)

    qrCode = qr_gen.make_image()
    pgram = scanImage2(image)
    #pgram = expandParallelogram(pgram, 15)
    return warpImage(image, qrCode, pgram)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号