10 lines
363 B
Python
Raw Permalink Normal View History

from pyzxing import BarCodeReader
reader = BarCodeReader()
results = reader.decode('binary_qrcode-A1.jpg')
print(results[0])
# # 支持输入文件模式以检测多个文件
# results = reader.decode('/PATH/TO/FILES/*.png')
# print(results)
# 支持传入图片的向量
# 需要额外安装opencvpip install opencv-python
# results = reader.decode_array(img)