对于Python,有丰富的第三方包,不需要重复轮子。在这里,图片的二维码是借助PYZBAR和CV2包进行解析的。
[En]
For python, there are rich third-party packages and there is no need to repeat the wheel. Here, the QR code of the picture is parsed with the help of pyzbar and cv2 packages.
直接转到代码:
[En]
Go directly to the code:
def read_zbar(img):
'''
读取二维码图片信息
:param img: 二维码图片绝对路径
:dependent: 引用第三方包
from pyzbar import pyzbar
import cv2
:return: 二维码信息list []
'''
code_list = pyzbar.decode(cv2.imread(img))
return [code.data.decode("utf-8") for code in code_list]
Original: https://www.cnblogs.com/yhleng/p/14683975.html
Author: _天枢
Title: python解析图片二维码
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/6648/
转载文章受原作者版权保护。转载请注明原作者出处!