什么是ZBar?
ZBar是一个开源库,用于扫描、读取二维码和条形码。支持的二维码包括:EAN/UPC,QR等。
ubuntu16.04安装方式
sudo apt-get install libzbar-dev
pip install zbar
# 亲测有效 centos7 安装方式
yum install python-devel
yum install zbar-devel
pip install zbar
python zbar识别二维码
from pyzbar.pyzbar import decode
from PIL import Image
image = iss
img = Image.open(image)
barcodes = decode(img)
for barcode in barcodes:
url = barcode.data.decode("utf-8")
print(url)
原文:https://www.cnblogs.com/lutt/p/13734914.html
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!